relay.fast
RU Sign in

Setup guide

Connect CC Switch to relay.fast for Claude Code and Codex

In CC Switch you can add relay.fast as a custom provider for Claude Code and Codex. Each request is charged per token to your relay.fast balance, and no subscription is needed.

What CC Switch does

As of 27 November 2026, the CC Switch documentation describes it as an open-source desktop application for Windows, macOS and Linux. The programs it manages include Claude Code, Claude Desktop, Codex, Gemini CLI and OpenCode. Each program has a tab with its own list of providers. CC Switch is not a provider itself. It writes the address, the key and the models into the settings of the program you chose, so you still need a relay.fast API key.

Claude Code in CC Switch

The steps follow the CC Switch documentation as of 27 November 2026. Labels can change with new versions.

  1. Create an API key in the relay.fast dashboard.
  2. Open the Claude Code tab and click "Add Provider".
  3. Choose "Custom Configuration".
  4. Fill in the fields as shown below.
    FieldValue
    Provider Namerelay.fast
    Website URLhttps://relay.fast
    API Keyyour relay.fast key
    API Endpointhttps://relay.fast
    Upstream FormatAnthropic Messages (Native)
    Main Modelclaude-sonnet-5-5
    Default Haiku Modelclaude-haiku-5-5
    Default Sonnet Modelclaude-sonnet-5-5
    Default Opus Modelclaude-opus-5-5
  5. Save and click "Enable" on the provider card.

The address has no /v1, because Claude Code adds /v1/messages by itself. CC Switch writes the address into ANTHROPIC_BASE_URL and the key into the settings of Claude Code. relay.fast accepts the key in either header that Claude Code can send. With the Anthropic Messages format relay.fast serves Claude models. The model ids are listed in the model catalog. For the same setup without CC Switch, see the Claude Code guide.

Codex through relay.fast

  1. Open the Codex tab, click "Add Provider" and choose "Custom Configuration".
  2. Enter the API key you created in the relay.fast dashboard. Then enter https://relay.fast/v1 in the "API Request URL" field.
  3. Leave "Upstream Format" at "Responses (native)".
  4. Put a GPT model id from the catalog, for example gpt-6.1-sol, into the model line of the config.toml preview.
  5. Save and click "Enable". CC Switch then shows a message that the client must be restarted. Restart Codex.

Here the address ends with /v1, because Codex adds /responses. The Codex guide shows the same setup without CC Switch.

Other programs

Gemini CLI and OpenCode are set up the same way on their own tabs. Their values are in the Gemini CLI guide and the OpenCode guide. After a switch, CC Switch also asks you to restart Gemini CLI and Claude Desktop.

Formats marked "Requires routing"

The "Upstream Format" list on the Claude Code tab also has values marked "(Requires routing)", for example "OpenAI Chat Completions (Requires routing)". According to the CC Switch documentation, in such a mode the application converts Claude Code requests into another format on your computer through its local routing and then sends them to the provider. relay.fast serves DeepSeek, Kimi, GLM, Qwen and other models in the OpenAI format at https://relay.fast/v1. In a routing mode the conversion is done by CC Switch, not by relay.fast, so the behavior of tools and long sessions in that mode depends on CC Switch. Without routing, Claude Code with a relay.fast key works with Claude models.

Troubleshooting

  • A 404 with the text Invalid URL in Claude Code means the "API Endpoint" address ends with /v1. Remove /v1.
  • A 404 with the code invalid_endpoint in Codex means the address is missing /v1 at the end.
  • A 401 with the text Invalid token means the key is wrong, disabled or pasted with spaces.
  • A 404 with the code model_not_found means the model id does not match the catalog.
  • If the settings did not change after a switch, restart the program. Codex, Gemini CLI and Claude Desktop read their settings at start.
  • A relay.fast key works only with the relay.fast address. A provider card with another address needs the key of that service.

Current prices of the models in this guide

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.

ModelModel IDOfficial input / output per 1M tokensrelay.fast from, input / outputCache read fromContext
Claude Sonnet 5.5claude-sonnet-5-5$2 / $10$0.238 / $1.19 (−88%)$0.02381M
Claude Haiku 5.5
requests above 100K input tokens cost more
claude-haiku-5-5$0.1 / $0.5$0.0223 / $0.112 (−77%)$0.002231M
Claude Opus 5.5claude-opus-5-5$4 / $20$0.476 / $2.38 (−88%)$0.02381M
GPT-6.1 Sol
requests above 272K input tokens cost more
gpt-6.1-sol$2 / $10$0.03 / $0.15 (−98%)$0.00151.05M

Frequently asked questions

What is CC Switch?

CC Switch is an open-source desktop application. It keeps provider settings for Claude Code, Codex and other coding programs and switches between providers.

Which address do I enter for relay.fast in CC Switch?

For Claude Code, enter https://relay.fast without /v1. For Codex, enter https://relay.fast/v1.

Can Claude Code use DeepSeek through CC Switch?

Only in a format marked "Requires routing", where CC Switch converts the requests on your computer. relay.fast serves DeepSeek in the OpenAI format. Without routing, Claude Code with a relay.fast key works with Claude models.

Do I need CC Switch to use relay.fast?

No. Each program can be set up directly, and the guides for Claude Code and Codex show how.

Is CC Switch affiliated with relay.fast?

No. CC Switch is a separate open-source product. This page shows how to connect it to relay.fast.

Start with relay.fast