Tutorial

Use any model in Claude Code through Token Station

Claude Code can talk to Token Station without a wrapper or proxy. Point Claude Code at https://models.bytefuture.ai, use your Token Station key as the Anthropic auth token, and choose which Token Station model should answer Opus, Sonnet, Haiku, and subagent requests.

There are two clean ways to do it:

  • Use ~/.claude/settings.json when you want the setup to persist across shells.
  • Use exported environment variables when you want a temporary session, a CI job, or a one-off test.

Option 1: persistent settings.json

Create Claude Code's settings directory and write the environment block into ~/.claude/settings.json:

mkdir -p ~/.claude
cat > ~/.claude/settings.json <<'EOF'
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://models.bytefuture.ai",
    "ANTHROPIC_AUTH_TOKEN": "YOUR TOKEN AT TOKEN STATION",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "openai/gpt-5.5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "openai/gpt-5.4-mini",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "openai/gpt-5.4-nano",
    "CLAUDE_CODE_SUBAGENT_MODEL": "openai/gpt-5.4-mini"
  }
}
EOF

Then run a minimal prompt to confirm the CLI is using Token Station:

claude -p "Respond with exactly the word: pong"

If the output is exactly pong, Claude Code is reaching Token Station and the selected model is responding.

Option 2: temporary shell exports

If you do not want to write a settings file, export the same values in the shell that will launch Claude Code:

export ANTHROPIC_BASE_URL="https://models.bytefuture.ai"
export ANTHROPIC_AUTH_TOKEN="YOUR TOKEN AT TOKEN STATION"

export ANTHROPIC_DEFAULT_OPUS_MODEL="openai/gpt-5.5"
export ANTHROPIC_DEFAULT_SONNET_MODEL="openai/gpt-5.4-mini"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="openai/gpt-5.4-nano"
export CLAUDE_CODE_SUBAGENT_MODEL="openai/gpt-5.4-mini"

claude -p "Respond with exactly the word: pong"

This is useful when you want to test a different model mapping without changing your saved Claude Code configuration.

What each variable does

VariableMeaning
ANTHROPIC_BASE_URLThe API endpoint Claude Code sends requests to. For Token Station, use https://models.bytefuture.ai.
ANTHROPIC_AUTH_TOKENYour Token Station API key. Keep it out of source control.
ANTHROPIC_DEFAULT_OPUS_MODELThe model Claude Code should use for Opus-class requests.
ANTHROPIC_DEFAULT_SONNET_MODELThe model Claude Code should use for Sonnet-class requests.
ANTHROPIC_DEFAULT_HAIKU_MODELThe model Claude Code should use for Haiku-class requests.
CLAUDE_CODE_SUBAGENT_MODELThe model Claude Code should use for subagents.

Choosing models

The model IDs above are just a mapping. You can point each Claude Code tier at a different Token Station model, or use the same model everywhere. The practical default is a strong model for Opus and a faster, cheaper model for Sonnet, Haiku, and subagents.

Good Token Station starting points:

Claude Code slotToken Station modelWhy use it
Opusopenai/gpt-5.5Best default for hard planning, debugging, architecture, and long edits.
Sonnetopenai/gpt-5.4-miniBalanced daily driver for coding, reviews, repo navigation, and refactors.
Haikuopenai/gpt-5.4-nanoLow-cost, low-latency option for short prompts and quick checks.
Subagentopenai/gpt-5.4-miniStrong enough for delegated investigation without making every subtask flagship-priced.
Alternative Opusanthropic/claude-opus-4-8Use when you specifically want Claude-family behavior for long-horizon coding.
Budget codingkimi/kimi-k2.7-codeGood fit for routine implementation work when cost matters more than maximum reasoning depth.

You can copy any of these model IDs into the corresponding ANTHROPIC_DEFAULT_* variable above. Start with the balanced mapping in the config block, then move Opus up or Haiku down only when the task actually needs it.

If something does not connect

  • It still uses the default Anthropic endpoint. Confirm ANTHROPIC_BASE_URL is present in the shell that launches claude, or inside ~/.claude/settings.json.
  • 401 / auth errors. Replace YOUR TOKEN AT TOKEN STATION with your real Token Station key.
  • The wrong model answers. Check the Opus, Sonnet, Haiku, and subagent model variables. Claude Code chooses between these slots depending on the request type.
  • The settings file does not seem to apply. Validate that ~/.claude/settings.json is valid JSON and restart the Claude Code command after editing it.

Get started

For a permanent setup, use ~/.claude/settings.json. For a temporary setup, export the variables in your current shell. In both cases the check is the same: run claude -p "Respond with exactly the word: pong" and look for pong.

Sign up at models.bytefuture.ai ($10 in free credit, no card), put your Token Station key into Claude Code, and route Claude Code's model slots to the models you actually want to use.


Share this post Post LinkedIn Facebook Hacker News Reddit