Claude Code asks for a claude-sonnet model: which model answers and what you pay

Coding with AIClaude Code·· 6 views· 3 min read

Sometimes Claude Code asks for a model by its own name, such as claude-sonnet-..., instead of the catalogue id. It happens when ANTHROPIC_MODEL is not set, and also when a function or a subagent uses one of the Claude Code short names. This article explains what our API does then.

Which model answers

A name that is not in the catalogue gives no error. We use our default coding model, moonshotai/kimi-k2.7-code, and Claude Code keeps working. The answer shows the name that was asked for. So Claude Code may say claude-sonnet-... when Kimi K2.7 Code was the one answering.

Agents are the exception: if the model is agent/ followed by an id that does not exist or belongs to another account, the answer is 404 model_not_found.

What you pay

You pay for moonshotai/kimi-k2.7-code, at its price. The price is in the Models tab and in pricing, in GET /v1/models. With the Coding Plan, it spends points, because this model is part of the plan.

Choosing the model for each function

Variable What it chooses
ANTHROPIC_MODEL The main model of the session. Always set it.
ANTHROPIC_DEFAULT_SONNET_MODEL The model for the sonnet short name.
ANTHROPIC_DEFAULT_OPUS_MODEL The model for the opus short name.
ANTHROPIC_DEFAULT_HAIKU_MODEL The model for the haiku short name and for background tasks.
CLAUDE_CODE_SUBAGENT_MODEL The model for subagents that have no other model set.

The values are catalogue ids, with the slash. The last four come from the Claude Code documentation. An example:

export ANTHROPIC_MODEL="moonshotai/kimi-k2.7-code"
export ANTHROPIC_DEFAULT_SONNET_MODEL="moonshotai/kimi-k2.7-code"
export ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-ai/deepseek-v4-pro"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-ai/deepseek-v4-flash"

Checking

/status shows the session model. If it shows a Claude Code name instead of the catalogue id, ANTHROPIC_MODEL is missing or the terminal did not read it. Open a new terminal and start Claude Code again.

Want to see the price first? GET /v1/models?type=text&q=kimi returns the model with its pricing. Listing the models spends no credits.

Want to code with AI in Claude Code? Visit the Coding with AI page.

See Coding with AI

SEE ALSO

Using Claude Code with All in One AI: the variables, the model and common errors

The model for background tasks in Claude Code: ANTHROPIC_DEFAULT_HAIKU_MODEL

Changing the model during a Claude Code session with /model

Coding Plan: which plan to choose, what it costs and how to subscribe

Coding with AI in All in One AI

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from 396,00 MT/mo (3-year plan, with coupon)

See plans
Was this answer helpful? Your answer helps us improve this article.