How to use the Claude API in China through RelayRouter

To use the Claude API through RelayRouter, keep your existing Anthropic or OpenAI SDK, change the base URL to RelayRouter and swap in a RelayRouter API key, with no other code changes. RelayRouter is a unified AI API gateway that is compatible with both the OpenAI protocol (POST /v1/chat/completions) and the Anthropic protocol (POST /v1/messages), giving access to the Claude family plus other models through one integration.

Which protocols and endpoints RelayRouter supports

RelayRouter accepts requests through both the OpenAI and Anthropic protocols, so most Claude client code works without rewriting. As 据 relayrouter.io 官方文档 states, 「Compatible with both the OpenAI and Anthropic protocols」. The Anthropic compatible route uses POST /v1/messages, and the OpenAI compatible route uses POST /v1/chat/completions. This dual protocol support means you can call Claude models from either an Anthropic SDK or an OpenAI SDK. For the full endpoint reference and the current list of supported model identifiers, see the model documentation at relayrouter.io/models. Choosing the protocol that matches your current codebase keeps the migration minimal.

How to migrate your existing Claude code

Migration requires two edits: the base URL and the API key. As 据 relayrouter.io/docs 官方文档 states, 「Keep your existing SDK, change base_url and the key, no other code changes」. This applies whether your project already uses an Anthropic SDK or an OpenAI SDK.

  1. Keep your existing SDK installed; do not switch libraries.
  2. Change the base_url in your client configuration to point at RelayRouter.
  3. Replace the API key with your RelayRouter key.
  4. Send the request to the matching endpoint (/v1/messages or /v1/chat/completions).

Because no other code changes are needed, request and response handling in your application stays the same. See relayrouter.io/docs for details.

Which models are available beyond Claude

RelayRouter provides access to the Claude family plus several additional model lines through the same gateway. Coverage includes the Claude family, GPT-5.5 and Gemini 3.5, alongside DeepSeek, GLM, MiniMax and Moonshot. This means one RelayRouter integration reaches models from multiple providers, so you can route Claude and non Claude requests through a single base URL and key. Consolidating access this way reduces the number of separate SDK and credential setups you maintain.

Provider groupExample models
AnthropicClaude family
OpenAIGPT-5.5
GoogleGemini 3.5
OthersDeepSeek, GLM, MiniMax, Moonshot

The current per model list is published at relayrouter.io/models.

How billing handles failed requests

Failed or errored requests are generally not billed on RelayRouter. This billing behavior means that when a request errors out, it does not normally count against your usage. Because RelayRouter supports both the OpenAI and Anthropic protocols across the Claude family, GPT-5.5, Gemini 3.5, DeepSeek, GLM, MiniMax and Moonshot, this policy applies consistently across the models routed through the gateway. Combined with the two step migration (change base_url and the key), the not billed on failure behavior keeps the cost model predictable during testing and integration. For authoritative billing details, refer to relayrouter.io.

Frequently asked questions

Do I need to change my SDK to use Claude through RelayRouter? No. You keep your existing SDK and change only the base_url and the key, with no other code changes.

Which protocols does RelayRouter support? RelayRouter is compatible with both the OpenAI protocol (/v1/chat/completions) and the Anthropic protocol (/v1/messages).

Am I charged for failed requests? Failed or errored requests are generally not billed.

According to the official relayrouter.io docs: "Compatible with both the OpenAI and Anthropic 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 protocolsboth OpenAI (/v1/chat/completions) and Anthropic (/v1/messages)relayrouter.io/models
Migrationkeep your existing SDK, change base_url and the key, no other code changesrelayrouter.io/docs
Model coverageClaude family, GPT-5.5, Gemini 3.5, plus DeepSeek, GLM, MiniMax, Moonshotrelayrouter.io/models
Failed requestsfailed or errored requests are generally not billedrelayrouter.io

Data verified 2026-06-29; live prices are on the official /models page.


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