Docs

Quickstart

One OpenAI-compatible endpoint. Set the base URL, send your key, pick a model id. That is the whole integration.

Base URLhttps://api.relayswitch.io/v1
Auth headerAuthorization: Bearer <key>
Model id"model": "claude-opus-5-5"
01

Make a request

Any OpenAI SDK works unchanged. Three ways to say hello.

bash
1curl 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
1from openai import OpenAI
2
3client = OpenAI(
4 base_url="https://api.relayswitch.io/v1",
5 api_key="YOUR_RELAYSWITCH_KEY",
6)
7reply = client.chat.completions.create(
8 model="claude-opus-5-5",
9 messages=[{"role": "user", "content": "Hello"}],
10)
11print(reply.choices[0].message.content)
node
1import OpenAI from "openai";
2
3const client = new OpenAI({
4 baseURL: "https://api.relayswitch.io/v1",
5 apiKey: process.env.RELAYSWITCH_KEY,
6});
7const reply = await client.chat.completions.create({
8 model: "claude-opus-5-5",
9 messages: [{ role: "user", content: "Hello" }],
10});
11console.log(reply.choices[0].message.content);

Streaming works the same way: set stream: true and read server-sent events.

node
1const stream = await client.chat.completions.create({
2 model: "claude-opus-5-5",
3 messages: [{ role: "user", content: "Write a haiku" }],
4 stream: true,
5});
6for 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

StatusNameMeaning
401UnauthorizedThe key is missing, malformed or revoked. Check the Authorization header.
402Payment requiredThe balance is empty. Top up in the console; the key works again at once.
404Not foundThe model id is not in the catalog. Copy it from the Models page.
429Too many requestsThe key is over its rate limit. Back off and retry; raise the limit in the console.
503Service unavailableThe model is temporarily unavailable upstream. Retry with backoff or switch model.

Get a key and send the first request

An email, a top-up, a key. Under a minute.