How do I fix Claude HTTP 400 errors about temperature?
Fix Claude errors about unsupported temperature, top_p, or top_k values. Remove sampling fields and check defaults added by clients, SDKs, and health checks.
What does the error mean?
A Claude request can return an error such as:
HTTP 400: claude-haiku-5-5 does not support non-default temperatureThe error may also name top_p or top_k. These sampling parameters control randomness or the range of candidate tokens. The supplied settings are incompatible with the model or API version.
Remove temperature, top_p, and top_k from the request. Do not just reset the temperature to its default.
Why does it happen?
- Model restrictions: Newer models, including Claude Haiku 5.5, reject non-default sampling values, even with thinking off. See the official sampling rules.
- API version restrictions: Anthropic Messages API version
2026-10-21and later reject these fields at any value, includingtemperature: 1.0. See the official migration guide.
The rules depend on the model and API; there is no universal temperature setting. For OpenAI-compatible calls, remove unsupported fields too. Do not add or change anthropic-version to fix this error.
How to fix it
- Disable custom sampling in your model or provider settings, or delete the three fields from your request JSON. Sending
null, an empty string, or a default number does not omit a field. - Check SDK wrappers, global defaults, model presets, and health-check scripts. Inspect the actual outgoing request body, not just the settings screen.
- If your client requires these fields, update it or use a configuration that can omit them. In multi-model applications, adjust only affected requests.
- Save and send a short text test. Tests are billed by actual usage. Do not repeatedly retry the same invalid parameters.
Request body example
This body omits sampling fields. Replace the message with your task and retain the Base URL and authentication for your API.
{ "model": "claude-haiku-5-5", "max_tokens": 4096, "messages": [ {"role": "user", "content": "Reply with only: OK"} ]}- Anthropic Messages: Use Base URL
https://bettertoken.ai, request path/v1/messages, and your BetterToken API Key inx-api-key. - OpenAI Chat Completions: Use Base URL
https://bettertoken.ai/v1, request path/chat/completions, andAuthorization: Bearer <BETTERTOKEN_API_KEY>.
Make sure shared configuration does not add sampling fields back. Describe the desired format, length, and tone in your prompt.
Still getting an error?
Read the full new error and check whether it names the same parameter. Send support the Model ID, client and version, endpoint path, time with time zone, request ID if available, and sanitized request fields. Do not send your BetterToken API Key, authentication headers, or private conversations.

