TL;DR
Call Claude Opus 4.8 with model ID claude-opus-4-8. Migration is mostly swapping that string — but re-test prompts, outputs and cost. Output tokens are the expensive side, so judge cost by task success rate, not just unit price.
Everything a developer needs to start with Claude Opus 4.8: the model ID, pricing, a minimal request, a migration checklist and the mistakes that trip people up.
Verify this
Quick API facts
Model ID
claude-opus-4-8
Context window
1M tokens
Input price
$5 / 1M input tokens
Output price
$25 / 1M output tokens
Claude Opus 4.8 model ID
Set the model field to claude-opus-4-8. That single string is what routes your request to this version.
Pricing
The cost that actually matters
effective cost ≈ tokens × unit price × retries ÷ success rate
Output is the expensive side, so a model that gets a long task right on the first try can be cheaper overall than a "cheaper" model you have to re-run three times.
Our take
Basic API usage example
The standard Messages API shape — Python first, then cURL:
import anthropic
client = anthropic.Anthropic() # reads ANTHROPIC_API_KEY from env
msg = client.messages.create(
model="claude-opus-4-8",
max_tokens=1024,
messages=[
{"role": "user", "content": "Explain what changed in this diff."},
],
)
print(msg.content[0].text)curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-opus-4-8",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello, Opus"}]
}'Verify this
anthropic-version header and the response shape in the official quickstart before relying on this in production.Migration checklist
- 1
Swap the model ID
APIChangeclaude-opus-4-7→claude-opus-4-8in one place (centralize it if you haven't). - 2
Re-run your prompt suite
EvalRun your saved prompts/evals and diff outputs against the old version — format, tone and structure can shift. - 3
Check tool-use & JSON outputs
AgentsIf you use tools or structured outputs, verify schemas still validate and tool calls still fire as expected. - 4
Compare cost on a sample
CostMeasure tokens and effective cost on a representative batch, including any change in retries. - 5
Roll out behind a flag
ShipShip to a fraction of traffic first; keep a one-line rollback to the previous model ID.
Common mistakes
- Hard-coding the model ID everywhere. Keep it in one constant so the next migration is trivial.
- Skipping the eval pass. "It's the same family" still changes outputs — diff before you trust it.
- Pricing on unit rate only. Ignoring retries and success rate hides the real cost.
- Maxing effort on everything. Use effort control deliberately — high effort on trivial tasks just burns budget.
When to use Opus instead of cheaper models
Our take