How to stream chat completions through RelayRouter

To stream chat completions through RelayRouter, keep your existing OpenAI, Anthropic or Gemini SDK. Point its base URL at RelayRouter (https://relayrouter.io/v1 for OpenAI compatible calls), swap in a RelayRouter API key sent as Authorization: Bearer YOUR_API_KEY, and enable streaming the way your SDK normally does. RelayRouter supports streaming, and OpenAI style requests go to POST /v1/chat/completions with no other code changes.

Which endpoint and protocol should I use for streaming?

Use the endpoint that matches the SDK your code already uses, because RelayRouter accepts three protocols. According to the official relayrouter.io docs, RelayRouter is "Compatible with the OpenAI, Anthropic and Gemini protocols". The three entry points are:

For chat completions specifically, the OpenAI compatible endpoint is the direct match. All three protocols authenticate with the same header format: Authorization: Bearer YOUR_API_KEY. Full protocol details are in the RelayRouter docs.

How do I set up a streaming request step by step?

You can set up streaming in four steps without rewriting your application. According to the official relayrouter.io/docs, you should "Keep your existing SDK, change base_url and the key, no other code changes".

  1. Create an API key at https://relayrouter.io/dashboard.
  2. Set your SDK's base URL to https://relayrouter.io/v1 (OpenAI SDK) or https://relayrouter.io (Anthropic SDK).
  3. Replace your existing API key with the RelayRouter key, which is sent as Authorization: Bearer YOUR_API_KEY.
  4. Choose a model ID such as gpt-5.6-sol or claude-opus-5-5, enable the streaming option your SDK already provides, and read the response as it arrives.

Your existing streaming loop, message format and error handling stay the same.

Which models can I stream through RelayRouter?

You can stream across a catalog of about 108 models in 19 public groups. Coverage includes the following:

Because one key covers every group, you can switch models in a streaming call by changing the model ID string. You do not need a separate account per provider. The current list of model IDs and groups is published at relayrouter.io/models, which is the reference to check before hardcoding a model name.

How much does streaming through RelayRouter cost?

You pay per model at the published group rates, with a $0 platform fee, no minimum spend and no subscription. On relayrouter.io/models, settlement rates are CNY 0.6 per $1 of standard usage for the GPT group and CNY 2.0 per $1 for the Claude group, against a market reference of CNY 6.8 per $1. Some models have direct 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 average about 30 percent below official list prices. Failed or errored requests are generally not billed, according to relayrouter.io. Payment is by Stripe card.

FAQ

Do I need a new SDK to stream through RelayRouter?
No. You keep your existing OpenAI, Anthropic or Gemini SDK and change the base URL and API key.

What base URL do I use for OpenAI style streaming?
Use https://relayrouter.io/v1, which serves POST /v1/chat/completions.

Am I charged if a streaming request fails?
Failed or errored requests are generally not billed. Live per-model rates are listed at relayrouter.io/models.

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