Docs
Quickstart
One OpenAI-compatible endpoint. Set the base URL, send your key, pick a model id. That is the whole integration.
Base URL
https://api.relayswitch.io/v1Auth header
Authorization: Bearer <key>Model id
"model": "claude-opus-5-5"01
Make a request
Any OpenAI SDK works unchanged. Three ways to say hello.
bash
1
curl https://api.relayswitch.io/v1/chat/completions \2
-H "Authorization: Bearer $RELAYSWITCH_KEY" \3
-H "Content-Type: application/json" \4
-d '{5
"model": "claude-opus-5-5",6
"messages": [{"role": "user", "content": "Hello"}]7
}'python
1
from openai import OpenAI2
3
client = OpenAI(4
base_url="https://api.relayswitch.io/v1",5
api_key="YOUR_RELAYSWITCH_KEY",6
)7
reply = client.chat.completions.create(8
model="claude-opus-5-5",9
messages=[{"role": "user", "content": "Hello"}],10
)11
print(reply.choices[0].message.content)node
1
import OpenAI from "openai";2
3
const client = new OpenAI({4
baseURL: "https://api.relayswitch.io/v1",5
apiKey: process.env.RELAYSWITCH_KEY,6
});7
const reply = await client.chat.completions.create({8
model: "claude-opus-5-5",9
messages: [{ role: "user", content: "Hello" }],10
});11
console.log(reply.choices[0].message.content);Streaming works the same way: set stream: true and read server-sent events.
node
1
const stream = await client.chat.completions.create({2
model: "claude-opus-5-5",3
messages: [{ role: "user", content: "Write a haiku" }],4
stream: true,5
});6
for await (const chunk of stream) {7
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");8
}02
Model ids
469 models. Send the id exactly as the Models page prints it.
Where to find them
The Models page lists every id with its live price. The same rows are at /pricing-index.json and /ai-catalog.json, and the API itself answers GET https://api.relayswitch.io/v1/models.
Rate limits
Limits are per key and set in the console when you create or edit the key. A key over its limit answers 429; back off and retry.
03
Errors
| Status | Name | Meaning |
|---|---|---|
| 401 | Unauthorized | The key is missing, malformed or revoked. Check the Authorization header. |
| 402 | Payment required | The balance is empty. Top up in the console; the key works again at once. |
| 404 | Not found | The model id is not in the catalog. Copy it from the Models page. |
| 429 | Too many requests | The key is over its rate limit. Back off and retry; raise the limit in the console. |
| 503 | Service unavailable | The model is temporarily unavailable upstream. Retry with backoff or switch model. |