Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# AGENTS.md — uapi-sdk-csharp

This file tells AI coding agents how to use the **official .NET / C# SDK**
for the [uapis.cn](https://uapis.cn) public API platform.

## What this package is

Idiomatic .NET client for UAPI, targeting `net8.0`. Generated from the live
OpenAPI 3.1 spec at <https://uapis.cn/openapi.json>.

## Install

```bash
dotnet add package Uapi.Sdk
```

## Quick start

```csharp
using Uapi.Sdk;

var client = new UapiClient("https://uapis.cn");
var weather = await client.Misc.GetMiscWeatherAsync(new GetMiscWeatherRequest
{
City = "北京"
});
Console.WriteLine(weather);
```

The client is grouped by tag (`Misc`, `Network`, `Text`, `Image`, `Social`,
`Translate`, `Search`, …). Method names match the OpenAPI `operationId`,
PascalCased and suffixed with `Async`.

## Authentication

Free-tier endpoints work with no key. Paid endpoints take a key:

```csharp
var client = new UapiClient("https://uapis.cn", apiKey: "sk_…");
```

## Errors

Methods throw `UapiApiException` on non-2xx responses. The exception
carries `Code`, `Error`, and `RequestId` properties. Surface `Error`
verbatim.

## Rate limits

Headers `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`,
`Retry-After` are exposed on response headers. Honor them.

## Related repos

- 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-cpp`, `uapi-sdk-php`.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 AxT-Team / UAPI

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
13 changes: 13 additions & 0 deletions uapi-sdk-csharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,21 @@
<Nullable>enable</Nullable>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<Version>1.0.5</Version>
<PackageId>Uapi.Sdk</PackageId>
<Authors>UAPI / AxT-Team</Authors>
<Company>UAPI</Company>
<Description>Official .NET / C# SDK for UAPI / uapis.cn — typed .NET 8 wrapper around 100+ free public-API endpoints (network, text, image, social, translation, search). Generated from the live OpenAPI 3.1 spec.</Description>
<PackageTags>uapi;uapis;sdk;dotnet;public-api;free-api;openapi;rest;client;agent;llm</PackageTags>
<PackageProjectUrl>https://uapis.cn/docs/sdk/csharp</PackageProjectUrl>
<RepositoryUrl>https://github.com/AxT-Team/uapi-sdk-csharp</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>banner.png</PackageIcon>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use a NuGet-compliant icon asset

In the tag release workflow I checked, this project is packed and pushed to NuGet (.github/workflows/release.yml), but PackageIcon now points at banner.png, which is 2,341,600 bytes and 1920x1080. NuGet embedded package icons are limited to 1 MB, so releases using this metadata can be rejected during publish; use a smaller icon asset or drop PackageIcon until one is available.

Useful? React with 👍 / 👎.

</PropertyGroup>
<ItemGroup>
<Compile Include="src/**/*.cs" />
<None Include="README.md" Pack="true" PackagePath="\" />
<None Include="banner.png" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>
Loading