Documentation

Three lines to your first token.

The API is OpenAI-compatible by default, with native Anthropic and Gemini protocol paths. Everything below is demo copy pending the v1 contract freeze.

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.

  1. Create an account at api.latiaoapi.com/register.
  2. Create a key under API Keys. The plaintext is shown once.
  3. Send a request with the base URL https://api.latiaoapi.com/v1.
POST https://api.latiaoapi.com/v1/chat/completions
curl https://api.latiaoapi.com/v1/chat/completions \
  -H "Authorization: Bearer $LATIAO_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4.5",
    "messages": [{"role": "user", "content": "Ship it."}]
  }'

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.

Authorization: Bearer lt_live_xxxxxxxxxxxxxxxxxxxx
  • 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
ProtocolPathNotes
OpenAI/v1/chat/completionsAlso /v1/responses and /v1/embeddings
Anthropic/v1/messagesStreaming and tool blocks supported
Gemini/v1beta/models/:modelgenerateContent 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.

from openai import OpenAI

client = OpenAI(base_url="https://api.latiaoapi.com/v1", api_key="lt-...")

with client.chat.completions.create(
    model="claude-sonnet-4.5",
    messages=[{"role": "user", "content": "Explain failover in one line."}],
    stream=True,
) as stream:
    for chunk in stream:
        print(chunk.choices[0].delta.content or "", end="")
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.

{
  "model": "gpt-6-astra",
  "messages": [{ "role": "user", "content": "What is the weather in Lisbon?" }],
  "tools": [{
    "type": "function",
    "function": {
      "name": "get_weather",
      "description": "Current weather for a city",
      "parameters": {
        "type": "object",
        "properties": { "city": { "type": "string" } },
        "required": ["city"]
      }
    }
  }]
}

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
CodeHTTPMeaning
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.

ANTHROPIC_BASE_URL=https://api.latiaoapi.com
ANTHROPIC_AUTH_TOKEN=lt-...

Codex CLI

OpenAI-compatible chat completions.

OPENAI_BASE_URL=https://api.latiaoapi.com/v1
OPENAI_API_KEY=lt-...

Cursor

Settings → Models → OpenAI API key → override base URL.

Base URL: https://api.latiaoapi.com/v1
API key: lt-...

OpenCode

Any OpenAI-compatible provider entry works.

provider: openai-compatible
baseURL: https://api.latiaoapi.com/v1

Cline

Set the model ID exactly as listed on the models page.

API Provider: OpenAI Compatible
Base URL: https://api.latiaoapi.com/v1

Cherry Studio

Enable streaming and tool use in the assistant settings.

API Host: https://api.latiaoapi.com
API Key: lt-...

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.