Flux for any Anthropic-compatible tool

If your tool speaks Anthropic Messages, give it the Flux Anthropic base URL and your key. Every model answers in the same shape.

Set it up

  1. Most Anthropic tools read these variables. Set them, then start your tool from the same shell.

    bash
    export ANTHROPIC_BASE_URL="https://api.fluxrouter.ai/anthropic"
    export ANTHROPIC_API_KEY="sk-YOUR-FLUX-KEY"
    export ANTHROPIC_MODEL="flux-auto"
  2. If the tool has settings instead, enter the same values. The base URL has no /v1 on the end: the tool adds /v1/messages itself.

    text
    Base URL: https://api.fluxrouter.ai/anthropic
    API key:  sk-YOUR-FLUX-KEY
    Model:    flux-auto

Worked examples

Anthropic SDK (Python)

  1. Pass the base URL and your key when you make the client.

    python
    from anthropic import Anthropic
    
    client = Anthropic(
        base_url="https://api.fluxrouter.ai/anthropic",
        api_key="sk-YOUR-FLUX-KEY",
    )
    msg = client.messages.create(
        model="flux-auto",
        max_tokens=1024,
        messages=[{"role": "user", "content": "hi"}],
    )

Anthropic SDK (Node)

  1. Node spells it baseURL; Python spells it base_url.

    js
    import Anthropic from '@anthropic-ai/sdk';
    
    const client = new Anthropic({
      baseURL: 'https://api.fluxrouter.ai/anthropic',
      apiKey: 'sk-YOUR-FLUX-KEY',
    });

Check the first call

  1. Send "Reply with the word ready." from your tool. A reply means the base URL and key are right.

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

What your tool gets

What your tool gets through Flux
AbilityTodayHow it reaches your tool
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 a tool through the Flux tools server, an MCP server on the same key. Web search joins it once it is live.

  1. If your tool can add a remote MCP server with a header, add the Flux tools server. Most tools use this shape; check your tool’s docs for the file it reads.

    json
    {
      "mcpServers": {
        "flux-tools": {
          "url": "https://api.fluxrouter.ai/mcp-tools/",
          "headers": {
            "Authorization": "Bearer sk-YOUR-FLUX-KEY"
          }
        }
      }
    }

Good to know

  • 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

You get a 404 or "not found".
Use https://api.fluxrouter.ai/anthropic, with no /v1 on the end. Anthropic clients add /v1/messages themselves.
Every request comes back 401.
The key is missing or mistyped, or an old provider key is still set and wins. Paste your Flux key again and remove the other key.
The tool rejects the model name.
Some tools only accept names from their own list. Type flux-auto as a custom model if the tool allows it, or pick a flux- lane name it accepts: flux-fast, flux-standard or flux-reasoning.

More fixes: my tool won’t connect.