claude code
through messages · /v1/messages · every model blackrouter serves, with its price and context window
model
deepseek-v4.1-flash · $0.30 in · $1.20 out /m · 128K context (not stated: 128K taken)
a key
create an account, then make an api key on it: it is shown once, so keep it.
it goes in claude code's settings, below, as ANTHROPIC_AUTH_TOKEN.
point claude code at blackrouter
{ "model": "deepseek-v4.1-flash", "env": { "ANTHROPIC_BASE_URL": "https://blackrouter.sh", "ANTHROPIC_AUTH_TOKEN": "brk-…", "ANTHROPIC_DEFAULT_MODEL": "deepseek-v4.1-flash", "ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-v4.1-flash", "ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-v4.1-flash", "ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-v4.1-flash", "CLAUDE_CODE_MAX_CONTEXT_TOKENS": "131072", "CLAUDE_CODE_ATTRIBUTION_HEADER": "0" } }beside what ~/.claude/settings.json holds already, your key in place of brk-… · claude code reads it when it starts
- /model
- its opus and sonnet rows name the model; haiku, for background work, deepseek-v4.1-flash
- compacts in time
- before 128K tokens: claude code would take an unknown model's as 200K
use it
claude
/model deepseek-v4.1-flash in a session switches to any id above, tags included.
other ways
take "model" and those lines of "env" out of ~/.claude/settings.json