[DOCS] Conflicting info on `temperature` and `top_p` mutual exclusivity for Claude 4.5 models
Documentation Type
Unclear/confusing documentation
Documentation Location
- https://platform.claude.com/docs/en/about-claude/models/migrating-to-claude-4 - https://platform.claude.com/docs/en/api/openai-sdk - https://platform.claude.com/docs/en/api/messages
Section/Topic
- Migration Guide: "Migrating from Claude Sonnet 3.7 to Claude Sonnet 4.5" -> Step 2: Update sampling parameters. - OpenAI SDK compatibility: "Detailed OpenAI Compatible API Support" -> Request fields. - Messages API Reference: "Body Parameters" ->
temperatureandtop_pdefinitions.
Current Documentation
The Migration Guide for Claude 4.5 states:
"Use onlytemperatureORtop_p, not both... Before (Claude Sonnet 3.7) - This will error in Sonnet 4.5."
However, the OpenAI SDK compatibility page lists:
| Field | Support status |
|-------|----------------|
| temperature | Between 0 and 1 (inclusive). Values greater than 1 are capped at 1. |
| top_p | Fully supported |
The Messages API reference lists both parameters as "optional" but does not explicitly state that they are mutually exclusive for Claude 4.5 models.
What's Wrong or Missing?
There is a critical contradiction between the Migration Guide and the rest of the documentation regarding Claude 4.5's handling of sampling parameters:
- OpenAI SDK users are at high risk: Most standard OpenAI client implementations (and many community libraries) send default values for both
temperatureandtop_pin every request. Because the compatibility page marks both as "Fully supported" without the Claude 4.5 caveat, users migrating their base URL to Anthropic will face immediate 400 Invalid Request errors that aren't explained on the compatibility page. - API Reference Lack of Detail: The main Messages API reference documentation describes
temperatureandtop_pas independently optional, failing to mention that a combination of the two will trigger a validation error for the latest model family. - Inconsistency: Only the Migration Guide mentions this as a breaking change. Developers who bypass that guide and go straight to the API Reference or the OpenAI Compatibility layer will be misled.
Suggested Improvement
Update the OpenAI SDK compatibility page:
Add a specific note to the temperature and top_p rows:
"Note: For Claude 4.5 models,temperatureandtop_pare mutually exclusive. Providing both will result in an error. This is a common point of failure for clients that provide default values for both fields."
Update the Messages API Reference:
Add a validation rule to the description of both temperature and top_p:
"Note for Claude 4.5: You should altertemperatureortop_p, but not both. Providing both parameters in a single request to Claude 4.5 models will return a 400 error."
Impact
High - Prevents users from using a feature
Additional Context
- Related Documentation: The Model deprecations page and Models overview should also ideally flag this behavioral shift for the 4.5 family to prevent integration friction.
- Example of the issue: A user using a standard
openai-pythonclient against the Anthropic endpoint withmodel="claude-sonnet-4-5"will crash if their client is initialized with standard defaults, even if they didn't explicitly set both values in thecreatecall.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗