Docs · Getting started
Create an API key and choose a route
The key drawer step by step, what each route means, and the three 403 refusals a key can hit.
Open API keys in the sidebar and click Create API key.
The form
- Name: any label; the placeholder suggests
production-backend. - Group: the route the key is billed on. Nothing is preselected; saving without one fails with Choose a group. An N models button on each row expands its price table (USD per 1M tokens, USD per image or USD per second), with a Long context row where that tier exists.
- Quota: Unlimited quota on, or off with a Quota (USD) after which the key stops.
- Expiry: an Expiration time, or a preset: Never, 1 Hour, 1 Day, 1 Month.
- Quantity (creating only): up to 50 keys; the first keeps the name you typed, the rest get a random suffix.
- Advanced settings, collapsed by default: Model limits and IP Whitelist (supports CIDR), both empty.
Click Save changes. The key starts with sk-.
The routes
Auto route is listed first and covers the whole catalogue with one key. Each request goes to the lowest-priced line that can serve its model right now, normally the shared pool; when the pool cannot, it goes to the official line at its higher price, so the billed route can differ per request. The usage log shows that route under Group.
- Claude, OpenAI and Grok: a Shared pool (
claude-shared,openai-shared,grok-shared) at 50% of list and an Official line (claude-official,openai-official,grok-official) at 90%. A text model is sold only on its own vendor's two routes. Grok's official line is also the only route forgrok-imagine-video-1.5, per second. - Claude Special offer (
claude-special, marked Opus 5.5 only · limited time · often unavailable): a temporary line forclaude-opus-5-5only, at $0.45 input / $0.90 output / $0.10 cache read / $0.20 cache write ($0.30 for a 1-hour write) per million tokens. It is often unavailable for long stretches with no availability guarantee, adds its own system prompt to every request, has no fallback and is never chosen by Auto route; selecting it shows its terms under the list. See Claude Opus 5.5 special offer. - OpenAI Image generation (
image): the only route forgpt-image-2.6-sunburstandgpt-image-2.6-flare, per image by size. - GLM Private deployment (
z-official):GLM-5.3-Abliterated, a fine-tuned GLM-5.3, text only, andGLM-5.3-Flash-Abliterated, which also takes images. - Kimi Private deployment (
kimi-official, marked Private deployment · fixed prices):kimi-k3.1-pro. - DeepSeek Private deployment (
deepseek-official, marked Private deployment · fixed prices):deepseek-flash-Abliteratedanddeepseek-flash-fast, DeepSeek V4.1 Flash 1017 on standard weights. - TypeSafe Official line (
typesafe-official, marked Official key · fixed price):jev-1.14.0, which also lists a backup price for the rare request its standby line serves. Its Full API key popover adds One-command setup for Jev.
The GLM, Kimi and DeepSeek route ids are retained for keys, but none of these models calls the provider's official API, and their prices are fixed at every hour (GLM-5.3-Abliterated, kimi-k3.1-pro and deepseek-flash-Abliterated also list a backup price for the rare request their standby deployment serves); the route overview lists them.
Claude, OpenAI and Grok official-line requests fall back to the shared pool when no dedicated line is configured; for a dedicated official-price line, write to support@topxai.xyz.
Automatic backup switching
Text routes with a configured backup track failures separately for each model and API protocol (Chat Completions, Messages and Responses). By default, three consecutive upstream failures move new requests to the backup at once, and a single failure already starts a background check of the line. A request that has not produced output retries on the backup straight away.
While the primary is out, the relay checks it in the background and sends it no customer requests. After two background checks pass, one request at a time may try the primary, and two successes at least 30 seconds apart return the line to primary. A line that fails again soon after recovering stays on the backup longer, because each switch rebuilds the prompt cache. Requests already streaming keep their connection. Continuation requests that depend on one upstream's session state may not be able to change lines.
Client parameter errors, insufficient balance, content refusals and client cancellations do not count toward the failure threshold. The API key and endpoint stay the same. Where a line lists a backup price, each request still tries the primary first; only a request the primary could not answer uses the backup and pays that price. There is no switching fee. Image generation and asynchronous video jobs are outside this text-route policy.
Three refusals
Three checks run before a provider is reached; each fails with HTTP 403:
Model is not offered by this service: the model id is not in the catalogue.Model is not available on this API key route: the model is not on this key's route, such as a GPT model on a Claude key.This token has no access to model <name>: the key's Model limits exclude it. Pick them under Select models (empty allows all);jev-latestandjev-previewcount asjev-1.14.0here.
IP Whitelist takes one IP or CIDR block per line; addresses can be spoofed, so pair it with a gateway such as nginx or a CDN.
Related
- Shared pool, official line and auto route
- Connect your SDK
- Top up with a card
- Reading your usage log
Previous: What TopxAI is · Next: Connect your SDK
Other languages: 简体中文