Protocols
OpenAI-compatible API
If your code already talks to the OpenAI API, it already talks to RelayRouter. Point the client at https://relayrouter.io/v1, use a RelayRouter key as the API key, and send the same request bodies you send today. The gateway accepts the OpenAI request shape, routes it to the group your key belongs to and returns the OpenAI response shape, including server-sent events for streaming.
Base URL and endpoints
https://relayrouter.io/v1 Set this as the base URL of any OpenAI client; the SDK appends the endpoint paths itself.
| Method | Path | Notes |
|---|---|---|
| POST | /v1/chat/completions | Chat completions, streaming with stream: true, tool calls and JSON mode passed through to the model |
| POST | /v1/responses | Responses API, the shape used by Codex-style clients |
| POST | /v1/images/generations | Image generation, for example gpt-image-2 |
| GET | /v1/models | The models your key can call |
Authentication: Authorization: Bearer <your RelayRouter key>. The key decides the group, and the group decides which models and which rate apply.
Code
Python
from openai import OpenAI
client = OpenAI(
api_key="your-relayrouter-key",
base_url="https://relayrouter.io/v1", # the only change
)
res = client.chat.completions.create(
model="gpt-6-astra",
messages=[{"role": "user", "content": "Hello!"}],
stream=False,
)
print(res.choices[0].message.content)TypeScript
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.RELAYROUTER_API_KEY,
baseURL: "https://relayrouter.io/v1",
});
const stream = await client.chat.completions.create({
model: "gpt-6-astra",
messages: [{ role: "user", content: "Hello!" }],
stream: true,
});
for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content ?? "");cURL
curl https://relayrouter.io/v1/chat/completions \
-H "Authorization: Bearer $RELAYROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-6-astra", "messages": [{"role": "user", "content": "Hello!"}]}'Groups that speak this protocol
A key belongs to one group. Create it in the console for one of the groups below; the models page has every group and model with live rates.
| Group | Rate | Models (examples) |
|---|---|---|
| GPT | ¥0.6 per $1 of standard usage, about 91% below the ¥6.8/$ reference | codex-auto-review, gpt-5.2, gpt-5.2-2025-12-11, gpt-5.2-chat-latest, gpt-5.2-pro and 21 more |
| Codex Fast | ¥0.75 per $1 of standard usage, about 89% below the ¥6.8/$ reference | codex-auto-review, gpt-4o, gpt-4o-mini, gpt-5.2, gpt-5.2-2025-12-11 and 24 more |
| MiniMax | direct per-token pricing | MiniMax-M2.7 |
| Z.ai | direct per-token pricing | glm-5.1, glm-5.2 |
| GPT Image | ¥1.25 per $1 of standard usage, about 82% below the ¥6.8/$ reference | gpt-image-2 |
| Kimi | direct per-token pricing | kimi-k2.6 |
| GPT Azure | ¥2.38 per $1 of standard usage, about 65% below the ¥6.8/$ reference | codex-auto-review, gpt-5.2, gpt-5.2-2025-12-11, gpt-5.2-chat-latest, gpt-5.2-pro and 13 more |
| OpenAI Stable | ¥2.8 per $1 of standard usage, about 59% below the ¥6.8/$ reference | gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, gpt-4o, gpt-4o-mini and 24 more |
Tools that work as-is
- OpenAI SDK (Python, TypeScript, .NET, Java, Go): set base_url and api_key
- LangChain ChatOpenAI: openai_api_base=https://relayrouter.io/v1 (guide)
- LiteLLM: model=openai/<id>, api_base=https://relayrouter.io/v1
- Cursor: Override OpenAI Base URL (guide)
- Cline / Roo Code: OpenAI Compatible provider (guide)
- Dify: OpenAI-API-compatible model provider (guide)
Questions
Do I need to change anything besides the base URL and the key?
No. Request and response bodies are the OpenAI format; streaming, tool calls, JSON mode and the usage field work as they do against OpenAI. Only the model name changes if you switch to a non-OpenAI model.
Which models can I call through the OpenAI-compatible endpoint?
Every model in a group whose protocol is OpenAI: the GPT line (gpt-6-astra, gpt-5.6-sol, gpt-6.1-sol and more), Kimi, GLM, MiniMax and gpt-image-2. The models page marks each group's protocol and lists its models.
How is it billed?
Per token, deducted from a prepaid balance at the rate of the group your key belongs to. There is no platform fee, no subscription and no minimum spend, and failed requests are not billed.
Is there a rate limit?
Each account has a concurrency limit shown in the console; upstream providers apply their own per-model limits. If you need higher concurrency, write to support.