Claude Code
Every variable the client reads, and what to check when something looks wrong.
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[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.
| Variable | Required | What it does here |
|---|---|---|
ANTHROPIC_BASE_URL | Yes | Where the client sends requests. Set it to https://api.tokenify.dev with no path — the client appends /v1/messages itself. |
ANTHROPIC_AUTH_TOKEN | One of the two | Your Tokenify key. Sent as Authorization: Bearer, which this API accepts on every endpoint. |
ANTHROPIC_API_KEY | One of the two | The 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_MODEL | Yes | The 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_MODEL | Recommended | The 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_MODEL | No | The 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_MODEL | No | Read 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_SERVER | No | Set 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_TOKENS | No | Has 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]"
}
}Web search
Server-side web search is not available on this API today. The model vendor offers it as a built-in tool, our account is not yet entitled to use it, and we will not quietly answer as though a search happened when none did.
This costs Claude Code users very little in practice: its WebSearch and WebFetch tools run on your own machine and go out over your own network, so they work here exactly as they do anywhere else. What is missing is the vendor-side tool, which the model would call by itself.
We would rather ship this properly than soon: it is billed per call rather than per token, so it needs to appear as its own line on your invoice and be bounded per request. When it arrives it will be charged at what it costs us, with nothing added.
If something looks wrong
| Symptom | Cause |
|---|---|
402 | Out of credit, or too little for the reservation. Top up; the message says how much the request needed. |
| Conversation compacts far too early | The [1m] suffix is missing from the model name, so Claude Code is assuming a 200K window. |
404 naming the model | The [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 model | ANTHROPIC_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 startup | Cosmetic. 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 /model | The 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 rejected | No model in the current catalogue accepts image input. See models for what each one takes. |
| A beta feature does nothing | Context 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 rejected | Check models and pricing for the current ids. We never substitute a different model for the one you asked for. |
Last updated 2026-10-02.