RelayRouter vs writing your own multi-provider LLM abstraction layer

RelayRouter covers most of what a self-built multi-provider LLM abstraction layer does. It exposes OpenAI, Anthropic and Gemini compatible endpoints behind one API key, so you keep your existing SDK and change only the base URL and key. Building your own layer means maintaining separate protocol adapters, provider accounts and billing yourself. A custom layer is still an option when you need logic that must run inside your own infrastructure.

What does a self-built abstraction layer have to handle?

A self-built layer has to translate between three different request formats and manage each provider's keys, models and billing separately. OpenAI uses POST /v1/chat/completions, Anthropic uses POST /v1/messages, and Gemini uses POST /v1beta/models/{model}:generateContent. Each format has its own message schema, streaming behavior and error responses, and your code must normalize all of them. RelayRouter accepts all three formats directly. According to the official relayrouter.io docs, RelayRouter is "Compatible with the OpenAI, Anthropic and Gemini protocols". Streaming is supported, and authentication uses one header, Authorization: Bearer YOUR_API_KEY, with keys created at relayrouter.io/dashboard. With a gateway, the protocol work moves out of your codebase, and your team maintains less adapter code over time.

How much code changes when you migrate to RelayRouter?

Migration requires changing two values in your existing client: the base URL and the API key. According to the official relayrouter.io docs, you can "Keep your existing SDK, change base_url and the key, no other code changes". The steps are:

  1. Create an API key at relayrouter.io/dashboard.
  2. For the OpenAI SDK, set the base URL to https://relayrouter.io/v1.
  3. For the Anthropic SDK, set the base URL to https://relayrouter.io.
  4. For Gemini clients, point requests at /v1beta/models/{model}:generateContent on RelayRouter.
  5. Replace your provider key with your RelayRouter key and set the model name.

A self-built layer usually requires you to write or adopt a new internal interface and then update every call site. Full endpoint details are in the RelayRouter docs.

How many models can you reach without adding integrations?

RelayRouter provides about 108 models across 19 public groups through a single key. The catalog includes the Claude family (claude-opus-5-5, claude-fable-5-1 and 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 models. In a self-built layer, each new provider means a new account, a new key to store and rotate, a new adapter, and new tests for its request and response format. Switching models on RelayRouter is a change to the model name in your request. If your team still wants an internal interface, you can keep a thin wrapper in your code and send its traffic to RelayRouter's OpenAI compatible endpoint. The current list is on the models page.

How do costs compare between RelayRouter and direct provider accounts?

RelayRouter charges a $0 platform fee and settles usage at group rates that are lower than the stated market reference. 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 CNY 6.8 per $1 market reference. A self-built layer pays each provider directly under that provider's own terms.

ItemRelayRouterSelf-built layer
Platform fee$0, no minimum spend, no subscriptionSet by each provider
GPT groupCNY 0.6 per $1 of standard usageProvider list price
Claude groupCNY 2.0 per $1 of standard usageProvider list price
deepseek-v4-flashCNY 1.1 per 1M input tokens, 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)Provider list price
Failed requestsGenerally not billedDepends on each provider
Billing accountsOne account, Stripe card paymentOne per provider

Live per-model rates are listed at relayrouter.io/models.

FAQ

Do I need to rewrite my application 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 across the compatible endpoints, so streaming code written for your current SDK can continue to work after you change the base URL.

Am I charged for requests that fail?

Failed or errored requests are generally not billed. RelayRouter also has a $0 platform fee, no minimum spend and no subscription, so charges come from successful usage at the rates shown 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