RelayRouterRelayRouter
HomeModelsPricingDocsGuides
Get API Key →

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.

MethodPathNotes
POST/v1/chat/completionsChat completions, streaming with stream: true, tool calls and JSON mode passed through to the model
POST/v1/responsesResponses API, the shape used by Codex-style clients
POST/v1/images/generationsImage generation, for example gpt-image-2
GET/v1/modelsThe 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

main.pypython
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

index.tstypescript
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

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

GroupRateModels (examples)
GPT¥0.6 per $1 of standard usage, about 91% below the ¥6.8/$ referencecodex-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/$ referencecodex-auto-review, gpt-4o, gpt-4o-mini, gpt-5.2, gpt-5.2-2025-12-11 and 24 more
MiniMaxdirect per-token pricingMiniMax-M2.7
Z.aidirect per-token pricingglm-5.1, glm-5.2
GPT Image¥1.25 per $1 of standard usage, about 82% below the ¥6.8/$ referencegpt-image-2
Kimidirect per-token pricingkimi-k2.6
GPT Azure¥2.38 per $1 of standard usage, about 65% below the ¥6.8/$ referencecodex-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/$ referencegpt-4.1, gpt-4.1-mini, gpt-4.1-nano, gpt-4o, gpt-4o-mini and 24 more

Tools that work as-is

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.