temperature, top_p and top_k rejected on Claude Opus 4.7 and later
Setting any sampling parameter to a non-default value now returns a 400 on Opus 4.7 and every model after it. Steer with prompting instead.
What does this mean for me?
Action needed
Engineering leadership
Cost, risk, timeline, team impact Action neededAny service still setting `temperature`, `top_p` or `top_k` will break at runtime the first time it calls Opus 4.7 or newer — types still compile, so CI will not catch it. Budget a short audit sweep across every codebase and prompt template before your next model upgrade.
Engineer
What to change, what breaks, what to test Action neededGrep for `temperature`, `top_p` and `top_k` and remove any non-default values; they return 400 on Opus 4.7, Opus 4.8, Opus 5, Sonnet 5 and Fable 5. Replace `temperature: 0` determinism with a lower `effort` level plus a tighter, more specific prompt.
General consumer
Using the Claude apps, not the API No impactNothing to do — these are developer settings that were never exposed in the Claude apps.
temperature, top_p, and top_k are deprecated as of Claude Opus 4.7.
Setting any of them to a non-default value returns a 400 error on Opus 4.7
and every model released since. Omitting the parameter, or passing its
default, still works — so the failure surfaces only in code that actually
tuned sampling.
The parameters remain in the SDK request types so existing code continues to type-check. This is worth emphasizing: the compiler will not catch this one. It fails at runtime, on the first request.
The replacement is prompting. Two common intents and where they land:
- Determinism (
temperature: 0) — use a lowereffortlevel and a tighter prompt. Note thattemperature: 0never guaranteed identical outputs on prior models either. - Creative variance — instruct it directly in the prompt. For design and frontend work, asking the model to propose several distinct directions before building produces more real variety than sampling noise did.
Date is approximate. Anthropic’s parameter-deprecation table states the affected models but not an announcement date. This entry is dated to Claude Opus 4.7’s inferred release, derived from its “not sooner than April 16, 2027” retirement floor and Anthropic’s one-year minimum-lifetime pattern. The substance is sourced; the date is inferred.
API surface
| Parameter | Change | Breaking | Models |
|---|---|---|---|
temperature | removed | yes | claude-opus-4-7 claude-opus-4-8 claude-opus-5 claude-sonnet-5 claude-fable-5 |
top_p | removed | yes | claude-opus-4-7 claude-opus-4-8 claude-opus-5 claude-sonnet-5 claude-fable-5 |
top_k | removed | yes | claude-opus-4-7 claude-opus-4-8 claude-opus-5 claude-sonnet-5 claude-fable-5 |
Terms on this page: Deprecation, Retirement