Skip to content

Commit 8c2e4e5

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 203875b commit 8c2e4e5

2 files changed

Lines changed: 89 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# AGENTS.md — uapi-sdk-cpp
2+
3+
This file tells AI coding agents how to use the **official C++ SDK** for
4+
the [uapis.cn](https://uapis.cn) public API platform.
5+
6+
## What this library is
7+
8+
Header-only C++17 client for UAPI. Generated from the live OpenAPI 3.1
9+
spec at <https://uapis.cn/openapi.json>.
10+
11+
## Install
12+
13+
CMake (FetchContent):
14+
15+
```cmake
16+
include(FetchContent)
17+
FetchContent_Declare(
18+
uapi-sdk-cpp
19+
GIT_REPOSITORY https://github.com/AxT-Team/uapi-sdk-cpp
20+
GIT_TAG main
21+
)
22+
FetchContent_MakeAvailable(uapi-sdk-cpp)
23+
24+
target_link_libraries(my_app PRIVATE uapi)
25+
```
26+
27+
## Quick start
28+
29+
```cpp
30+
#include <uapi/client.hpp>
31+
32+
int main() {
33+
uapi::Client client("https://uapis.cn");
34+
35+
auto weather = client.misc().get_misc_weather({.city = "北京"});
36+
std::cout << weather.dump() << std::endl;
37+
}
38+
```
39+
40+
The client is grouped by tag (`misc()`, `network()`, `text()`, `image()`,
41+
`social()`, `translate()`, `search()`, …). Method names match the OpenAPI
42+
`operationId`, snake_cased.
43+
44+
## Authentication
45+
46+
Free-tier endpoints work with no key. Paid endpoints take a key:
47+
48+
```cpp
49+
uapi::Client client("https://uapis.cn", "sk_…");
50+
```
51+
52+
## Errors
53+
54+
Methods throw `uapi::ApiException` on non-2xx responses. The exception
55+
carries `code`, `error`, and `request_id` fields. Surface `error`
56+
verbatim.
57+
58+
## Rate limits
59+
60+
Headers `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`,
61+
`Retry-After` are exposed on response headers. Honor them.
62+
63+
## Related repos
64+
65+
- MCP server: <https://github.com/AxT-Team/uapi-mcp>.
66+
- Skills bundle: <https://github.com/AxT-Team/uapi-agent-skills>.
67+
- Other languages: `uapi-sdk-typescript`, `uapi-sdk-python`, `uapi-sdk-go`,
68+
`uapi-sdk-rust`, `uapi-sdk-java`, `uapi-sdk-csharp`, `uapi-sdk-php`.

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.

0 commit comments

Comments
 (0)