Anthropic Deprecates Temperature, Top_P, and Top_K on Newer Opus Models
Anthropic has officially deprecated the use of custom temperature, top_p, and top_k values on Claude Opus 4.7 and later models, including Opus 4.8.
Starting with these newer versions, setting any of these sampling parameters to non-default values now returns a 400 error. The change is part of Anthropic’s broader effort to simplify model behavior and push developers toward prompt-based control.
Key Details
- Affected models: Claude Opus 4.7 and all subsequent Opus versions (including the current
claude-opus-4-8) - What happens: Requests that include non-default values for
temperature,top_p, ortop_kwill fail with a 400 error - Recommended approach: Omit these parameters entirely from API requests and control output behavior through prompting instead
Official Guidance
From Anthropic’s Model Deprecations page:
temperature,top_p,top_k— Deprecated (Claude Opus 4.7 and later)
Returns 400 error if set to non-default value on Claude Opus 4.7 and later (including 4.8).
Recommended: Omit and use prompt engineering.
From the Migration Guide:
“Setting temperature, top_p, or top_k to any non-default value on Claude Opus 4.7 returns a 400 error. The safest migration path is to omit these parameters entirely from request payloads.”
Official sources:
- Model Deprecations page: https://platform.claude.com/docs/en/about-claude/model-deprecations
- Migration Guide: https://platform.claude.com/docs/en/about-claude/models/migration-guide
What Developers Should Do
Teams migrating to Opus 4.7 or Opus 4.8 should remove these three parameters from their API calls. Anthropic states that the safest and cleanest approach is to rely on well-crafted system prompts and user instructions to guide model behavior instead of traditional sampling tweaks.
This change aligns with other recent updates (such as the shift to adaptive thinking and the new effort parameter) that give Anthropic more direct control over how the model reasons and responds.
Developers still using older Opus versions should plan to update their code as part of any migration to the current 4.8 generation.