Setup
The gateway serves two API formats from the same host and the same key: the OpenAI Chat Completions format and the Anthropic Messages format. Most clients need only a base URL and a key.
The two values, for reference
https://clauderouter.my.id/v1https://clauderouter.my.idThe difference matters. Clients using the OpenAI SDK expect the base URL to include /v1. Clients using the Anthropic SDK or Claude Code expect the host without it, because those libraries append/v1/messages themselves.
Claude Code
Claude Code speaks the Anthropic Messages format, which this gateway serves directly. Set two environment variables and it runs unchanged, including streaming and tool use.
export ANTHROPIC_BASE_URL="https://clauderouter.my.id" export ANTHROPIC_AUTH_TOKEN="cr-your-key-here" # then run it as usual claude
To pin a specific model, pass it on the command line:
claude --model anthropic/claude-opus-4.8
On Windows, set the same two values with setx in a new terminal, or through the environment variables dialog.
Qoder
Qoder accepts a custom OpenAI-compatible provider. Add one and point it here.
- 1Open Qoder settings and go to the model or provider section.
- 2Add a new custom provider, choosing the OpenAI-compatible type.
- 3Set the base URL to https://clauderouter.my.id/v1
- 4Paste your key as the API key.
- 5Add the models you want by id, for example anthropic/claude-sonnet-4.6 and anthropic/claude-opus-5.
- 6Select the provider as active.
The model list endpoint is live, so a client that reads it will populate its picker with the catalog automatically:
curl https://clauderouter.my.id/v1/models \ -H "Authorization: Bearer cr-your-key-here"
VS Code extensions
Continue, Cline, Roo Code and similar extensions all take an OpenAI-compatible base URL. The field names differ slightly, the values do not.
// Continue, config.yaml
models:
- name: Claude Opus 4.8
provider: openai
model: anthropic/claude-opus-4.8
apiBase: https://clauderouter.my.id/v1
apiKey: cr-your-key-here// Cline / Roo Code, settings API Provider: OpenAI Compatible Base URL: https://clauderouter.my.id/v1 API Key: cr-your-key-here Model ID: anthropic/claude-sonnet-4.6
Extensions that ask for the model name rather than the model id should be given the id exactly as written, including the provider prefix.
Cursor
In Cursor, open Settings, then Models, and add an OpenAI-compatible entry with an overridden base URL.
Base URL: https://clauderouter.my.id/v1 API Key: cr-your-key-here Model: anthropic/claude-opus-4.8
Turn off any other providers for the model you add, since Cursor will otherwise keep routing that model to its own backend.
Terminal
A plain request. Both formats are shown so you can confirm the key works before configuring an editor.
# OpenAI-compatible
curl https://clauderouter.my.id/v1/chat/completions \
-H "Authorization: Bearer cr-your-key-here" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-opus-4.8",
"messages": [{"role": "user", "content": "Reply with the single word: ready"}]
}'# Anthropic Messages format, same key
curl https://clauderouter.my.id/v1/messages \
-H "x-api-key: cr-your-key-here" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-opus-4.8",
"max_tokens": 64,
"messages": [{"role": "user", "content": "Reply with the single word: ready"}]
}'OpenAI SDK
The official OpenAI SDK works by changing only the base URL. This is also the path for LangChain, LlamaIndex and anything else built on it.
from openai import OpenAI
client = OpenAI(
base_url="https://clauderouter.my.id/v1",
api_key="cr-your-key-here",
)
stream = client.chat.completions.create(
model="anthropic/claude-opus-4.8",
messages=[{"role": "user", "content": "Hello"}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://clauderouter.my.id/v1",
apiKey: "cr-your-key-here",
});
const res = await client.chat.completions.create({
model: "anthropic/claude-opus-4.8",
messages: [{ role: "user", content: "Hello" }],
});
console.log(res.choices[0].message.content);Anthropic SDK
The Anthropic SDKs work as well. Note that the base URL has no trailing/v1, because the SDK adds it.
from anthropic import Anthropic
client = Anthropic(
base_url="https://clauderouter.my.id",
api_key="cr-your-key-here",
)
message = client.messages.create(
model="anthropic/claude-opus-4.8",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}],
)
print(message.content[0].text)Other OpenAI-compatible apps
LibreChat, Open WebUI, SillyTavern, Jan, Chatbox and similar applications take a base URL and a key in their own settings screens. The values are always:
Base URL
https://clauderouter.my.id/v1Model
anthropic/claude-sonnet-4.6Model ids to copy
Send the id exactly as written. Each model also answers to a short alias without the provider prefix, which covers editors that rewrite model names.
Basic tier
anthropic/claude-sonnet-4.6Claude Sonnet 4.6anthropic/claude-opus-4.7Claude Opus 4.7anthropic/claude-opus-4.8Claude Opus 4.8anthropic/claude-opus-5Claude Opus 5openai/gpt-5.6-solGPT 5.6 Sol
Extension tier
anthropic/claude-fable-5Claude Fable 5anthropic/claude-fable-5.1Claude Fable 5.1openai/gpt-6-astraGPT 6 Astra
Extension models need an extension plan on the key you are using. Without it the request is refused with a message naming the missing plan, rather than failing silently.
Request options and limits
Streaming
Set "stream": true and the response arrives as server-sent events. Works in both formats.
Images
Every model accepts images. Send a base64 data URL or a hosted URL in the message content.
Context window
1,000,000 tokens per request on every model in the catalog, with up to 64,000 tokens of output.
Tool use
Function calling is passed through in both formats, so agentic clients work without changes.
Rate limit
A per-key request-rate limit exists to stop one key saturating the gateway. It is not a token quota; within it, requests are unlimited for the length of the plan.
Expiry
When the plan ends the key stops answering immediately. Requests return a 402 with a message telling the customer to renew.
If something fails
| Code | Meaning | What to do |
|---|---|---|
| invalid_api_key | The key is not recognised. | Check for a missing character. If it is gone, issue a new key. |
| api_key_expired | The plan ended. | Renew the key from the dashboard, or buy a new plan. |
| extension_required | The model needs an extension plan. | Add an extension to the key, or use a basic-tier model. |
| model_not_found | The id is not in the catalog. | Copy the id from the models page. GET /v1/models lists them all. |
| rate_limit_exceeded | Too many requests in a minute. | Wait for the retry window. This is not a plan limit. |
| upstream_error | The provider rejected the request. | Usually a malformed body. The message includes the provider text. |
| upstream_unreachable | The provider could not be reached. | Check the status page. This is a server-side problem. |
The gateway reports its own reachability and the status of every model on the status page.