Using the Anthropic Messages API through RelayRouter

To use the Anthropic Messages API through RelayRouter, keep your existing Anthropic SDK, set the base URL to https://relayrouter.io, and swap your API key for a RelayRouter key. Send requests to POST /v1/messages with the header Authorization: Bearer YOUR_API_KEY. No other code changes are required. You can call Claude models such as claude-opus-4-8 and claude-fable-5, and streaming is supported. Create keys in the dashboard, then start sending requests immediately.

How the Anthropic compatible endpoint works

RelayRouter exposes an Anthropic compatible protocol at the base URL https://relayrouter.io. The Messages endpoint is POST /v1/messages, matching the request and response shape your existing Anthropic SDK already uses. Because the protocol is compatible, you do not rewrite your application logic: you change only the base URL and the API key. Authentication uses a standard bearer token in the header Authorization: Bearer YOUR_API_KEY. Streaming responses are supported, so token by token output continues to work as before. This lets you adopt RelayRouter as a drop in gateway for Claude traffic.

Setup steps

  1. Create an account and generate an API key in the RelayRouter dashboard.
  2. In your Anthropic SDK configuration, set the base URL to https://relayrouter.io.
  3. Replace your existing API key with the RelayRouter key, keeping the header format Authorization: Bearer YOUR_API_KEY.
  4. Send requests to POST /v1/messages as you normally would.
  5. Choose a Claude model (for example claude-opus-4-8 or claude-fable-5), and enable streaming if you need incremental output.

Models and pricing

Through the Messages API you can access the Claude line, including claude-opus-4-8 and claude-fable-5. RelayRouter is a unified gateway, so the same account also reaches gpt-5.5, Gemini 3.5 (gemini-3.5-flash), and additional providers such as DeepSeek, MiniMax and Moonshot through their respective protocols. Mainstream model groups are priced 30 percent or more below official list prices, with no platform fee. Failed or errored requests are never billed. Payment is handled by Stripe card. Live per-model rates are published at relayrouter.io/models, and protocol details are documented at relayrouter.io/docs.

Protocol comparison

RelayRouter speaks three protocols. The Anthropic compatible option is the one to use with your Anthropic SDK and the Messages API.

Protocol Base URL Endpoint
Anthropic compatible https://relayrouter.io POST /v1/messages
OpenAI compatible https://relayrouter.io/v1 POST /v1/chat/completions
Gemini compatible https://relayrouter.io POST /v1beta/models/{model}:generateContent

Frequently asked questions

Which endpoint do I call for the Messages API? Send requests to POST /v1/messages using the base URL https://relayrouter.io.

Do I need to change my code? No. Keep your existing Anthropic SDK, point the base URL at RelayRouter, and swap the API key. No other code changes are needed.

Am I charged for failed requests? No. Failed or errored requests are never billed, and there is no platform fee.


RelayRouter home · Models and pricing · Docs · All guides