Skip to content
FluxCDNFluxCDN
esc
On this page

DocsTools guide

Claude Code with FluxCDN AI

Claude Code reads your code, runs commands and edits files. Two settings connect it to FluxCDN: the address and the key. Then any model in our catalog can drive it, paid in Toman from your wallet.

Licence:
Anthropic's software, not open source
Platforms:
macOS, Linux, Windows
Address (Anthropic-compatible):
https://ai.fluxcdn.cloud/api

Before you start

  • Create an API key. On the API keys page press “Create key” and copy the key right away. It starts with flux_live_ and is never shown in full again.
  • Claude Code installed, and up to date if you installed it earlier.
  • Give agents a key of their own and set a daily or monthly spending limit on it with “Limits”. Agents send request after request by themselves; the limit stops spending you didn't expect.
  • Have some credit in the account (Billing).
  • In the examples, put your own key where it says flux_live_YOUR_KEY.

Set it up

  1. Step 1: Pick a model setup and save the settings

    The best place is Claude Code's own settings file: the same on all three systems, and it survives closing the terminal. If you already have the file, add only the env block to it. Environment variables (the next tabs) do the same; one of the two is enough.

    Pick a setup; the settings below change with it. Any id from the models page works in their place too.

    Price per million tokens. Free plan prices, in Toman at today's rate. Routers (router/auto and the like) are not recommended for agents: an agent needs a model that is sure to support tools.

    ~/.claude/settings.json · Windows: %USERPROFILE%\.claude\settings.json
    {
      "env": {
        "ANTHROPIC_BASE_URL": "https://ai.fluxcdn.cloud/api",
        "ANTHROPIC_AUTH_TOKEN": "flux_live_YOUR_KEY",
        "ANTHROPIC_MODEL": "anthropic/claude-sonnet-5.5",
        "ANTHROPIC_DEFAULT_OPUS_MODEL": "anthropic/claude-sonnet-5.5",
        "ANTHROPIC_DEFAULT_SONNET_MODEL": "anthropic/claude-sonnet-5.5",
        "ANTHROPIC_DEFAULT_HAIKU_MODEL": "anthropic/claude-haiku-5.5",
        "CLAUDE_CODE_MAX_OUTPUT_TOKENS": "32000",
        "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
        "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1"
      }
    }

    Open a new terminal after changing your shell profile. On Windows setx saves for later windows: close PowerShell and open it again. For the current window only: $env:ANTHROPIC_BASE_URL = "https://ai.fluxcdn.cloud/api" and so on.

  2. Step 2: Start Claude Code

    Run claude in your project folder. No Anthropic account is needed; requests go out with your FluxCDN key.

    Terminal
    cd your-project
    claude
  3. Step 3: In VS Code, JetBrains and the desktop app

    VS Code extension: put the settings from the “VS Code” tab of step 1 in VS Code's own settings.json; claudeCode.disableLoginPrompt stops the Anthropic sign-in window. The JetBrains plugin uses Claude Code's own settings (~/.claude/settings.json). The Claude desktop app reads neither; enter the address and key under Developer → Configure Third-Party Inference.

What each setting does

ANTHROPIC_BASE_URL= https://ai.fluxcdn.cloud/api
The FluxCDN address. Write it without /v1; Claude Code adds /v1/messages itself.
ANTHROPIC_AUTH_TOKEN= flux_live_…
Your key, sent as Authorization: Bearer. This is what we recommend.
ANTHROPIC_API_KEY= flux_live_…
Another way to give the key (as the x-api-key header). In interactive mode Claude Code asks once whether to use it. One of the two is enough.
ANTHROPIC_MODEL
The main model; any id from the models page. Left empty, Claude Code sends claude-opus-5-5, which FluxCDN reads as anthropic/claude-opus-5.5.
ANTHROPIC_DEFAULT_OPUS_MODEL · ANTHROPIC_DEFAULT_SONNET_MODEL · ANTHROPIC_DEFAULT_HAIKU_MODEL
The models behind the names opus, sonnet and haiku in the /model menu and in subagents. Haiku does small background tasks; give it a cheap, quick model. ANTHROPIC_SMALL_FAST_MODEL is deprecated; set Haiku instead.
CLAUDE_CODE_SUBAGENT_MODEL
Optional: one model for every subagent.
CLAUDE_CODE_MAX_CONTEXT_TOKENS
The model's context size. Needed for models that aren't Claude; without it Claude Code warns that it assumed 200k tokens. The setups above fill it in from our catalog.
CLAUDE_CODE_MAX_OUTPUT_TOKENS= 32000
The output limit of each request. With 32000 less credit is set aside per request (see Troubleshooting below).
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC= 1
Turns off auto-update, error reports and usage statistics sent to Anthropic. Run claude update now and then to update.
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS= 1
Doesn't send experimental features only Anthropic's server understands. Recommended with any address other than Anthropic's.

Check it works

  1. Step 1: Look at the status

    Type /status in Claude Code. It should show “Anthropic base URL” as https://ai.fluxcdn.cloud/api and an “Auth token” set.

  2. Step 2: Send a message

    For example, “What does this project do?”. When the answer comes, you'll see the request, its model and its cost under Activity in the console.

  3. Step 3: Switch models

    /model deepseek/deepseek-v4-pro (or any other id). Claude Code first sends a tiny test request, and switches when it gets an answer.

Troubleshooting

“API Error: 402 Not enough credit for this request. Top up the wallet and try again.” although you have credit
Before each request, the most it could cost is set aside from your credit; when the answer ends, only the real cost is taken and the rest is released. On Opus, Claude Code asks for up to 128000 output tokens — at least 922,593 Toman set aside per request, even if the answer turns out far shorter. Set CLAUDE_CODE_MAX_OUTPUT_TOKENS to 32000 to bring that down to about 230,648 Toman. If it still happens, add credit.
“Claude Code doesn't recognize the model …, assumes a context window of 200k tokens”
Harmless; the work goes on. Claude Code doesn't know models that aren't Claude; CLAUDE_CODE_MAX_CONTEXT_TOKENS tells it the real context size. The setups above include that line, and each model's page shows the number.
Claude Code still asks you to sign in to Anthropic
The settings weren't read. Check ~/.claude/settings.json: it must be valid JSON (commas, braces). If you used environment variables, open a new terminal. In the VS Code extension set claudeCode.disableLoginPrompt to true.
Claude Code asks whether to use an API key
That's for ANTHROPIC_API_KEY and is asked once; approve it. Or use ANTHROPIC_AUTH_TOKEN instead, which asks nothing.
“There's an issue with the selected model (…)”
The model id isn't in FluxCDN or is misspelled. Copy it exactly from the models page, with the maker's prefix: deepseek/deepseek-v4-pro, not deepseek-v4-pro. The model must support tools.
“Failed to authenticate. API Error: 401 This API key is not valid.”
The key wasn't copied whole, was revoked, or an old key is still being read. It starts with flux_live_. Check in /status which setting Claude Code read; if you changed an environment variable, open a new terminal. Claude Code doesn't retry a wrong key; it shows this error the first time.
The cost Claude Code shows differs from the console
The cost Claude Code prints (/cost, total_cost_usd) is its own estimate at Anthropic's list prices, not what FluxCDN charged. The real cost of each request, in Toman, is under Activity in the console.
Error 429: rate_limit_exceeded or budget_exceeded
Either requests per minute went over the limit (wait a little; most tools retry by themselves), or this key's spending today or this month reached its limit. See it on API keys under “Limits”.
Error 502, 503, 504 or 529
The model's service was briefly unavailable. Send again; most tools do it themselves. A request that fails before answering costs nothing. If it lasts, switch to another model for a while.

Limits

  • Claude Code's WebSearch tool doesn't work through any address but Anthropic's own, because the search runs on Anthropic's servers. WebFetch (reading a given page) works.
  • Anthropic officially supports only its own models in Claude Code. Other models work technically; how well the agent works depends on the model.
  • The Claude desktop app doesn't read the settings file or the variables above (step 3).

What doesn't work this way →