Claude Haiku 5.5 400 Error Fix: Working Request Examples
Fix Claude Haiku 5.5 400 errors after migrating from Haiku 4.5: sampling params, prefill, computer_20250124, and thinking block failures, with examples.

Most Claude Haiku 5.5 400 errors come from request fields that Claude Haiku 4.5 accepted but Haiku 5.5 rejects: temperature, top_p, top_k, manual extended thinking (budget_tokens), and assistant message prefills. Computer use is the other big one, because computer_20250124 now returns a 400 error and the toolset was renamed. Remove or replace the offending field and the same request succeeds.
The errors are the API telling you a parameter is gone, not that your prompt is bad. Below is every 400 pattern the release notes document for Haiku 5.5, the fix for each, and copy-paste requests that work.
The exact errors you will see#
A rejected request fails fast with a 400 and an invalid_request_error body. Depending on your SDK it surfaces like this:
anthropic.BadRequestError: 400 Bad Request
{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "temperature is not supported for this model"
}
}
The message string names the rejected field (temperature, top_p, top_k, thinking, and so on). Haiku 5.5 uses adaptive thinking with the effort parameter instead of sampling knobs, and the model decides on its own when to think. Fields tied to the old manual thinking model, including assistant prefills, are rejected outright rather than silently ignored.
Remove temperature, top_p, and top_k#
Haiku 4.5 let you steer randomness with sampling parameters. Haiku 5.5 returns a 400 for each of them. The fix is deletion, not tuning: drop all three from the request body.
import json
# Request body carried over from a Haiku 4.5 integration
legacy = {
"model": "claude-haiku-5-5",
"max_tokens": 1024,
"temperature": 0.2,
"top_p": 0.9,
"top_k": 40,
"messages": [{"role": "user", "content": "Classify this ticket: billing issue"}],
}
REMOVED = {"temperature", "top_p", "top_k"}
fixed = {k: v for k, v in legacy.items() if k not in REMOVED}
print("dropped:", sorted(REMOVED & legacy.keys()))
print(json.dumps(fixed, indent=2))
If you were using temperature: 0 to pin extraction or classification output, replace it with a tighter prompt: state the output format, give one labeled example, and say what to do with edge cases. To trade latency against reasoning depth instead, use the effort parameter, which Haiku 5.5 supports along with adaptive thinking.
Drop manual extended thinking and budget_tokens#
Manual extended thinking with budget_tokens returns a 400 on Haiku 5.5. Adaptive thinking is on by default, so there is nothing to enable and no budget to set. Delete the whole thinking block:
{
"thinking": {
"type": "enabled",
"budget_tokens": 1024
}
}
Two behaviors replace it. Effort controls how much the model thinks; the model overview lists medium as the Haiku 5.5 default. And because adaptive thinking is on, a response can begin with thinking blocks. Their text is omitted unless you set thinking.display to "summarized", and the same text counts as more tokens, so budget for extra output tokens if you turn summaries on.
One clarification if you also run Sonnet 5.5: that model accepts thinking: {"type": "between_tools"} to turn off up-front thinking, but the release notes do not list between_tools among the Haiku 5.5 changes, so don't transplant it there. An optional runnable check below shows how the capability readout differs per model in shape; treat the values as illustrative until you query your own account.
import json
capabilities = {
"claude-haiku-5-5": {
"thinking": {"adaptive": True, "manual_budget_tokens": False},
"sampling_params": False,
"assistant_prefill": False,
},
"claude-haiku-4-5": {
"thinking": {"adaptive": False, "manual_budget_tokens": True},
"sampling_params": True,
"assistant_prefill": True,
},
}
for model, caps in capabilities.items():
print(model, "->", json.dumps(caps))
Stop using assistant prefills#
An assistant prefill is a trailing role: "assistant" message you append to force the start of the reply. Haiku 5.5 returns a 400 for it. Move whatever the prefill was doing into the user turn or the system prompt. JSON forced with a prefill is a good case for structured outputs, which the release notes confirm for Haiku 4.5 and which work with the current model line as well.
# Before: rejected on Haiku 5.5
messages = [
{"role": "user", "content": "Extract the order id."},
{"role": "assistant", "content": '{"order_id": '},
]
# After: same intent, no prefill
messages = [
{
"role": "user",
"content": 'Extract the order id. Reply as JSON beginning with the key "order_id".',
},
]
How to confirm: the request returns 200 and the response starts with a thinking block or text rather than an error. If output still wanders, tighten the prompt or switch to structured outputs instead of reaching for the prefill again.
Replace computer_20250124 with the new computer use toolset#
computer_20250124 returns a 400 on Haiku 5.5. The replacement depends on where you call the API:
| Platform | Use instead |
|---|---|
| Claude API | computer_toolset_20260801 |
| Google Cloud | computer_toolset_20260801 |
| Amazon Bedrock | computer_20251124 |
A minimal tool definition on the Claude API:
{
"tools": [
{
"type": "computer_toolset_20260801",
"name": "computer"
}
]
}
The rename is easy to miss in a shared tool registry, and Bedrock deployments keep a different ID from the Claude API, so a config that works in one place 400s in the other. If you drive a desktop or browser yourself, the Python and TypeScript SDKs ship beta classes for the computer use and browser use tools: you subclass one, write one method per tool against your own automation, and the SDK runs the tool loop plus your URL, file, and approval policies.
Fix 400s caused by thinking blocks in history#
Thinking blocks are bound to the model and the conversation. If you store assistant history and replay it, a request that sends thinking blocks back after a change to system, tools, or earlier turns can return a 400. Typical triggers:
- rotating the system prompt between turns,
- adding, removing, or reordering tool definitions mid-conversation,
- editing an earlier user or tool_result message.
The safest fix is to strip thinking blocks from stored history before sending the next request; keep tool_use and tool_result pairs intact so the conversation stays coherent. If you need to change tools without touching history, the September 22 release notes describe defining tools inside a mid-conversation system message (beta, inline-tools-2026-09-15 header on the Claude API), which lets you add a tool or move a server tool to a newer version without invalidating the prompt cache. Confirm the fix by resending the failing request with cleaned history and watching for a 200.
Common mistakes that still trigger 400s#
- Leaving
temperaturein a shared request builder. One helper used by ten services keeps failing everywhere until the field is deleted at the builder, not per call site. - Gating cleanup on model name but missing aliases. The Claude API ID is
claude-haiku-5-5per the model overview; Bedrock usesanthropic.claude-haiku-5-5. Match on a prefix, not one exact string. - Sending
thinking: {"type": "disabled"}to switch adaptive thinking off. That is not listed as accepted for Haiku 5.5; use effort for control instead. - Shipping the Claude API toolset ID to Bedrock. Bedrock wants
computer_20251124. - Forgetting that thinking summaries cost tokens. Setting
thinking.displayto"summarized"makes the text visible and billable as output. - Changing the system prompt every request for per-turn instructions, which risks the preserved-thinking 400 and busts the prompt cache. Turn-scoped system messages with
clear_at: "next_user_message"(beta,mid-conversation-system-clear-at-2026-08-21header) render for the current turn only and stay in history at no token cost.
Quick checklist before you ship#
- Removed
temperature,top_p,top_kfrom every Haiku 5.5 request path. - Deleted
thinkingblocks withbudget_tokens; using effort where depth control is needed. - No trailing assistant message in
messages. - Computer use uses
computer_toolset_20260801on the Claude API and Google Cloud,computer_20251124on Bedrock. - History replay strips thinking blocks whenever system, tools, or earlier turns changed since they were produced.
- Set
thinking.displayto"summarized"only when you want the reasoning text, and budget for its tokens. - Confirmed a 200 in staging with a real stored conversation, not just a fresh two-message request.
Once requests are green, revisit prompts: the release notes point to a prompting page for Haiku 5.5 patterns, and Haiku 5.5 pricing starts at $0.10 per million input tokens, so clean requests at volume stay cheap.
Quick answers
Why does temperature return a 400 error on Claude Haiku 5.5?
Haiku 5.5 rejects the sampling parameters temperature, top_p, and top_k with a 400 error. It uses adaptive thinking with the effort parameter instead, so remove those fields from the request body.
Is assistant prefill supported on Claude Haiku 5.5?
No. A trailing assistant message returns a 400 error. Move the steering text into the user message or system prompt, or use structured outputs for strict formats.
What replaces computer_20250124 on Claude Haiku 5.5?
Use the computer_toolset_20260801 toolset on the Claude API and Google Cloud, or computer_20251124 on Amazon Bedrock. The old tool ID returns a 400 error.
Can I disable thinking on Claude Haiku 5.5?
Adaptive thinking is on by default and the release notes do not list a disabled option for Haiku 5.5. Control thinking depth with the effort parameter, which defaults to medium on this model.
Why do requests with old thinking blocks fail after I change my tools?
Thinking blocks are tied to the model and the conversation. Sending them back after system, tools, or earlier turns changed can return a 400 error. Strip thinking blocks from history before the next request.
Did this solve it?
One tap. No account.
Sorry about that. What was missing?
from 0 readers
Saved you an hour? Send a tip.
USDC or ETH on Base, Ethereum, Arbitrum and more. Keeps the notes free and the examples running.
Network
0xc783bc5c3fa14cEC3f09A22284bC91C5AF0d59e1
On a computer? Scan the code with your phone wallet, or copy the address.
Pick the network your wallet or exchange uses. USDC works on all six; ETH on Base, Ethereum, Arbitrum and Optimism. Don't send on Tron or Solana: this address doesn't exist there. Tips are optional and unlock nothing; every guide stays free.
Discussion
Start the discussion
Next note