Tokenify

Claude Code

Every variable the client reads, and what to check when something looks wrong.

Tokenify does not resell Claude and is not affiliated with Anthropic. Claude Code is a client that speaks the Anthropic Messages API, and that is what we serve — so the tool runs unchanged against our models.

This page is the reference. For the walkthrough — which model to pick, the compatibility results from a real session, and what a session actually costs — see using Claude Code with DeepSeek.

export ANTHROPIC_BASE_URL=https://api.tokenify.dev
export ANTHROPIC_AUTH_TOKEN=tk-live-…
export ANTHROPIC_MODEL='deepseek/deepseek-v4-pro[1m]'

claude
Keep the [1m]. Claude Code does not recognise our model ids, so it assumes a 200K context window and starts compacting your conversation at 200K on a model that holds a million. The suffix tells it the real window. It never reaches us — Claude Code reads it and strips it before sending — so it changes nothing about routing, pricing or which model you get.

Every variable

What each one does when the client is pointed here, rather than what it does against Anthropic. The names are those read by Claude Code 2.1.285; they have changed between releases, so the spellings below were taken from the client itself rather than from memory.

VariableRequiredWhat it does here
ANTHROPIC_BASE_URLYesWhere the client sends requests. Set it to https://api.tokenify.dev with no path — the client appends /v1/messages itself.
ANTHROPIC_AUTH_TOKENOne of the twoYour Tokenify key. Sent as Authorization: Bearer, which this API accepts on every endpoint.
ANTHROPIC_API_KEYOne of the twoThe same thing by the other header: the client sends it as x-api-key, which this API also accepts. Set one or the other, not both.
ANTHROPIC_MODELYesThe model that does the work. Not optional here: we do not map Anthropic model names onto other vendors’ models, so without it the client asks for a Claude model and gets Unknown model. See models for the ids.
ANTHROPIC_DEFAULT_HAIKU_MODELRecommendedThe cheaper model used for small background work such as titling a conversation. Left unset, those tasks go to whatever the client defaults to and are rejected the same way.
ANTHROPIC_SMALL_FAST_MODELNoThe former name for the variable above. Still read by the client, so an older setup keeps working; prefer ANTHROPIC_DEFAULT_HAIKU_MODEL in anything new.
ANTHROPIC_DEFAULT_SONNET_MODELNoRead by the client for its own model aliases. Setting it is a way to make /model sonnet resolve to one of ours; ANTHROPIC_MODEL is the simpler route.
CLAUDE_CODE_AUTO_MODE_SERVERNoSet it to 0 to stop auto mode making its classifier request. That request is ordinary billed inference here, because the no-charge version depends on a safety check that runs inside Anthropic’s own API and no gateway in front of another vendor’s models can perform it. Auto mode works either way.
MAX_THINKING_TOKENSNoHas no effect against this API. Measured on 2026-10-01: with it set, the client still sends thinking: {"type":"adaptive"} and no token budget, so there is nothing for us to honour or refuse — a depth would be passed on, and that client sends none. Which models explains.

The same settings live under env in ~/.claude/settings.json, which is what to use if you would rather not export anything:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.tokenify.dev",
    "ANTHROPIC_AUTH_TOKEN": "tk-live-…",
    "ANTHROPIC_MODEL": "deepseek/deepseek-v4-pro[1m]",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek/deepseek-v4-flash[1m]"
  }
}

If something looks wrong

SymptomCause
402Out of credit, or too little for the reservation. Top up; the message says how much the request needed.
Conversation compacts far too earlyThe [1m] suffix is missing from the model name, so Claude Code is assuming a 200K window.
404 naming the modelThe [1m] suffix was sent to us rather than read by Claude Code, which happens if you put it somewhere Claude Code does not parse. It belongs in the model name.
Unknown model naming a Claude modelANTHROPIC_MODEL is unset, so the client asked for its own default. We never substitute a different model for the one you asked for, so it is an error rather than a surprise.
An “unrecognized model” warning on startupCosmetic. Claude Code’s catalogue lists Anthropic models and ours are not in it; the [1m] suffix handles the part that matters, the context window.
Our models are missing from /modelThe picker keeps only ids containing “claude” or “anthropic”. Ours name the vendors whose models they actually are, and renaming them to pass that filter would be a lie. Set ANTHROPIC_MODEL instead.
A screenshot or image is rejectedNo model in the current catalogue accepts image input. See models for what each one takes.
A beta feature does nothingContext management, the effort beta and the structured-output betas are features of Anthropic’s API rather than of the models we serve. They are dropped quietly, so a request carrying them still runs.
A model id is rejectedCheck models and pricing for the current ids. We never substitute a different model for the one you asked for.

Last updated 2026-10-02.