Call text, image, video, speech and music models with one API key. Text uses the standard Chat Completions format; media runs as async tasks.
An API is how a program sends a question to an AI and gets the answer back. Follow the five steps below and you'll get your first answer in about ten minutes, even with little coding experience.
Sign up and confirm your email with the link we send. Verified accounts get $5 in trial credits, so you can test without topping up.
Open Playground in the console, pick a model, and send a message. Find a model you like there, then move to code.
Create a key under API Keys in the console. The full key (starting with sk_) is shown only once, so copy it somewhere safe right away. Treat it like a password.
Pick whichever is easiest for you. In every example, replace sk_YOUR_KEY with the key you copied in step 3.
from openai import OpenAI
client = OpenAI(
base_url="https://api.gaterouter.net/v1",
api_key="sk_YOUR_KEY", # ← replace with the key from the console
)
resp = client.chat.completions.create(
model="glm-5.3",
messages=[{"role": "user", "content": "Hi! Introduce yourself in one line"}],
)
print(resp.choices[0].message.content)Nothing to install: paste this into Terminal and press Enter.
curl https://api.gaterouter.net/v1/chat/completions \
-H "Authorization: Bearer sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "glm-5.3", "messages": [{"role": "user", "content": "Hi!"}]}'The curl command above doesn't work as-is on Windows. Open PowerShell from the Start menu and paste this instead.
$headers = @{ Authorization = "Bearer sk_YOUR_KEY" }
$body = @{
model = "glm-5.3"
messages = @(@{ role = "user"; content = "Hi!" })
} | ConvertTo-Json -Depth 5
$res = Invoke-RestMethod -Uri "https://api.gaterouter.net/v1/chat/completions" -Method Post `
-Headers $headers -ContentType "application/json; charset=utf-8" `
-Body ([System.Text.Encoding]::UTF8.GetBytes($body))
$res.choices[0].message.contentThe response comes back as JSON. Two places matter: choices[0].message.content is the AI's answer, and usage is how much you used (tokens). See what it cost under Usage in the console.
{
"model": "glm-5.3",
"choices": [
{
"message": {
"role": "assistant",
"content": "Hi! I'm an AI assistant that answers your questions." ← the AI's answer
},
"finish_reason": "stop" ← the answer finished normally
}
],
"usage": {
"prompt_tokens": 12, ← size of what you sent
"completion_tokens": 18, ← size of the answer
"total_tokens": 30 ← what you're billed on
}
}How to write prompts for each kind of model. The console Playground shows the guide for whichever model you pick, with examples you can insert.
Say what to draw, where, and in what style, in that order. The more specific, the closer the result.
Product photo of a matte black ceramic coffee mug on a light oak table, soft morning window light, shallow depth of field, minimal Scandinavian kitchen background, high detailMinimal concert poster, bold sans-serif title that reads "SUMMER NIGHTS", neon pink and deep blue gradient sky, silhouette of a crowd with raised hands, grainy print textureWatercolor illustration of a small fox wearing a yellow raincoat, standing under a red umbrella on a rainy village street, warm lamp light, children's book styleFor video, describe how things move, not just what's there.
Aerial drone shot slowly flying forward over a turquoise coastline at sunrise, waves rolling onto white sand, gentle mist, cinematic, golden lightA sleek silver wristwatch slowly rotates on a black reflective pedestal, a thin light streak sweeps across the dial, static camera, studio lighting, dark backgroundA young woman in a red coat walks through a snowy city street at night and turns to smile at the camera, tracking shot, warm shop lights, falling snowSame formula as other video models; add camera direction plus emotion and expression.
Close-up of an elderly man reading a handwritten letter by a window, his hands tremble slightly and he smiles softly with tears in his eyes, slow push-in, soft afternoon lightA skateboarder kicks off down a sunlit concrete ramp and lands a jump, low-angle tracking shot, dust particles in the air, energetic, shallow depth of fieldUse the common video formula: subject + action + camera + mood.
Time-lapse of a busy Seoul intersection at dusk, car light trails streaking through the frame, clouds moving fast overhead, static wide shotThe person slowly turns their head toward the camera and blinks, hair moves gently in the breeze, subtle camera push-inBrief the model like a colleague: role, task, context and the format you want.
You are a meticulous assistant. Read the meeting notes below and organize them into a table: (1) decisions, (2) action items with owner and due date, (3) open questions.
[paste notes here]You are an e-commerce copywriter. For women in their 20s and 30s, write three friendly versions of a product blurb, two sentences each.
Product: gentle vegan moisturizing cream, 50 mlExtract the name, phone and ordered items from the sentence below. Reply only with JSON shaped {"name":"","phone":"","items":[]}.
Sentence: Hi, this is Jamie Lee, 555-0142, I'd like two white T-shirts and one pair of jeans.GateRouter puts many AI models behind one gateway. Text models use the OpenAI Chat Completions format, so existing OpenAI SDKs work by changing the base URL. Image, video, speech, music and digital-human models use an async submit-then-poll flow (Model Center).
https://api.gaterouter.net| Purpose | Endpoint |
|---|---|
| Text chat | POST /v1/chat/completions |
| List models | GET /v1/models |
| Submit media task | POST /v2/model-center/tasks |
| Query media task | GET /v2/model-center/tasks/{id} |
Send your API key in the Authorization header on every request. Create keys in the console under API Keys; the full value is shown only once, right after creation.
Authorization: Bearer sk_YOUR_KEY
Content-Type: application/jsonOne API key covers text, images and video. Follow these four steps to make your first requests.
Put a model ID below in the model field of your request. If you're new, start with the picks in this table. The full list and prices are in the Models section below and on the Models page of the console.
| Type | Suggested model IDs | Notes |
|---|---|---|
| Text | deepseek-v4.1-flash, glm-5.3, kimi-k3.1-pro, qwen3.8-max | Chat, writing, code. deepseek-v4.1-flash is fast and cheap |
| Image | seedream-5.0, seedream_5.0Pro | Text-to-image, editing from reference images |
| Video | sd_2.0_mini_special, sd_2.5_flash_special, kling-v3-omni, wan3.0-video-c2 | Short clips from text or an image. sd_2.0_mini_special is the cheapest |
Text answers come back right away. The OpenAI SDKs work by changing the base URL.
curl https://api.gaterouter.net/v1/chat/completions \
-H "Authorization: Bearer sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kimi-k3.1-pro",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
}'from openai import OpenAI
client = OpenAI(
base_url="https://api.gaterouter.net/v1",
api_key="sk_YOUR_KEY",
)
resp = client.chat.completions.create(
model="glm-5.3",
messages=[{"role": "user", "content": "Introduce yourself in one line"}],
)
print(resp.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.gaterouter.net/v1",
apiKey: process.env.GATEROUTER_API_KEY,
});
const stream = await client.chat.completions.create({
model: "deepseek-v4.1-flash",
messages: [{ role: "user", content: "Streaming test" }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}Images and video are jobs: you submit one, get a task id back, and fetch the result in step 4.
curl https://api.gaterouter.net/v2/model-center/tasks \
-H "Authorization: Bearer sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream_5.0Pro",
"prompt": "A cute panda eating bamboo, soft sunlight",
"aspect_ratio": "1:1",
"resolution": "2K"
}'{
"id": "task_9f3c…",
"object": "model_center.task",
"created": 1795086000,
"model": "seedream_5.0Pro",
"status": "queued",
"error": null,
"amount": 0.048653,
"currency": "USD",
"amount_is_final": false
}curl https://api.gaterouter.net/v2/model-center/tasks \
-H "Authorization: Bearer sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sd_2.0_mini_special",
"prompt": "Waves crashing on the shore, the camera slowly moves forward",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "720p"
}'Fetch the task with the id from the submit response. When status is completed, the result is in image_url or video_url. Images usually take tens of seconds and video a few minutes, so poll about every 5 seconds.
curl https://api.gaterouter.net/v2/model-center/tasks/task_9f3c… \
-H "Authorization: Bearer sk_YOUR_KEY"{
"id": "task_9f3c…",
"model": "seedream_5.0Pro",
"status": "completed",
"result_url": "https://…/result.png",
"image_url": "https://…/result.png",
"error": null,
"amount": 0.048653,
"currency": "USD",
"amount_is_final": true
}import time, requests
BASE = "https://api.gaterouter.net"
HEADERS = {"Authorization": "Bearer sk_YOUR_KEY"}
task = requests.post(f"{BASE}/v2/model-center/tasks", headers=HEADERS, json={
"model": "sd_2.0_fast_special",
"prompt": "Slow drone flight over waves breaking on a beach",
"duration": 5,
"aspect_ratio": "16:9",
}).json()
while True:
t = requests.get(f"{BASE}/v2/model-center/tasks/{task['id']}", headers=HEADERS).json()
if t["status"] in ("completed", "failed", "delivery_exception", "manual_required"):
break
time.sleep(5)
print(t["status"], t.get("video_url") or t.get("result_url"), t.get("error"))/v1/chat/completionsSame format as OpenAI Chat Completions. Text models only — a media model ID returns a wrong_endpoint error.
| Field | Type | Required | Description |
|---|---|---|---|
| model | string | ✓ | Text model ID (e.g. kimi-k3.1-pro) |
| messages | array | ✓ | Conversation of {role: system|user|assistant, content} |
| stream | boolean | true streams tokens as server-sent events | |
| temperature | number | 0–2; higher is more varied | |
| top_p | number | Nucleus sampling | |
| max_tokens / max_completion_tokens | integer | Max output tokens (either name) | |
| stop | string | string[] | Stop generation at these strings |
{
"id": "req_1636920867e8cbdddb45c709",
"object": "chat.completion",
"created": 1795085914,
"model": "glm-5.3-flash",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "OK" },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 24, "completion_tokens": 3, "total_tokens": 27 },
"billing": { "source": "token_fallback", "cost_micro_usd": 7 }
}billing.cost_micro_usd is what this request deducted (1,000,000 = US$1).
data: {"id":"req_…","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"Hel"}}]}
data: {"id":"req_…","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"lo"}}]}
data: [DONE]/v1/modelsReturns every available model ID in OpenAI format (a data array). The full list is also under Supported models below.
curl https://api.gaterouter.net/v1/models \
-H "Authorization: Bearer sk_YOUR_KEY"Image, video, speech, music and digital human all use ① submit a task → ② poll it by ID. Every model shares the same two endpoints; only model and the per-model parameters differ.
/v2/model-center/taskscurl https://api.gaterouter.net/v2/model-center/tasks \
-H "Authorization: Bearer sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream_5.0Pro",
"prompt": "A small cabin in a snowy forest, warm lights",
"aspect_ratio": "16:9",
"resolution": "2K"
}'{
"id": "task_9f3c…",
"object": "model_center.task",
"created": 1795086000,
"model": "seedream_5.0Pro",
"status": "queued",
"error": null,
"amount": 0.048653,
"currency": "USD",
"amount_is_final": false
}Speech, music and digital human also return a task_ids array (music yields 2 songs per request); id is the first task ID.
/v2/model-center/tasks/{id}curl https://api.gaterouter.net/v2/model-center/tasks/task_9f3c… \
-H "Authorization: Bearer sk_YOUR_KEY"{
"id": "task_9f3c…",
"model": "seedream_5.0Pro",
"status": "completed",
"result_url": "https://…/result.png",
"image_url": "https://…/result.png",
"error": null,
"amount": 0.048653,
"currency": "USD",
"amount_is_final": true
}| status | Meaning |
|---|---|
| queued | Waiting in queue |
| processing | Generating |
| completed | Done — use the result URL |
| failed | Failed — read error |
| delivery_exception / manual_required | Stop polling and contact support (do not resubmit) |
| Result field | Used by |
|---|---|
| result_url | Image and video |
| image_url | Image |
| video_url | Video, digital human |
| audio_url, cover_image_url | Speech, music |
| amount, currency | What this task is billed, in USD |
| amount_is_final | true = final charge; false = estimated maximum before completion |
| error / error_message / error_code | Failure reason |
import time, requests
BASE = "https://api.gaterouter.net"
HEADERS = {"Authorization": "Bearer sk_YOUR_KEY"}
task = requests.post(f"{BASE}/v2/model-center/tasks", headers=HEADERS, json={
"model": "sd_2.0_fast_special",
"prompt": "Slow drone flight over waves breaking on a beach",
"duration": 5,
"aspect_ratio": "16:9",
}).json()
while True:
t = requests.get(f"{BASE}/v2/model-center/tasks/{task['id']}", headers=HEADERS).json()
if t["status"] in ("completed", "failed", "delivery_exception", "manual_required"):
break
time.sleep(5)
print(t["status"], t.get("video_url") or t.get("result_url"), t.get("error"))Models: seedream_5.0Pro, seedream-5.0
| Field | Type | Default / allowed |
|---|---|---|
| prompt * | string | required |
| reference_images | string[] | 0–10 public URLs |
| aspect_ratio | string | "1:1" · 3:4 · 4:3 · 16:9 · 9:16 · 3:2 · 2:3 · 21:9 |
| resolution | string | "1K" · 2K |
| watermark | boolean | false |
Based on the Seedance 2.x family (sd_2.0_*, sd_2.5_*). Kling, Wan, HappyHorse and MiniMax take prompt, duration, aspect_ratio and resolution under the same names, with model-specific ranges.
| Field | Type | Default / allowed |
|---|---|---|
| prompt * | string | required — describe how the scene moves |
| duration * | integer | Seedance 2.0: 4–15 s · 2.5: 4–30 s |
| aspect_ratio | string | "16:9" · 9:16 · 1:1 · 3:4 · 4:3 · 21:9 · adaptive |
| resolution | string | per model (e.g. fast_special: "720p" only) |
| first_image / last_image | string[] | First / last frame image URL array (0–1 each), e.g. ["https://…/start.png"] |
| reference_images | string[] | 0–9 |
| reference_videos / reference_audios | string[] | 0–3 each |
| generate_audio | boolean | true |
| seed | integer | -1 (random) |
| watermark | boolean | false |
| Field | Type | Default / allowed |
|---|---|---|
| prompt * | string | required |
| duration | integer | 3–15 s, default 6 |
| aspect_ratio | string | "16:9" · 9:16 · 1:1 |
| resolution | string | "720p" · 1080p |
| reference_images | string[] | 0–3 |
| reference_mode | string | "image" · frame |
| generate_audio | boolean | false |
| Field | Type | Description |
|---|---|---|
| text * | string | 1–9,999 characters |
| voice_setting * | object | voice_id (required), vol (1, max 10), pitch (-12–12), speed (0.5–2), emotion |
| upstream_model * | string | speech-2.8-hd · speech-2.8-turbo · speech-2.6-hd · speech-2.6-turbo · speech-02-hd · … |
| language_boost | string | Language hint |
| text_normalization_mode | string | basic · quality |
| Field | Type | Description |
|---|---|---|
| mv * | string | chirp-hawk · chirp-hawk-wild · chirp-goose |
| gpt_description_prompt | string | Description mode (don't combine with prompt) |
| prompt | string | Lyrics (max 3,000 chars) |
| tags | string | Style tags (max 200) |
| title | string | Title (max 80) |
| make_instrumental | boolean | Instrumental only |
| negative_tags | string | Styles to avoid |
| Field | Type | Description |
|---|---|---|
| audioUrl * | string | mp3/wav/m4a/mp4 (no CJK characters in the URL) |
| videoUrl * | string | Source person video URL |
| sideFace / tiltedFace | 0 | 1 | Side / tilted face handling |
| modelVersion | string | "v3" · "v3-bigface" |
Text models follow the widely used Chat Completions format, so most tools only need three settings: the base URL, your API key and a model ID.
| Setting | Value |
|---|---|
| Base URL | https://api.gaterouter.net/v1 |
| API key | Your sk_… key from API Keys in the console |
| Model ID | e.g. deepseek-v4.1-flash, kimi-k3.1-pro, glm-5.3 (see Supported models below) |
| Node | Settings |
|---|---|
| ① HTTP Request (name: Submit) | POST https://api.gaterouter.net/v2/model-center/tasks · Header Authorization: Bearer sk_… · Body JSON (below) |
| ② Wait | 30 seconds |
| ③ HTTP Request (poll) | GET https://api.gaterouter.net/v2/model-center/tasks/{{ $('Submit').item.json.id }} |
| ④ IF | {{ $json.status }} is completed → continue (use result_url), failed → handle error, otherwise → back to ② |
{
"model": "sd_2.0_mini_special",
"prompt": "{{ $json.prompt }}",
"duration": 5,
"aspect_ratio": "9:16",
"resolution": "720p"
}# pip install langchain-openai
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="deepseek-v4.1-flash",
base_url="https://api.gaterouter.net/v1",
api_key="sk_YOUR_KEY",
max_tokens=1024,
)
print(llm.invoke("Introduce yourself in one sentence.").content)
# Tool calling works too
from langchain_core.tools import tool
@tool
def get_weather(city: str) -> str:
"""Get the weather for a city."""
return "3C, clear"
msg = llm.bind_tools([get_weather]).invoke("What's the weather in Seoul?")
print(msg.tool_calls)// npm i @langchain/openai
import { ChatOpenAI } from "@langchain/openai";
const llm = new ChatOpenAI({
model: "deepseek-v4.1-flash",
apiKey: "sk_YOUR_KEY",
configuration: { baseURL: "https://api.gaterouter.net/v1" },
});
const res = await llm.invoke("Hello!");
console.log(res.content);Prefix the model with openai/ and set api_base to GateRouter. For the LiteLLM proxy, put the same values in config.yaml.
# pip install litellm
import litellm
res = litellm.completion(
model="openai/kimi-k3.1-pro", # openai/ + GateRouter model ID
api_base="https://api.gaterouter.net/v1",
api_key="sk_YOUR_KEY",
messages=[{"role": "user", "content": "Hello!"}],
max_tokens=1024,
)
print(res.choices[0].message.content)# LiteLLM proxy config.yaml
model_list:
- model_name: kimi
litellm_params:
model: openai/kimi-k3.1-pro
api_base: https://api.gaterouter.net/v1
api_key: os.environ/GATEROUTER_API_KEY
- model_name: deepseek
litellm_params:
model: openai/deepseek-v4.1-flash
api_base: https://api.gaterouter.net/v1
api_key: os.environ/GATEROUTER_API_KEYConnect with the @ai-sdk/openai-compatible provider. generateText, streamText and tools all work.
// npm i ai @ai-sdk/openai-compatible zod
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { generateText, streamText, tool, stepCountIs } from "ai";
import { z } from "zod";
const gaterouter = createOpenAICompatible({
name: "gaterouter",
baseURL: "https://api.gaterouter.net/v1",
apiKey: process.env.GATEROUTER_API_KEY,
includeUsage: true,
});
// Text
const { text } = await generateText({
model: gaterouter("deepseek-v4.1-flash"),
prompt: "Introduce yourself in one sentence.",
});
// Streaming (e.g. a Next.js route handler)
const result = streamText({ model: gaterouter("kimi-k3.1-pro"), prompt: "Write a short poem." });
for await (const part of result.textStream) process.stdout.write(part);
// Tools
const withTools = await generateText({
model: gaterouter("deepseek-v4.1-flash"),
prompt: "Check the weather in Seoul with the tool, then answer in one sentence.",
tools: {
getWeather: tool({
description: "Get the weather for a city",
inputSchema: z.object({ city: z.string() }),
execute: async ({ city }) => ({ city, tempC: 3, sky: "clear" }),
}),
},
stopWhen: stepCountIs(3),
});# ~/.continue/config.yaml
name: GateRouter
version: 1.0.0
schema: v1
models:
- name: Kimi K3.1 Pro (GateRouter)
provider: openai
model: kimi-k3.1-pro
apiBase: https://api.gaterouter.net/v1
apiKey: sk_YOUR_KEY
roles: [chat, edit, apply]
- name: DeepSeek V4.1 Flash (GateRouter)
provider: openai
model: deepseek-v4.1-flash
apiBase: https://api.gaterouter.net/v1
apiKey: sk_YOUR_KEY
roles: [chat, edit, apply]GateRouter takes crypto only. If you are new to it, use USDT on TRC20: it is pegged to the dollar, cheap to send and arrives in minutes.
USDT and USDC also work on cheaper networks: BSC (BEP20), Polygon, Arbitrum, Base (USDC), Solana and TON (USDT). Withdrawing from Binance or a similar exchange? BSC is easiest. Using a Telegram wallet? Pick TON. Whatever you choose, send on the same network you picked on the payment page.
There are two ways to pay. Pick the one that fits where your coins are.
| Method | Best when | Coins · amount |
|---|---|---|
| 1. Send to a payment address | You send from an exchange (Binance…) or a mobile wallet | USDT, USDC, BTC, ETH, SOL on 16 coin/network options · from $12 |
| 2. Pay with wallet | You have USDC in a browser wallet like MetaMask: one signature, no address copying | USDC on Base only · $1–$500 · no gas |
Under Credits, pick the coin (e.g. USDT (TRC20)) and an amount ($12 and up); you are taken to the payment page. To save on network fees, pick a low-fee network such as BSC, Polygon or TON.
The page shows a deposit address (TRC20 addresses start with T), the exact amount and a QR code. Press the continue button if there is one. The address is valid for a limited time.
In your exchange's withdrawal screen or your wallet's Send, choose the same coin and network (TRC20), paste the address, enter the amount and send.
Once the blockchain confirms it, the payment page shows finished and your credits arrive automatically — usually 1–5 minutes on TRC20.
If you hold USDC on Base in a browser wallet such as MetaMask, Coinbase Wallet or Rabby, one signature tops you up, with no address to copy. Network fees (gas) are covered, so you do not need ETH.
On the Credits page, under Pay with wallet, enter an amount ($1–$500) and press Pay with wallet.
Approve the connection in your wallet. If you are not on Base, approve switching to it (or adding it the first time).
Your wallet asks you to sign a USDC transfer authorization. Check the recipient and amount, then sign. Signing alone moves nothing; exactly that amount moves when GateRouter settles the payment.
It usually confirms on-chain within 10 seconds and the credit appears. You get a BaseScan link, and the history keeps the on-chain proof.
x402 is an open standard for paying over HTTP 402 (Payment Required). An AI agent or server can top up its own API key's balance with USDC on Base, with no human in the loop. Top-ups are $1 to $500, and credit is added only after the payment is confirmed on-chain.
/v1/x402Returns the receiving wallet, network and amount range. No auth needed.
/v1/x402/topup?amount=5import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const wallet = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY);
const client = x402Client.fromConfig({
schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(wallet) }],
// The client caps each payment at $1 by default; raise it for larger top-ups.
spendControls: { maxAmountPerPayment: "$20" },
});
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://api.gaterouter.net/v1/x402/topup?amount=10", {
method: "POST",
headers: { Authorization: "Bearer " + process.env.GATEROUTER_API_KEY },
});
console.log(await res.json()); // { credited_usd, balance_usd, transaction, explorer_url }curl -i -X POST "https://api.gaterouter.net/v1/x402/topup?amount=5" \
-H "Authorization: Bearer $GATEROUTER_API_KEY"
# HTTP/2 402 + PAYMENT-REQUIRED: <base64 JSON>In the console, open AI Creative Tools → Crypto developer tools. Each run is charged at the chosen text model's price; failed requests cost nothing.
Errors use the same shape as OpenAI's.
{
"error": {
"message": "Insufficient credits. This request can cost up to $1.3623; your balance is $1.0000. Top up at https://gaterouter.net/credits",
"top_up_url": "https://gaterouter.net/credits",
"type": "insufficient_quota",
"code": "insufficient_credits",
"required_usd": 1.36227,
"balance_usd": 1
}
}| HTTP | code | Cause · fix |
|---|---|---|
| 400 | invalid_body | Malformed body — check required fields and types |
| 400 | wrong_endpoint | Media model sent to chat — use /v2/model-center/tasks |
| 401 | invalid_api_key | Missing, mistyped or revoked key — check the Authorization header |
| 402 | insufficient_credits | Out of credits — top up |
| 404 | model_not_found | Unknown model ID — get the exact ID from /v1/models |
| 429 | rate_limit_exceeded | Too many requests (300 per minute per key) — wait the Retry-After seconds, then retry |
| 4xx / 502 | upstream_error | Model provider error — read message, retry later |
| 503 | upstream_not_configured | Service maintenance — retry later |
Check that you replaced sk_YOUR_KEY with your real key, with no extra spaces, right after 'Bearer '. If you revoked the key, create a new one.
Your balance ran out. Top up under Credits. Trial credits arrive only after you verify your email.
Check the model value; case and hyphens must match. Copy the ID from Supported models below or from Models in the console.
Python isn't installed or isn't on your PATH. On Mac, try python3 and pip3. On Windows, reinstall Python with 'Add python.exe to PATH' checked.
Windows handles quotes differently. Use Option C (PowerShell) from Getting started.
Images, video and audio don't use the chat address. Submit a task to /v2/model-center/tasks, then check its result with the task ID. See Media tasks below.
No. Anyone can read a key shipped in a browser or app and spend your credits. Keep the key on your server and have the server call GateRouter.
Put the exact model ID below in the request's model field. Display names will not resolve.
| Model ID | Name | Family |
|---|---|---|
deepseek-v4.1-flash | DeepSeek V4.1 Flash | DeepSeek |
deepseek-v4.1-flash-1017 | DeepSeek V4.1 Flash (1017) | DeepSeek |
glm-5.3 | GLM 5.3 | GLM |
glm-5.3-flash | GLM 5.3 Flash | GLM |
glm-5.2 | GLM 5.2 | GLM |
kimi-k3.1-pro | Kimi K3.1 Pro | Kimi |
kimi-k3.1-pro-highspeed | Kimi K3.1 Pro Highspeed | Kimi |
kimi-k3.1-pro-TJ | Kimi K3.1 Pro TJ | Kimi |
kimi-k3 | Kimi K3 | Kimi |
kimi-k3-TJ | Kimi K3 TJ | Kimi |
qwen3.8-max | Qwen 3.8 Max | Qwen |
| Model ID | Name | Family |
|---|---|---|
seedream_5.0Pro | Seedream 5.0 Pro | Seedream |
seedream-5.0 | Seedream 5.0 | Seedream |
| Model ID | Name | Family |
|---|---|---|
sd_2.5_discount_v1 | Seedance 2.5 Discount | Seedance 2.5 |
sd_2.5_special_v1 | Seedance 2.5 Special | Seedance 2.5 |
sd_2.5_ORelay | Seedance 2.5 Official Relay | Seedance 2.5 |
sd_2.5_ORelay_special | Seedance 2.5 Official Relay Special | Seedance 2.5 |
sd_2.5_flash_special | Seedance 2.5 Flash Special | Seedance 2.5 |
sd_2.5_flash_discount | Seedance 2.5 Flash Discount | Seedance 2.5 |
sd_2.0_special | Seedance 2.0 Special | Seedance 2.0 |
sd_2.0_fast_special | Seedance 2.0 Fast Special | Seedance 2.0 |
sd_2.0_mini_special | Seedance 2.0 Mini Special | Seedance 2.0 |
sd_2.0_discount | Seedance 2.0 Discount | Seedance 2.0 |
sd_2.0_fast_discount | Seedance 2.0 Fast Discount | Seedance 2.0 |
sd_2.0_mini_discount | Seedance 2.0 Mini Discount | Seedance 2.0 |
videos_30_10_10_c3 | Videos 30/10/10 C3 | Videos |
videos_900_720p | Videos 900 720p | Videos |
MiniMax-H3-768p | MiniMax H3 768p | MiniMax |
MiniMax-H3-768p-c2 | MiniMax H3 768p C2 | MiniMax |
MiniMax-H3_933_1080p | MiniMax H3 1080p | MiniMax |
hh-1.1-t2v-o | HappyHorse 1.1 Text to Video | HappyHorse |
hh-1.1-i2v-o | HappyHorse 1.1 Image to Video | HappyHorse |
hh-1.1-r2v-o | HappyHorse 1.1 Reference to Video | HappyHorse |
wan3.0-prime-c2 | Wan 3.0 Prime C2 | Wan |
wan3.0-video-c2 | Wan 3.0 Video C2 | Wan |
wan3.0-video-c3 | Wan 3.0 Video C3 | Wan |
wan3.0-video-r2v-c4 | Wan 3.0 Reference to Video C4 | Wan |
KlingO3 | Kling O3 | Kling |
kling-v3-omni | Kling V3 Omni | Kling |
| Model ID | Name | Family |
|---|---|---|
minimax-tts | MiniMax TTS | MiniMax |
minimax_voice_clone | MiniMax Voice Clone | MiniMax |
| Model ID | Name | Family |
|---|---|---|
digital_human | Digital Human | Digital Human |