- Symptom
- 400 invalid_request_error naming temperature, top_p, or top_kTypeError from client.messages.create when temperature is passed (anthropic Python SDK 1.0 and later)temperature=0 kept for determinism breaks the request after a model upgrade
- Cause
- Any non-default temperature, top_p, or top_k is rejected on Opus 4.7 and later and on Haiku 5.5, and the Python SDK from 1.0 no longer defines these arguments at all. Haiku 5.5 accepts only the defaults, temperature 1 or top_p 0.99, and never both.
- Fix
- Delete temperature, top_p, and top_k from every request and steer behavior through the prompt. Note that temperature 0 never guaranteed identical outputs anyway.
- Apply
params = {k: v for k, v in params.items() if k not in ("temperature", "top_p", "top_k")} msg = client.messages.create(**params)- Affected
- Claude Opus 4.7, 4.8, 5, 5.5, Fable 5 and 5.1, Haiku 5.5; anthropic Python SDK 1.0 and later; as of 2026-10
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders