Skip to content
Sign Up Free
Claude Code

How to switch Sonnet and Opus in Claude Code

Understand /model, model aliases, full model IDs, provider differences, and cost impact in Claude Code. Covers setup, expected behavior, and common fixes.

Short answer

When switching Sonnet, Opus, or another model in Claude Code, prefer the supported /model entry point or the official model configuration path.

Model aliases, full model IDs, and provider mappings are not always identical. A marketing name shown in a web UI is not always the API-recognized model ID.

If you use a third-party gateway, use the model ID shown by that gateway or provider documentation.

When this matters

  • You want to switch between cheaper and stronger models
  • You see Sonnet / Opus / Haiku aliases but do not know what to enter
  • You use a third-party Base URL or model gateway
  • You want to control Claude Code token cost
  • You see model not found or model selection does not take effect

Three layers of model names

LayerMeaning
Display nameHuman-friendly name shown in a UI
AliasShort name or shortcut inside a tool
Model IDThe identifier actually recognized by the API

What matters for a successful request is whether the current provider recognizes the Model ID.

  1. Confirm which models the current provider supports.
  2. Use Claude Code /model or the official model configuration path.
  3. If you use a third-party gateway, copy the available model ID from its model plaza.
  4. Consider model choice and cost together.
  5. Do not guess model names by hand.

About BetterToken

Copy the exact Model ID from the model plaza. Update the Model ID in your configuration and restart Claude Code. To switch during a session, use /model YOUR_MODEL_ID.

Model choice affects quality, speed, and cost. Usage records help you compare actual consumption across models.

References