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.

  1. Create an API key in the RelayRouter dashboard at https://relayrouter.io/dashboard.
  2. 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" }).
  3. Choose a model ID from the models page, for example gpt-6-astra or gpt-5.6-sol, and pass it in the model field.
  4. Send a test request to /v1/chat/completions and confirm the response. If your application streams output, set stream to 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".

ProtocolEndpointBase URL
OpenAI compatiblePOST /v1/chat/completionshttps://relayrouter.io/v1
Anthropic compatiblePOST /v1/messageshttps://relayrouter.io
Gemini compatiblePOST /v1beta/models/{model}:generateContentSee 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

ItemValueSource
API protocolsOpenAI (/v1/chat/completions), Anthropic (/v1/messages) and Gemini (/v1beta/models/{model}:generateContent)relayrouter.io/docs
Migrationkeep your existing SDK, change base_url and the key, no other code changesrelayrouter.io/docs
Model coverageClaude 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, Moonshotrelayrouter.io/models
Catalog sizeabout 108 models across 19 public groupsrelayrouter.io/models
Settlement ratesGPT group CNY 0.6 per $1 of standard usage, Claude group CNY 2.0, against a CNY 6.8 per $1 market referencerelayrouter.io/models
Direct pricingdeepseek-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 timerelayrouter.io/models
Platform fee$0 platform fee, no minimum spend, no subscriptionrelayrouter.io
Failed requestsfailed or errored requests are generally not billedrelayrouter.io

Data verified 2026-10-08; live prices are on the official /models page.


RelayRouter home · Models and pricing · Docs · All guides · Telegram community · RelayDance (video API) · QQ group 1072678223