Skip to content

Commit 7c278df

Browse files
shuakamidevin-ai-integration[bot]
authored andcommitted
Add LICENSE, AGENTS.md, and richer package metadata
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent cfea59c commit 7c278df

3 files changed

Lines changed: 120 additions & 2 deletions

File tree

‎AGENTS.md‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# AGENTS.md — uapi-sdk-php
2+
3+
This file tells AI coding agents how to use the **official PHP SDK** for
4+
the [uapis.cn](https://uapis.cn) public API platform.
5+
6+
## What this package is
7+
8+
Idiomatic PHP client for UAPI, targeting PHP 8.1+. Generated from the live
9+
OpenAPI 3.1 spec at <https://uapis.cn/openapi.json>.
10+
11+
## Install
12+
13+
```bash
14+
composer require axt-team/uapi-sdk-php
15+
```
16+
17+
## Quick start
18+
19+
```php
20+
<?php
21+
require_once 'vendor/autoload.php';
22+
23+
use Uapi\UapiClient;
24+
use Uapi\Models\GetMiscWeatherRequest;
25+
26+
$client = new UapiClient('https://uapis.cn');
27+
$weather = $client->misc->getMiscWeather(new GetMiscWeatherRequest(city: '北京'));
28+
print_r($weather);
29+
```
30+
31+
The client is grouped by tag (`misc`, `network`, `text`, `image`, `social`,
32+
`translate`, `search`, …). Method names match the OpenAPI `operationId`,
33+
camelCased.
34+
35+
## Authentication
36+
37+
Free-tier endpoints work with no key. Paid endpoints take a key:
38+
39+
```php
40+
$client = new UapiClient('https://uapis.cn', apiKey: 'sk_…');
41+
```
42+
43+
## Errors
44+
45+
Methods throw `Uapi\Exceptions\UapiApiException` on non-2xx responses. The
46+
exception carries `code`, `error`, and `requestId` properties. Surface
47+
`error` verbatim.
48+
49+
## Rate limits
50+
51+
Headers `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`,
52+
`Retry-After` are exposed on responses. Honor them.
53+
54+
## Related repos
55+
56+
- MCP server: <https://github.com/AxT-Team/uapi-mcp>.
57+
- Skills bundle: <https://github.com/AxT-Team/uapi-agent-skills>.
58+
- Other languages: `uapi-sdk-typescript`, `uapi-sdk-python`, `uapi-sdk-go`,
59+
`uapi-sdk-rust`, `uapi-sdk-java`, `uapi-sdk-csharp`, `uapi-sdk-cpp`.

‎LICENSE‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 AxT-Team / UAPI
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎composer.json‎

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,44 @@
11
{
22
"name": "axt-team/uapi-sdk-php",
3+
"description": "Official PHP SDK for UAPI / uapis.cn — typed PHP 8.1+ wrapper around 100+ free public-API endpoints (network, text, image, social, translation, search). Generated from the live OpenAPI 3.1 spec.",
34
"type": "library",
4-
"require": { "php": ">=8.1", "guzzlehttp/guzzle": "^7.8" },
5-
"autoload": { "psr-4": { "Uapi\\": "src/" } }
5+
"license": "MIT",
6+
"homepage": "https://uapis.cn/docs/sdk/php",
7+
"keywords": [
8+
"uapi",
9+
"uapis",
10+
"uapis.cn",
11+
"sdk",
12+
"php",
13+
"public-api",
14+
"free-api",
15+
"rest",
16+
"rest-api",
17+
"openapi",
18+
"client",
19+
"http",
20+
"ai",
21+
"agent"
22+
],
23+
"authors": [
24+
{
25+
"name": "UAPI",
26+
"email": "dev@uapis.cn",
27+
"homepage": "https://uapis.cn"
28+
}
29+
],
30+
"support": {
31+
"issues": "https://github.com/AxT-Team/uapi-sdk-php/issues",
32+
"source": "https://github.com/AxT-Team/uapi-sdk-php",
33+
"docs": "https://uapis.cn/docs"
34+
},
35+
"require": {
36+
"php": ">=8.1",
37+
"guzzlehttp/guzzle": "^7.8"
38+
},
39+
"autoload": {
40+
"psr-4": {
41+
"Uapi\\": "src/"
42+
}
43+
}
644
}

0 commit comments

Comments
 (0)