One endpoint. Both protocols.
Point any OpenAI or Anthropic client at the gateway and keep your model ids. Streaming, tool calls and vision pass through untouched - billing is metered from the provider's own usage block.
https://www.xrouters.xyz/v1https://www.xrouters.xyzanthropic uses the hostWire it up in one line.
The gateway speaks both OpenAI and Anthropic wire formats. Change the base URL, keep your SDK, keep your types. Everything below assumes a key from the dashboard.
Quickstart
Create a key under API keys, then pick whichever client you already use.
curl /v1/chat/completions \
-H "Authorization: Bearer $XROUTERS_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "your-model-id",
"messages": [{"role": "user", "content": "hello"}],
"stream": true
}'Models & pricing
Every id below answers right now - the list is read from the gateway, not typed into this page. Price is per 1M tokens at a 1× multiplier; a higher multiplier costs proportionally more quota.
| model id | brand | context | per 1M | |
|---|---|---|---|---|
| no model matches “”. | ||||
Integrations
Every entry below is the same two values: base URL https://www.xrouters.xyz/v1 and a key from the dashboard. Model ids come from the catalog, not from memory - some upstream ids carry a provider prefix.
Cline
VS Code extension- 1Cline → Settings → API Provider: OpenAI Compatible
- 2Base URL: https://ai.xrouters.xyz/v1
- 3API Key: paste the key from your dashboard
- 4Model ID: type it by hand, e.g. deepseek/deepseek-v4.1-flash
https://ai.xrouters.xyz/v1Turn off “Use different model for plan/act” unless you want two ids.
Kilo Code / Roo Code
VS Code / JetBrains- 1Settings → Provider: OpenAI Compatible
- 2Base URL: https://ai.xrouters.xyz/v1
- 3API Key: your key
- 4Model: any id from the catalog page
https://ai.xrouters.xyz/v1Same form as Cline - both are Roo forks, so one setup covers the family.
Cursor
IDE- 1Settings → Models → OpenAI API Key: paste key
- 2Expand OpenAI, enable “Override OpenAI Base URL”
- 3Fill https://ai.xrouters.xyz/v1 and press Verify
- 4Add the model id under “Add model”
https://ai.xrouters.xyz/v1Open WebUI
Self-hosted chat- 1Admin → Settings → Connections → OpenAI
- 2Base URL: https://ai.xrouters.xyz/v1
- 3Key: your key, then Save
- 4Models appear automatically - refresh the chat list
https://ai.xrouters.xyz/v1LiteLLM
Python SDK / proxy- 1pip install litellm
- 2completion(model="openai/<model-id>", api_base="https://ai.xrouters.xyz/v1", api_key=KEY)
- 3For the proxy, drop the same block into config.yaml under model_list
https://ai.xrouters.xyz/v1Cost tracking stays on our side; LiteLLM only sees the OpenAI shape.
LangChain
Python / JS- 1ChatOpenAI(model="<model-id>", base_url="https://ai.xrouters.xyz/v1", api_key=KEY)
- 2JS: new ChatOpenAI({ configuration: { baseURL: "https://ai.xrouters.xyz/v1" } })
https://ai.xrouters.xyz/v1n8n
Automation- 1Credentials → OpenAI → Base URL: https://ai.xrouters.xyz/v1
- 2API Key: your key
- 3AI Agent / OpenAI node: pick the model id manually
https://ai.xrouters.xyz/v1SillyTavern
Roleplay front-end- 1Connection tab → Chat Completion source: Custom (OpenAI-compatible)
- 2Custom Endpoint: https://ai.xrouters.xyz/v1
- 3Custom API key: your key, then “Connect”
- 4Type the model id in the Model box and press Enter
https://ai.xrouters.xyz/v1Streaming works; no extra proxy needed.
Continue.dev
VS Code / JetBrains- 1config.json → models[] entry
- 2provider: "openai", apiBase: "https://ai.xrouters.xyz/v1", apiKey: KEY
- 3model: any id from the catalog
https://ai.xrouters.xyz/v1Anthropic-native clients (Claude Code, Anthropic SDK, some agent runtimes) want the host without /v1 - set ANTHROPIC_BASE_URL=https://www.xrouters.xyz and they will append /v1/messages themselves.
Authentication
A single bearer token authenticates every endpoint. There is no project id, no organisation header, no second signature.
Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxx
Keys are hashed at rest. If you lose one, revoke it and create another - the original cannot be recovered, only replaced.
OpenAI protocol
Fully compatible with the Chat Completions shape, including stream, tools, temperature and max_tokens.
POST https://www.xrouters.xyz/v1/chat/completions
Content-Type: application/json
{
"model": "claude-sonnet-4.5",
"messages": [{ "role": "user", "content": "hi" }],
"max_tokens": 512
}Python SDK: base_url="https://www.xrouters.xyz/v1". Node SDK: baseURL: "https://www.xrouters.xyz/v1".
Anthropic protocol
The Messages API is served at the root path. Send x-api-key and an anthropic-version header, or reuse your bearer token.
POST https://www.xrouters.xyz/v1/messages
x-api-key: sk_live_xxxxxxxxxxxx
anthropic-version: 2023-06-01
{
"model": "claude-opus-4.1",
"max_tokens": 1024,
"messages": [{ "role": "user", "content": "hi" }]
}Streaming
Add "stream": true and read server-sent events as they arrive. The proxy forwards chunks unbuffered in both protocols, so first-token latency is the provider's own.
for await (const part of stream) {
process.stdout.write(part.choices[0]?.delta?.content ?? "");
}Usage & billing
Each response carries the provider's own usage block. Quota is debited from that block multiplied by the model's multiplier, and the request is written to your log with tokens, latency and status.
- 1× models debit one quota token per token used.
- 2× models debit two - the multiplier is printed in the catalog.
- Upstream failures are refunded: nothing is debited when no usage block is returned.
- Quota never expires and is shared across every key on the account.
Errors
| status | meaning | what to do |
|---|---|---|
| 401 | missing or revoked key | create a new key in the dashboard |
| 402 | quota exhausted | top up - the pool is shared per account |
| 404 | unknown model id | check the catalog for the exact id |
| 429 | rate limit for your package | back off and retry, or upgrade the package |
| 502 | upstream provider error | retry; nothing was debited |
| 503 | maintenance mode | wait for the switch to clear |
reading the last 30 days of traffic…
Rate limits
Limits are per account, counted in requests per minute, and scale with the package you bought. They apply to both protocols together - there is no separate budget per endpoint.
Reseller & vouchers
A reseller account issues customer keys that draw from one wallet. You are billed at the shelf price minus your rate, and every key carries its own budget, rpm ceiling and model allow-list.
Create one key per customer under Reseller. Budget and rpm are per key; quota stays shared.
Per key and per model: retail, your cost, your margin - downloadable as CSV for invoicing.
Token credit or a percentage off the next top-up. One redemption per account, optional expiry.
Customers paste the code under Billing → redeem. Credits land instantly, discounts apply at checkout.
API reference
The spec below is the machine-readable contract for both wire formats. Import it into Postman, Insomnia or any OpenAPI tooling - the server entry is relative, so it points at whatever host you load it from.
# postman: import → link → paste https://www.xrouters.xyz/openapi.json
Covered: /v1/chat/completions, /v1/messages, /v1/models and the three public docs endpoints, with the error shapes listed above.
Changelog
Everything a customer can notice, newest first. Written in the same commit as the change.
Need a key first?
Registration includes starter quota - no card needed to test.