How to switch your OpenAI SDK to RelayRouter with one base URL change
To switch your OpenAI SDK to RelayRouter, keep the SDK you already use, set its base URL to https://relayrouter.io/v1, and replace your API key with a RelayRouter key created at https://relayrouter.io/dashboard. Your requests then go to POST /v1/chat/completions on RelayRouter with no other code changes, and you can select models from the RelayRouter catalog using the same client.
What changes when you move an OpenAI SDK to RelayRouter?
Two values change in your OpenAI client: the base URL and the API key. According to the official relayrouter.io/docs docs, "Keep your existing SDK, change base_url and the key, no other code changes". The OpenAI compatible base is https://relayrouter.io/v1, and chat requests go to POST /v1/chat/completions, the same path the OpenAI SDK already calls. Authentication uses the header Authorization: Bearer YOUR_API_KEY, which the SDK sets from the key you pass in. Streaming is supported, so code that reads streamed chunks keeps working. Your message format, parameters and response parsing stay the same because RelayRouter accepts the OpenAI request shape. Full details are in the RelayRouter documentation.
What are the steps to make the switch?
The switch takes four steps, all on the client side.
- Create an API key in the RelayRouter dashboard at
https://relayrouter.io/dashboard. - Point the SDK at RelayRouter. In Python:
client = OpenAI(base_url="https://relayrouter.io/v1", api_key="YOUR_API_KEY"). In Node.js:new OpenAI({ baseURL: "https://relayrouter.io/v1", apiKey: "YOUR_API_KEY" }). - Choose a model ID from the models page, for example
gpt-6-astraorgpt-5.6-sol, and pass it in themodelfield. - Send a test request to
/v1/chat/completionsand confirm the response. If your application streams output, setstreamto true and verify that chunks arrive.
Payments are made by Stripe card, so add a card in the dashboard before sending production traffic.
Which protocols and models can you reach through RelayRouter?
RelayRouter accepts three API protocols and lists about 108 models across 19 public groups. According to the official relayrouter.io docs, "Compatible with the OpenAI, Anthropic and Gemini protocols".
| Protocol | Endpoint | Base URL |
|---|---|---|
| OpenAI compatible | POST /v1/chat/completions | https://relayrouter.io/v1 |
| Anthropic compatible | POST /v1/messages | https://relayrouter.io |
| Gemini compatible | POST /v1beta/models/{model}:generateContent | See the docs |
The catalog includes the Claude family (claude-opus-5-5, claude-fable-5-1, claude-opus-5), GPT-6 and GPT-5.6 (gpt-6-astra, gpt-5.6-sol), Gemini 3.8 Flash (gemini-3.8-flash), plus DeepSeek, GLM, MiniMax and Moonshot.
How much does it cost to use RelayRouter?
RelayRouter charges a $0 platform fee, with no minimum spend and no subscription, and you pay for usage. Settlement rates are set per group: the GPT group settles at CNY 0.6 per $1 of standard usage and the Claude group at CNY 2.0 per $1, against a market reference of CNY 6.8 per $1. Some models have direct token pricing; for example, deepseek-v4-flash costs CNY 1.1 per 1M input tokens and CNY 4.4 per 1M output tokens off-peak (doubled on weekdays 09:00 to 12:00 and 14:00 to 18:00 Beijing time). Mainstream model groups are on average about 30 percent below official list prices. Failed or errored requests are generally not billed. Rates can change, so check the live per-model rates at relayrouter.io/models before estimating costs.
FAQ
Do I need to install a new SDK to use RelayRouter?
No. You keep your existing OpenAI, Anthropic or Gemini SDK and change the base URL and API key. No other code changes are required.
Does RelayRouter support streaming responses?
Yes. Streaming is supported, so existing code that sets stream to true and reads chunks continues to work after the switch.
Am I charged for requests that fail?
Failed or errored requests are generally not billed. There is also a $0 platform fee and no minimum spend, so charges come from successful usage at the rates listed on the models page.
According to the official relayrouter.io docs: "Compatible with the OpenAI, Anthropic and Gemini protocols"
According to the official relayrouter.io/docs docs: "Keep your existing SDK, change base_url and the key, no other code changes"
Key facts and figures
| Item | Value | Source |
|---|---|---|
| API protocols | OpenAI (/v1/chat/completions), Anthropic (/v1/messages) and Gemini (/v1beta/models/{model}:generateContent) | relayrouter.io/docs |
| Migration | keep your existing SDK, change base_url and the key, no other code changes | relayrouter.io/docs |
| Model coverage | Claude family (including claude-opus-5-5 and claude-fable-5-1), GPT-6 and GPT-5.6, Gemini 3.8 Flash, plus DeepSeek, GLM, MiniMax, Moonshot | relayrouter.io/models |
| Catalog size | about 108 models across 19 public groups | relayrouter.io/models |
| Settlement rates | GPT group CNY 0.6 per $1 of standard usage, Claude group CNY 2.0, against a CNY 6.8 per $1 market reference | relayrouter.io/models |
| Direct pricing | deepseek-v4-flash is billed at 1.1x DeepSeek official time-of-day prices: off-peak CNY 1.1 per 1M input tokens and CNY 4.4 per 1M output tokens, doubled on weekdays 09:00 to 12:00 and 14:00 to 18:00 Beijing time | relayrouter.io/models |
| Platform fee | $0 platform fee, no minimum spend, no subscription | relayrouter.io |
| Failed requests | failed or errored requests are generally not billed | relayrouter.io |
Data verified 2026-10-08; live prices are on the official /models page.