Model choice is the single biggest cost and capability lever in a Claude integration — the spread between Claude Haiku 4.5 ($1 input / $5 output per million tokens) and Claude Fable 5 ($10 / $50) is an order of magnitude. The ant CLI makes experimenting with that lever a command-line flag rather than a code change.
Discovering what's available
The Claude API has a Models API for exactly this: it returns each model's metadata, including max_input_tokens, max_tokens, and a capabilities object describing what the model supports. Because the ant CLI exposes every API resource as a subcommand (the pattern is ant <resource> <action>), the models resource is queryable from the terminal — run ant --help to see the resource list and --help on the models subcommand for its exact actions and flags. Combined with --transform (GJSON field extraction) and --format json, that gives your scripts a live inventory of model IDs and limits instead of a hardcoded list.
One platform note: the Models API is available on the first-party Claude API and on Claude Platform on AWS, but not on Bedrock, Vertex AI, or Foundry — on those platforms, consult the cloud provider's own model catalog. The ant CLI itself talks to the Claude API surface.
Switching models per call
Every ant messages create takes the model as a flag, so comparing models is just re-running a command:
ant messages create --model claude-opus-4-8 --max-tokens 1024 \
--message '{role: user, content: "Hello, Claude"}'
Swap claude-opus-4-8 for claude-sonnet-5, claude-haiku-4-5, or claude-fable-5 and nothing else changes. In a Makefile or script, promote the flag to a variable (--model "$MODEL") and you can sweep a prompt across the lineup in a loop — the same prompt file via @file each time, so the only variable is the model.
Reading model IDs correctly
Two ID conventions coexist. Starting with the Claude 4.6 generation, IDs are dateless (claude-opus-4-8, claude-sonnet-5, claude-fable-5) but are still pinned snapshots — a dateless ID does not silently become a newer model. Pre-4.6 models use dated IDs with convenience aliases: claude-haiku-4-5 is an alias resolving to claude-haiku-4-5-20251001. And this is the Claude API's naming; only Bedrock prefixes IDs with anthropic., and Google Cloud uses @date suffixes for older models. Claude Platform on AWS uses the same bare IDs as the first-party API.
| Model | ID (Claude API / ant CLI) | Context | List price in / out per MTok |
|---|---|---|---|
| Claude Fable 5 | claude-fable-5 | 1M | $10 / $50 |
| Claude Opus 4.8 | claude-opus-4-8 | 1M | $5 / $25 |
| Claude Sonnet 5 | claude-sonnet-5 | 1M | $3 / $15 ($2 / $10 intro through Aug 31, 2026) |
| Claude Haiku 4.5 | claude-haiku-4-5 | 200K | $1 / $5 |
Gotchas when hopping between models
Model switching is not always free of side effects. Changing the model string invalidates any existing prompt cache — the first request on the new model writes the cache fresh, so a cost comparison run immediately after switching will look worse than steady state. Capabilities differ too: newer models reject parameters older ones accepted (for example, manual extended thinking and non-default temperature return 400 errors on Sonnet 5 and Opus 4.7+), so a prompt that runs on Haiku 4.5 may need request tweaks on Fable 5 and vice versa. When a sweep fails on one model only, add --debug to see the exact request and the API's error body before assuming the model is at fault.
Finally, keep deprecations on your radar: retired model IDs return 404s, and the models overview documents migration targets. A CLI check of the models list is a cheap CI guard against shipping a soon-to-retire ID.
Where to go next
Wire model choice into scripts with scripting with the ant CLI, and see the platform overview for how model IDs differ on Bedrock, Vertex AI, and Foundry.