Claude Code

Flux for Claude Code

Keep Claude Code. Give it 90+ models from 12 AI labs on one key, plus page reading and images through the Flux tools server.

Set it up

Flux Desktop can write this config for you in one click. To do it by hand:

  1. Add an env block to your Claude Code settings. ~/.claude/settings.json

    ~/.claude/settings.json
    {
      "env": {
        "ANTHROPIC_BASE_URL": "https://api.fluxrouter.ai/anthropic",
        "ANTHROPIC_AUTH_TOKEN": "sk-YOUR-FLUX-KEY",
        "ANTHROPIC_MODEL": "flux-auto"
      }
    }
  2. Or set it in your shell, then launch Claude Code.

    bash
    export ANTHROPIC_BASE_URL="https://api.fluxrouter.ai/anthropic"
    export ANTHROPIC_API_KEY="sk-YOUR-FLUX-KEY"
    claude

This recipe comes from our earlier Claude Code guide. We have not re-checked it against the newest Claude Code release yet.

Check the first call

  1. Start claude in any folder and send "Reply with the word ready."

  2. Open Activity in your Flux account to see the call counted against the model that answered and the key that made it.

What Claude Code gets

What Claude Code gets through Flux
AbilityTodayHow it reaches Claude Code
Every major modelLiveAutomatic, through the base URL.
Read a web pageLiveAdd the Flux tools server (below).
Search the webRolling outSwitched on and being checked. Not promised yet.
Make imagesLiveAdd the Flux tools server (below).
SpeakRolling outSwitched on and being checked. Not promised yet.
Transcribe audioNot in agents yetLive on the API for your own code. No agent reaches it yet.
Act in your appsShippingNot live yet. It is on the way.
MemoryShippingNot live yet. It is on the way.
Second opinionRolling outSwitched on and being checked. Not promised yet.

Statuses come from the same record as the abilities on the homepage, so they change everywhere at once.

Add the Flux tools server

Page reading and image making reach Claude Code through the Flux tools server, an MCP server on the same key. Web search joins it once it is live.

  1. Add the Flux tools server from your terminal.

    bash
    claude mcp add --transport http flux-tools https://api.fluxrouter.ai/mcp-tools/ \
      --header "Authorization: Bearer sk-YOUR-FLUX-KEY"

Format from Claude Code’s own MCP docs, read on 28 September 2026.

Good to know

  • settings.json wins over your shell. If both set the same variable, the settings.json env block takes precedence.
  • Claude Code turns off MCP tool search on a custom host. Set ENABLE_TOOL_SEARCH=true to bring it back.
  • On a brand new install, the settings.json env block can fail to load on the very first run. Run it again, or export the variables in your shell instead.
  • flux-auto bills at the Standard rate, or the Fast rate when it sends your request to the Fast lane and a Fast model answers. Never more than Standard. Pin a model and you pay that model’s rate instead.
  • Flux can pick a different model from one request to the next. A prompt cache belongs to one model, so a switch can mean a cache miss. If a long session leans on caching, pin a model.
  • The Flux tools server needs a funded key. Without one, its tools return an error instead of a result.

If it won’t connect

Claude Code answers 404, or says the model was not found.
ANTHROPIC_BASE_URL must be the Anthropic base, without /v1 on the end. Claude Code adds /v1/messages itself, so a base ending in /v1 asks for /v1/v1/messages.
Claude Code still talks to Anthropic directly.
A value in the env block of ~/.claude/settings.json beats your shell. Check both places, and restart Claude Code after any change.
Every request comes back 401.
The key is missing, mistyped, or an old provider key is still set and wins. Paste your Flux key again and remove any other provider key from this config.
Requests come back 402.
Your account has reached its spend ceiling. Add funds or raise the ceiling in your Flux account, then try again.

More fixes: my tool won’t connect.

Try this next

Fix a failing test
The checkout test fails after the payments upgrade. Fix it, open a PR and post the link in #eng.

Some steps in this job use abilities that are still shipping, so Claude Code does part of it today.