Bring a Claude-compatible endpoint to your coding workflow
Use the Anthropic-compatible request shape, verify the current Claude Code configuration names, and test a small repository before enabling autonomous or tool-heavy workflows.
Configuration outline
- Create a relay.fast API key and store it in the environment or secret manager used by Claude Code.
- Set the Anthropic-compatible base URL to
https://relay.fastaccording to the client version you use. - Use
/v1/messages, the required Anthropic version header, and a model listed for your account. - Test text, tool calls, streaming, and error recovery before granting broad filesystem or shell permissions.
Operational guardrails
Limit tool permissions, review generated diffs, set timeouts, and monitor usage. A compatible API does not remove the need for normal code-review and secret-management practices.
Configuration example
Claude Code reads these values from the env block of ~/.claude/settings.json:
{
"env": {
"ANTHROPIC_BASE_URL": "https://relay.fast",
"ANTHROPIC_AUTH_TOKEN": "sk-your-api-key",
"ANTHROPIC_MODEL": "claude-sonnet-5-5"
}
}Remove ANTHROPIC_API_KEY from the same block if it is there; the token above replaces it. The base URL has no /v1: Claude Code adds /v1/messages itself.
One-command setup
The script configures Claude Code for relay.fast. It writes the base URL, key and model to the Claude Code settings and checks the connection. It asks for the API key inside the script, so the key never appears in the command or shell history. Every downloaded file is checked against a published SHA-256 checksum, and running it again can restore the previous settings.
Windows (PowerShell):
powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://relay.fast/downloads/setup/install-claude-code-en.ps1 | iex"macOS and Linux:
curl -fsSL https://relay.fast/downloads/setup/install-claude-code-en.sh | bashYou can read the script before running it by opening the same URL in a browser.
Current prices of models for coding agents
Prices checked from the live catalog. "From" is the lowest price among the relay.fast sources that currently serve the model. The price you pay depends on the source your request uses and can change on any day. The pricing page always shows current values.
| Model | Model ID | Official input / output per 1M tokens | relay.fast from, input / output | Cache read from | Context |
|---|---|---|---|---|---|
| Claude Sonnet 5.5 | claude-sonnet-5-5 | $2 / $10 | $0.238 / $1.19 (−88%) | $0.0238 | 1M |
| Claude Opus 5.5 | claude-opus-5-5 | $4 / $20 | $0.111 / $0.556 (−97%) | $0.00556 | 1M |
| GPT-6.1 Sol requests above 272K input tokens cost more | gpt-6.1-sol | $2 / $10 | $0.03 / $0.15 (−98%) | $0.0015 | 1.05M |
| GLM-5.3 | glm-5.3 | $1.4 / $4.4 | $0.035 / $0.11 (−97%) | $0.0065 | 1M |
| Kimi K3 | kimi-k3 | $3 / $15 | $0.15 / $0.75 (−95%) | $0.015 | 1.05M |
| DeepSeek V4.1 Flash price depends on the time of day; the peak-hours price is shown | deepseek-v4.1-flash | $0.3 / $1.2 | $0.03 / $0.12 (−90%) | $0.0006 | 1M |
Frequently asked questions
Does relay.fast provide Claude Code itself?
No. Claude Code is a client. relay.fast provides a compatible API endpoint and account key for clients that support a custom base URL.
What if the client uses a different setting name?
Use the current client documentation and map its endpoint, API key, and model fields to the values in the relay.fast setup docs.
Is tool use supported?
Capability depends on the selected model and current configuration. Test the exact tools and schema you need.