Skip to content

Gateway is healthy. Every model is responding.

xrouters
documentation

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 host
documentation

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

0 of 0 · $1.50 base / 1M
model idbrandcontextper 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
  1. 1Cline → Settings → API Provider: OpenAI Compatible
  2. 2Base URL: https://ai.xrouters.xyz/v1
  3. 3API Key: paste the key from your dashboard
  4. 4Model ID: type it by hand, e.g. deepseek/deepseek-v4.1-flash
https://ai.xrouters.xyz/v1

Turn off “Use different model for plan/act” unless you want two ids.

Kilo Code / Roo Code

VS Code / JetBrains
  1. 1Settings → Provider: OpenAI Compatible
  2. 2Base URL: https://ai.xrouters.xyz/v1
  3. 3API Key: your key
  4. 4Model: any id from the catalog page
https://ai.xrouters.xyz/v1

Same form as Cline - both are Roo forks, so one setup covers the family.

Cursor

IDE
  1. 1Settings → Models → OpenAI API Key: paste key
  2. 2Expand OpenAI, enable “Override OpenAI Base URL”
  3. 3Fill https://ai.xrouters.xyz/v1 and press Verify
  4. 4Add the model id under “Add model”
https://ai.xrouters.xyz/v1

Open WebUI

Self-hosted chat
  1. 1Admin → Settings → Connections → OpenAI
  2. 2Base URL: https://ai.xrouters.xyz/v1
  3. 3Key: your key, then Save
  4. 4Models appear automatically - refresh the chat list
https://ai.xrouters.xyz/v1

LiteLLM

Python SDK / proxy
  1. 1pip install litellm
  2. 2completion(model="openai/<model-id>", api_base="https://ai.xrouters.xyz/v1", api_key=KEY)
  3. 3For the proxy, drop the same block into config.yaml under model_list
https://ai.xrouters.xyz/v1

Cost tracking stays on our side; LiteLLM only sees the OpenAI shape.

LangChain

Python / JS
  1. 1ChatOpenAI(model="<model-id>", base_url="https://ai.xrouters.xyz/v1", api_key=KEY)
  2. 2JS: new ChatOpenAI({ configuration: { baseURL: "https://ai.xrouters.xyz/v1" } })
https://ai.xrouters.xyz/v1

n8n

Automation
  1. 1Credentials → OpenAI → Base URL: https://ai.xrouters.xyz/v1
  2. 2API Key: your key
  3. 3AI Agent / OpenAI node: pick the model id manually
https://ai.xrouters.xyz/v1

SillyTavern

Roleplay front-end
  1. 1Connection tab → Chat Completion source: Custom (OpenAI-compatible)
  2. 2Custom Endpoint: https://ai.xrouters.xyz/v1
  3. 3Custom API key: your key, then “Connect”
  4. 4Type the model id in the Model box and press Enter
https://ai.xrouters.xyz/v1

Streaming works; no extra proxy needed.

Continue.dev

VS Code / JetBrains
  1. 1config.json → models[] entry
  2. 2provider: "openai", apiBase: "https://ai.xrouters.xyz/v1", apiKey: KEY
  3. 3model: any id from the catalog
https://ai.xrouters.xyz/v1

Anthropic-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

statusmeaningwhat to do
401missing or revoked keycreate a new key in the dashboard
402quota exhaustedtop up - the pool is shared per account
404unknown model idcheck the catalog for the exact id
429rate limit for your packageback off and retry, or upgrade the package
502upstream provider errorretry; nothing was debited
503maintenance modewait 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.

starter
60rpm
pro
100rpm
ultimate
200rpm
enterprise
customrpm

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.

sub-keys

Create one key per customer under Reseller. Budget and rpm are per key; quota stays shared.

statements

Per key and per model: retail, your cost, your margin - downloadable as CSV for invoicing.

vouchers

Token credit or a percentage off the next top-up. One redemption per account, optional expiry.

redeeming

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.