Skip to content
BENIBIX Learn

model Option

Also known as Agent SDK model, setModel(), Claude Agent SDK model

The option that picks which Claude model runs your agent.

Think of it like

It is like picking which cook makes your meal today.

Example

Zoe's agent sorts support tickets all day. She sets model to a small, fast model, and keeps the big one for the hard tickets.

Why it matters

The model sets the speed, the cost and how well the agent copes with hard jobs.

Definition

model is the Agent SDK option that picks which Claude model runs the agent. You give it a short alias, such as sonnet, or a full model name. If you leave it out, the agent uses the same default that Claude Code would use. In streaming input mode you can switch models in the middle of a session with setModel(). Subagents can use a different model from the main agent.

Example code

typescript
model: "sonnet"
Run this agent on the Sonnet model.
model picks the main model. fallbackModel is only used if it fails.

Common mistake

Leaving it out and expecting the same model forever. The default can change when Claude Code updates.

Key takeaways

  1. 1
    Alias or full name. sonnet, or a pinned ID.
  2. 2
    Default from the CLI. When left out.
  3. 3
    Switch mid-session. With setModel().