This file tells AI coding agents how to use the official C++ SDK for the uapis.cn public API platform.
Header-only C++17 client for UAPI. Generated from the live OpenAPI 3.1 spec at https://uapis.cn/openapi.json.
CMake (FetchContent):
include(FetchContent)
FetchContent_Declare(
uapi-sdk-cpp
GIT_REPOSITORY https://github.com/AxT-Team/uapi-sdk-cpp
GIT_TAG main
)
FetchContent_MakeAvailable(uapi-sdk-cpp)
target_link_libraries(my_app PRIVATE uapi)#include <uapi/client.hpp>
int main() {
uapi::Client client("https://uapis.cn");
auto weather = client.misc().get_misc_weather({.city = "北京"});
std::cout << weather.dump() << std::endl;
}The client is grouped by tag (misc(), network(), text(), image(),
social(), translate(), search(), …). Method names match the OpenAPI
operationId, snake_cased.
Free-tier endpoints work with no key. Paid endpoints take a key:
uapi::Client client("https://uapis.cn", "sk_…");Methods throw uapi::ApiException on non-2xx responses. The exception
carries code, error, and request_id fields. Surface error
verbatim.
Headers X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset,
Retry-After are exposed on response headers. Honor them.
- MCP server: https://github.com/AxT-Team/uapi-mcp.
- Skills bundle: https://github.com/AxT-Team/uapi-agent-skills.
- Other languages:
uapi-sdk-typescript,uapi-sdk-python,uapi-sdk-go,uapi-sdk-rust,uapi-sdk-java,uapi-sdk-csharp,uapi-sdk-php.