Use Claude Fable 5.1 and Opus 5.5 in Claude Code with an API key
Run Claude Fable 5.1, Fable 5 or Opus 5.5 in Claude Code with a SeedRouter API key: the environment variables, model selection, and what each session costs.
Read as MarkdownClaude Code can run Claude Fable 5.1, Claude Fable 5 and Claude Opus 5.5 through SeedRouter. Set two environment variables, ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY, pick the model with --model, and every request is billed per token from your SeedRouter balance instead of a Claude plan. Tool use, file reads and prompt caching work the same way as on Anthropic's own API.
We checked this end to end on September 27, 2026 with Claude Code 2.1.280: multi-step tasks with file reads completed on Claude Opus 5.5 and Claude Fable 5.1, and in multi-step sessions the long Claude Code prompt was read from the cache after the first request.
How do I connect Claude Code to SeedRouter?
- Create a key on the API keys page and add credit on the billing page.
- Set the endpoint and the key in your shell:
export ANTHROPIC_BASE_URL=https://api.seedrouter.ai
export ANTHROPIC_API_KEY=sk-your-seedrouter-key- Start Claude Code with the model you want:
claude --model claude-fable-5-1Claude Code's documentation describes ANTHROPIC_BASE_URL as the way to "route requests through a proxy or gateway", and ANTHROPIC_API_KEY as a key sent in the X-Api-Key header that is used "instead of your Claude Pro, Max, Team, or Enterprise subscription even if you are logged in." In an interactive session, Claude Code asks you once to approve the key before it takes over from your subscription.
How do I choose between Claude Fable 5.1, Fable 5 and Opus 5.5?
Pass the model ID with --model, or set it once for every session:
export ANTHROPIC_MODEL=claude-fable-5-1| Model ID | Good for in Claude Code |
|---|---|
claude-opus-5-5 | Everyday coding: the lowest price per token of the three |
claude-fable-5-1 | Long refactors, hard debugging, work that needs the deepest reasoning |
claude-fable-5 | Older setups that rely on forcing a tool call |
Claude Code also uses the haiku and sonnet model aliases for background work and for its model picker. SeedRouter sells only the three models above, so point those aliases at one of them:
export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-5-5
export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-opus-5-5
export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-opus-5-5The Fable 5.1 vs Fable 5 vs Opus 5.5 comparison goes deeper into which model fits which job.
How do I make the settings permanent?
Put the same variables in the env block of ~/.claude/settings.json, and Claude Code reads them however it is launched:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.seedrouter.ai",
"ANTHROPIC_API_KEY": "sk-your-seedrouter-key",
"ANTHROPIC_MODEL": "claude-fable-5-1",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-opus-5-5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-opus-5-5"
}
}Keep this file private. It holds a key that spends your balance.
What does a Claude Code session cost?
Claude Code sends a long system prompt with every request: its instructions, tool definitions and any CLAUDE.md files. In our runs that prefix was tens of thousands of tokens. It is billed like any other request, by the token counts in the response:
- The first request writes the prefix to the prompt cache, billed at the cache-write rate.
- Later requests in the session read it back at the cache-read rate, a small fraction of the input rate.
- The model's answers and thinking are billed as output.
So the first turn of a session is the expensive one, and the following turns cost mostly their new output. The live rates for each line are in the Claude API pricing guide, and every request shows up in usage history.
Two ways to spend less: use claude-opus-5-5 for routine work, and keep CLAUDE.md files short, because they are part of the prefix on every request.
Frequently asked questions
Is Claude Fable 5.1 available in Claude Code with an API key?
Yes. With ANTHROPIC_BASE_URL set to https://api.seedrouter.ai and a SeedRouter key in ANTHROPIC_API_KEY, claude --model claude-fable-5-1 runs Claude Fable 5.1 with Claude Code's tools. Our test sessions read project files and answered from them.
Does this use my Claude Pro or Max plan?
No. Once you approve the key, Claude Code uses it instead of your plan, and the requests are billed per token to your SeedRouter balance. Unset the two variables to go back to your plan.
Does prompt caching work through SeedRouter?
Yes. In our multi-step Claude Code sessions the first request wrote the prompt prefix to the cache and the following requests read it back, billed at the cache-read rate. You do not need to configure anything; Claude Code marks the cache breakpoints itself.
Can I switch models in the middle of a session?
Yes, with /model and a model ID. Thinking blocks do not always carry across models, so the new model continues from the visible conversation.
Start coding
Create a key on the API keys page, export the two variables, and run claude --model claude-opus-5-5 in your project. Try prompts first on the Claude Opus 5.5 or Claude Fable 5.1 page if you want to compare the models before a session.



