Run Claude Code on any model through ChromaLab
Claude Code talks to the Anthropic Messages API. ChromaLab serves that API at /v1/messages for every model in its catalog, so you can keep Claude Code's interface and swap the model underneath it, including models Anthropic doesn't make.
Setup
Install the CLI if you don't have it:
npm install -g @anthropic-ai/claude-code
Create a key on the API keys page, then point Claude Code at ChromaLab:
export ANTHROPIC_BASE_URL="https://chromalab.ink"
export ANTHROPIC_AUTH_TOKEN="chroma-xxxxxxxxxxx-xxxxxxxxxxx"
Pick the models. ANTHROPIC_MODEL is the main one; ANTHROPIC_SMALL_FAST_MODEL handles Claude Code's background tasks, and a cheap model there keeps unit spend down.
export ANTHROPIC_MODEL="anthropic/claude-sonnet-4.6"
export ANTHROPIC_SMALL_FAST_MODEL="anthropic/claude-haiku-4.5"
claude
Any id from the models page works in either slot.
What carries over
A proxy that converts Anthropic requests to another format can break an agent in quiet ways. On this path ChromaLab keeps three things intact:
tool_useandtool_resultblocks round-trip in both directions, along withtoolsandtool_choice, so Claude Code's file edits and shell calls work on non-Anthropic models.- Tool-argument deltas stream as they arrive (
input_json_delta) instead of arriving in one burst at the end. - The
cache_controlmarkers Claude Code sets are forwarded upstream, so cache-hit pricing still applies on Anthropic-backed models.
Choosing a non-Anthropic model
Agents lean on tool calling far more than chat does, and not every model handles it equally well. Each catalog entry carries a tool_call_reliability tag of high or unverified. high reflects provider documentation, not a live test against an agent loop, so treat it as a good starting point rather than a guarantee. If Claude Code's edits start failing on an unfamiliar model, check whether it is writing tool calls as plain text before you debug anything else.
The full setup, and the equivalents for Cursor, OpenCode and aider, are in the docs.