Use any model with Claude Code
Claude Code speaks Anthropic's Messages API, and CompanyFabric serves it at /v1/messages. Set two variables and Claude Code runs on any model in the library. Claude models go to Anthropic as Claude Code sends them, so prompt caching keeps working; other models are translated, tool calls included, so file edits and commands work on them too.
Step by step
Setup
- 1
Create a key in your CompanyFabric dashboard, then point Claude Code at CompanyFabric. These variables apply to the terminal you set them in:
export ANTHROPIC_BASE_URL="https://api.companyfabric.com" export ANTHROPIC_API_KEY="sk-cf-…" - 2
Start a session on any model. Claude models take their usual names; everything else takes its catalog id:
claude --model claude-sonnet-5-5 claude --model openai/gpt-5.5 claude --model deepseek/deepseek-v4-1-flash claude --model companyfabric/auto - 3
Claude Code asks once whether to use the API key; answer yes. Every turn then appears in your dashboard's usage feed with its exact cost, and the key's budget cap applies.
- 4
Optional: add the CompanyFabric MCP server too, so Claude Code can search models, quote prices, search the web and check spend for you:
claude mcp add --transport http companyfabric https://companyfabric.com/api/mcp \ --header "Authorization: Bearer sk-cf-YOUR_KEY"
Recommended
Models that shine in Claude Code
Claude Sonnet 5.5
$2/Mtok inAnthropic
The fast Claude 5.5: near-Opus coding and knowledge work, 30%+ faster than Sonnet 5, at half Opus 5.5's price.
Added 28 Sep 2026 · text
Claude Haiku 5.5
$0.1/Mtok inAnthropic
Anthropic's cheapest and fastest Claude: a big step up from Haiku 4.5 in coding, computer use and knowledge work, at $0.10 / $0.50 per 1M tokens for prompts up to 100K.
Added 7 Oct 2026 · text
DeepSeek V4.1 Flash
$0.3/Mtok inDeepSeek
DeepSeek's cheapest current model, a million-token window at flash rates.
Added 10 Sep 2026 · text
FAQ
Frequently asked questions
Does prompt caching still work?
Yes. Claude models are sent to Anthropic exactly as Claude Code writes them, cache markers included, and billed at Anthropic's cache rates: the first turn of a session writes Claude Code's large prompt to the cache, later turns read it back at a fraction of the price. Other providers cache on their own side; where a model's page lists a cache price (DeepSeek, Gemini 4 Argon), cached input is billed at it.
I'm also logged in to a Claude subscription. Which one pays?
With ANTHROPIC_API_KEY set and approved, the key does, and Claude Code shows "API Usage Billing". It may warn that both are set; that is expected. Open a new terminal without the variables to go back to your subscription.
Claude Code says my model "isn't recognized". Is that a problem?
No. Claude Code knows Anthropic's model names, not ours, so for a model like openai/gpt-5.5 it assumes a 200k-token context and compacts before that. Everything else works normally.
Can I cap what Claude Code spends?
Yes. Set a monthly budget cap on the key in the dashboard; requests stop at the cap instead of surprising you at invoice time.
One key. Every model. Exact prices.
One key gives Claude Code the whole library. Free starter credits included, no subscription required.