Short Answer
This is Claude Code’s own cost-saving mechanism, not the gateway swapping your model. Theclaude-opus-5 you configured in Claude Code only drives the main conversation. Small background tasks such as generating session titles and detecting topics, plus built-in subagents like Explore, run on the cheaper Haiku model by default (for example claude-haiku-4-5-20251001), so your logs show both models.
If you want every request to use Opus, force it with environment variables — see Force Everything onto Opus below.
How to Recognize Them in the Logs
In the console’s usage logs, these Haiku requests usually have three traits:- Same token and group as your Opus requests: same key, same
ClaudeCodegroup, which means they come from the same Claude Code client - Very few tokens and a tiny cost per call: often just tens to a few hundred tokens, in clear contrast to main-conversation Opus requests that run into thousands or tens of thousands
- They arrive in bursts that follow your actions: starting a new session, asking Claude Code to search the codebase, or dispatching subtasks
The model name is exactly what the client sent. APIYI routes and bills by the
model field in the request. If you see Haiku in the logs, Claude Code asked for Haiku — those calls are billed at Haiku pricing, never at Opus pricing.Why Claude Code Does This
Claude Code has a built-in two-tier split between a large and a small model:
Background tasks and code search don’t need much model capability but run often, so Haiku cuts the overall bill noticeably and is faster too. For most people the default is the right choice.
Force Everything onto Opus
If you want every request on Opus (for example, you want higher-quality subagent searches), point every tier at the same Opus model in theenv block of ~/.claude/settings.json:
claude-opus-5-5.
FAQ
Could the Haiku requests mean my key leaked and someone else is using it?
Could the Haiku requests mean my key leaked and someone else is using it?
Check the token, IP and timeline. If the Haiku requests use the same token as your Opus requests, come from the same IP and line up with your own activity, they came from your own Claude Code. If you see unfamiliar IPs or heavy usage at times you weren’t working, treat it as a key leak — see Token Management.
I switched to Opus with /model. Why is Haiku still there?
I switched to Opus with /model. Why is Haiku still there?
/model only switches the main conversation model. It doesn’t change the model used by background helpers and subagents. To change those too, set ANTHROPIC_DEFAULT_HAIKU_MODEL and CLAUDE_CODE_SUBAGENT_MODEL as shown above.How do I change this in tools like CC Switch?
How do I change this in tools like CC Switch?
Tools like CC Switch also just write Claude Code’s environment variables. Set the variables above to
claude-opus-5-5 in the relevant provider profile — see CC Switch Setup.Related Docs
Claude Code Setup Guide
Installation, APIYI configuration and common issues
Codex, ClaudeCode and Default Groups
Which token group to use for Claude Code