Anthropic /v1/messages call fails on RelayRouter: header and version issues
Most failed Anthropic /v1/messages calls on RelayRouter have one of three causes. The base URL doubles the path (the Anthropic base is https://relayrouter.io, not https://relayrouter.io/v1). The request is missing a correct Authorization: Bearer YOUR_API_KEY header. Or the model ID does not match the catalog, such as an outdated Claude version string. Correct the base URL, the header and the model name, and keep your existing Anthropic SDK.
Is the base URL causing the /v1/messages failure?
Yes, a wrong base URL is a common cause, because the Anthropic and OpenAI bases on RelayRouter are different. The Anthropic compatible endpoint is POST /v1/messages with the base https://relayrouter.io. The Anthropic SDK appends /v1/messages itself. If you reuse the OpenAI base https://relayrouter.io/v1, the final path becomes /v1/v1/messages and the request fails. The OpenAI compatible endpoint is different: it uses POST /v1/chat/completions with the base https://relayrouter.io/v1. According to the official relayrouter.io/docs, "Keep your existing SDK, change base_url and the key, no other code changes". The base URL is therefore one of two values you need to change, so check it first. Full endpoint details are in the RelayRouter docs.
Which authentication header does RelayRouter expect?
RelayRouter documents its authentication as Authorization: Bearer YOUR_API_KEY, using a key created at https://relayrouter.io/dashboard. Here are common header mistakes:
- Sending an official Anthropic key instead of a RelayRouter key.
- Leaving out the
Bearerprefix, or adding extra whitespace or quotes around the key. - Loading the key from an environment variable that is empty at runtime.
When you migrate, replace the key value in your SDK configuration. Do not add custom auth code. Keep the other headers your SDK sends by default unchanged, because the migration model is to change only base_url and the key. If a request fails because of an auth or header error, it generally does not cost anything: according to relayrouter.io, failed or errored requests are generally not billed. You can retry after fixing the header without adding usage charges.
How do model version strings and protocols affect the call?
The model ID in the request body must match a model listed in the RelayRouter catalog, and it must suit the protocol you call. The catalog has about 108 models across 19 public groups. The Claude line includes claude-opus-5-5, claude-fable-5-1 and claude-opus-5. A Claude version string that is mistyped or out of date can cause the call to fail. According to the official relayrouter.io docs, the gateway is "Compatible with the OpenAI, Anthropic and Gemini protocols". Use the path that matches your SDK:
| Protocol | Endpoint | Base URL | Example model |
|---|---|---|---|
| Anthropic | POST /v1/messages | https://relayrouter.io | claude-opus-5-5 |
| OpenAI | POST /v1/chat/completions | https://relayrouter.io/v1 | gpt-6-astra |
| Gemini | POST /v1beta/models/{model}:generateContent | https://relayrouter.io | gemini-3.8-flash |
Check exact model IDs on the models page.
What does a working Claude call cost after the fix?
Claude usage is settled at CNY 2.0 per $1 of standard usage, and there is a $0 platform fee. For comparison, the market reference is CNY 6.8 per $1. The GPT group settles at CNY 0.6 per $1. Some models have direct pricing instead. 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). RelayRouter has no minimum spend and no subscription, and payment is by Stripe card. Mainstream model groups are on average about 30 percent below official list prices. Rates are listed per model and can change, so check the live rates before you estimate costs.
FAQ
Do I need to rewrite my Anthropic SDK code to use RelayRouter?
No. Change the base URL to https://relayrouter.io and replace the API key. No other code changes are required.
Am I charged for /v1/messages requests that fail?
Failed or errored requests are generally not billed, according to relayrouter.io.
Does the Anthropic endpoint support streaming?
Yes, RelayRouter supports streaming. See the docs for protocol details.
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.