AI API Gateway
One token for Claude, GPT, Gemini and Qwen, fully compatible with each vendor's official SDK — migrating usually means changing two lines: base_url and api_key.
- Protocol compatibility: call the OpenAI, Anthropic and Gemini native protocols directly, no rewrite required
- Streaming: full SSE streaming with first-token latency on par with going direct
- Model catalog: available models with context windows and capabilities (vision / tools / thinking)
- Usage and billing: per-token billing with usage breakdowns per key
A unified multi-provider gateway with 3 official protocol entry points: Anthropic / OpenAI / Gemini. Any of the three formats can call every model on the gateway. Billed on token usage × official price × the multiplier of the pricing group your key uses, with no fixed monthly fee.
Basic Info
- Authorization: Bearer sk-nc-... (Gemini also supports x-goog-api-key / ?key=)
- After signing in, create one on the "AI Services → API Keys" page
- Official USD/MTok price × the pricing group's multiplier; if the group has off-peak hours, requests made during them are also multiplied by the off-peak rate. Pre-deducted from balance; streaming calls settle asynchronously when they finish
- Calling GPT with the Anthropic SDK or calling Claude with the OpenAI SDK are both supported — the gateway translates protocols automatically
3 Call Formats
Anthropic /v1/messages
Uses Claude's messages protocol; the most widely adopted SDK (@anthropic-ai/sdk / anthropic for Python)
OpenAI /v1/chat/completions
OpenAI Chat Completions protocol; supports tools / streaming / multimodal
Gemini /v1beta/models/...
Google Gemini native protocol; the model in the path determines routing
Service and Speed Tiers
The gateway always forwards requests at the standard tier and bills the standard price; there are no discounted or faster tiers:
- service_tier (flex / fast / priority, etc.) is removed from OpenAI-format request bodies
- speed (fast mode) is removed from Anthropic-format request bodies
- The X-Service-Tier header has no effect; requests that send it are handled at the standard tier
Error Codes
- 401 — API Key invalid or disabled
- 402 insufficient_balance — Insufficient balance: available balance (after unsettled charges) is ≤ 0, or not enough for the amount reserved for this request (estimated from the model's context and output limits, plus max searches × unit price when server-side web search is used); the error message states the required reservation and what's available. Top up and retry. When available balance drops below $5, responses carry X-Tovanix-Balance-Low: 1 and X-Tovanix-Balance-Available (USD) so you can warn early
- 402 quota_exceeded — This key's monthly spending limit has been reached; it resets next month. You can also change it with "Change limit" on the API Keys page in the console (identity verification required)
- 403 group_unavailable — The pricing group this key uses for the model's provider has been disabled. Switch the key to another group on the API Keys page; the gateway never moves you to another group on its own
- 503 no_upstream_available — The model has no available route in the pricing group your key uses (routes are disabled or temporarily cooling down). Retry later, or, if that provider has several groups, switch the key to another group on the API Keys page
- 502 — The model service is temporarily unavailable or returned a response that could not be parsed; retry later
More Endpoints
Beyond chat, the gateway also provides:
GET /v1/models
List currently routable models (OpenAI-compatible; works with SDK models.list())
POST /v1/embeddings
Text embeddings (OpenAI-compatible; send input, get vectors; billed per token)
Python / Node.js Examples
For the full Playground, pricing, and call logs, head to User Center → AI Services.
Frequently Asked Questions
How much code changes when migrating from a vendor API?
Usually just base_url and api_key. The gateway is drop-in compatible with the official SDKs and protocols — request bodies, response shapes and streaming formats all stay the same.
Is streaming supported?
Yes. SSE streaming is fully supported, stream=true works straight from the official SDKs, and first-token latency matches calling the vendor directly.
Related pages: AI Services · API Documentation · Global AI solution
Loading…