Quick start
Create an API key in the console, top up a balance, then point any OpenAI SDK at the
LATIAO base URL. No other code changes are required.
- Create an account at
api.latiaoapi.com/register. - Create a key under API Keys. The plaintext is shown once.
- Send a request with the base URL
https://api.latiaoapi.com/v1.
POST https://api.latiaoapi.com/v1/chat/completions
A successful response includes a platform request id in the
x-latiao-request-id header. Quote it when contacting support — never post a
key in a ticket.
Authentication
Every request requires a bearer token. Keys are scoped to a group of models and a set of
limits; create separate keys per environment.
- Keys are shown in plaintext once, at creation. Store them in a secret manager.
- Revoking a key takes effect immediately on the next request.
- Never send keys from a browser or mobile app; proxy through your backend.
- Console sessions use short-lived cookies; API keys are not accepted on the console.
Compatibility
Three protocol families are served from one host:
Protocol paths | Protocol | Path | Notes |
| OpenAI | /v1/chat/completions | Also /v1/responses and /v1/embeddings |
| Anthropic | /v1/messages | Streaming and tool blocks supported |
| Gemini | /v1beta/models/:model | generateContent and streamGenerateContent |
Model IDs are quoted exactly as shown on /models. Aliases such as
claude-sonnet-latest resolve to the current stable build of that family.
Streaming
Add "stream": true to receive server-sent events. Chunks are
OpenAI-compatible deltas; the final data frame carries usage and cost.
Timeouts. Send stream_options: {"include_usage": true}
to guarantee a usage frame. If the connection drops mid-stream, you are billed only for
delivered tokens.
Tool calls
Function calling follows the OpenAI schema. Tools are forwarded to the selected model;
unsupported combinations return LATIAO_MODEL_UNAVAILABLE instead of silently
dropping the request.
Streamed tool calls arrive as incremental tool_calls deltas with an index.
Errors
Errors use one envelope: { "error": { "code", "message", "request_id" } }.
Messages are safe to show to end users; they never contain upstream provider details.
Platform error codes | Code | HTTP | Meaning |
| LATIAO_INSUFFICIENT_BALANCE | 402 | Your balance is below the cost of this request. Top up to continue. |
| LATIAO_RATE_LIMITED | 429 | Too many requests. Retry after the number of seconds in Retry-After. |
| LATIAO_MODEL_UNAVAILABLE | 503 | The model is temporarily unavailable and failover found no healthy route. |
| LATIAO_KEY_REVOKED | 401 | The API key was revoked or has expired. Create a new key in the console. |
| LATIAO_REGION_BLOCKED | 403 | Traffic from this region is not served. See the acceptable use policy. |
| LATIAO_TAX_ID_INVALID | 422 | The VAT/GST identifier failed validation at checkout. |
| LATIAO_PAYMENT_DECLINED | 402 | The payment method was declined. Retry with a different method. |
| LATIAO_CHARGEBACK_HOLD | 403 | Account credit is on hold while a chargeback is reviewed. |
| LATIAO_DATA_REQUEST_PENDING | 409 | A GDPR export or deletion request is already in progress for this account. |
Retries. Retry 429 and 503 with exponential
backoff and jitter. Do not retry 401, 402 or 403 —
they require a change on your side.
Client setup
These clients work without a plugin. Set the base URL and key, then pick a model ID.
Claude Code
Uses the native Anthropic /v1/messages protocol.
Codex CLI
OpenAI-compatible chat completions.
Cursor
Settings → Models → OpenAI API key → override base URL.
OpenCode
Any OpenAI-compatible provider entry works.
Cline
Set the model ID exactly as listed on the models page.
Cherry Studio
Enable streaming and tool use in the assistant settings.
Rate limits
Limits are enforced per key and per group: requests per minute, tokens per minute and
concurrent streams. Paid plans raise the defaults; enterprise limits are set per account.
- Responses include
x-ratelimit-limit-requests and x-ratelimit-remaining-requests. 429 responses include Retry-After in seconds. - Bursts are smoothed over a short window; sustained overage is rejected, not queued.
Need higher limits? Contact us with your
expected requests per minute and model mix.
Changelog
- 2026-11-15 · 0.1 draft — Documentation skeleton published with the brand site preview.
- Planned · 0.2 — Wire examples to the frozen v1 OpenAPI contract, add Cmd+K search and per-code snippets.
Preview notice. Endpoint paths and error codes on this page follow
contracts/openapi/latiao.v1.yaml and may change before launch.