Prices and model details on this page may have changed. For current rates, see the OpenLux pricing page.

Home / claude-opus-5

claude-opus-5 400 error after turning thinking off: what the API accepts and how to fix it

If a claude-opus-5 request returns 400 after you add thinking: {"type": "disabled"}, look at the effort level first. Anthropic's thinking documentation says Claude Opus 5 has thinking on by default and accepts "disabled" only at effort high or below; combining it with effort xhigh or max returns a 400 error. The other common causes on this model are leftover extended thinking code (thinking type enabled with budget_tokens), the between_tools value that only Claude Sonnet 5.5 accepts, and sampling parameters such as temperature and top_p. This page lists what claude-opus-5 accepts, the fix for each 400, what changes when thinking stays off, and how to confirm the request works. Everything below comes from Anthropic's official Claude API documentation for the Messages API format.

Which thinking settings does claude-opus-5 accept?

Anthropic's thinking documentation has a per-model table of what each thinking value does. For Claude Opus 5 it reads: no thinking field runs adaptive thinking; thinking type adaptive runs adaptive thinking; thinking type enabled with budget_tokens returns a 400 error; thinking type between_tools returns a 400 error; thinking type disabled turns thinking off at effort high or below.

Effort is set separately, in output_config.effort, not inside the thinking object. According to the effort documentation, Claude Opus 5 supports all five levels: low, medium, high, xhigh and max. The model page lists high as the default effort on the Claude API, so a request that leaves out effort runs at high. The effort documentation also warns not to pass adaptive as an effort value, because adaptive is a thinking mode, not an effort level.

Anthropic marks Claude Opus 5 as a legacy model (released July 24, 2026, retirement not sooner than July 24, 2027) and recommends Claude Opus 5.5 for new work. If you stay on claude-opus-5, the rules on this page apply. If you are moving to claude-opus-5-5, the rules are different: Opus 5.5 rejects thinking type disabled at every effort level, so check the migration guide instead.

thinking disabled with effort xhigh or max: why it returns 400 and how to fix it

The Claude Opus 5 launch note in Anthropic's release notes calls this a breaking change from Claude Opus 4.8: on Opus 5, disabling thinking is allowed only at effort high or below, and thinking type disabled with effort xhigh or max returns a 400 error. The thinking documentation adds that this restriction is enforced on each request. Code that ran on claude-opus-4-8 with thinking disabled and a high effort level such as xhigh can therefore start failing as soon as the model name changes to claude-opus-5.

The troubleshooting page gives two fixes. Option one: keep thinking type disabled and lower output_config.effort to high, medium or low. Option two: keep effort at xhigh or max and set thinking to {"type": "adaptive"}, or simply remove the thinking field, because adaptive thinking is the default on this model.

Anthropic's documentation does not quote the exact error message for this combination on Claude Opus 5, so identify it by the request itself: model claude-opus-5, thinking type disabled, and output_config.effort set to xhigh or max. If all three are present, this is the cause.

If you keep xhigh or max with thinking on, the effort documentation recommends a large max_tokens so the model has room to think and act across tool calls; it suggests starting at 64k tokens and tuning from there.

thinking.type.enabled and between_tools are not supported for this model

Code written for older Claude models often sends thinking type enabled with budget_tokens. The troubleshooting page says Claude 4.7 and later models do not support extended thinking and reject it with a 400 error whose message reads: "thinking.type.enabled" is not supported for this model. Use "thinking.type.adaptive" and "output_config.effort" to control thinking behavior. Claude Opus 5 is in that group. The fix is to switch to thinking type adaptive (or omit thinking) and control depth with output_config.effort instead of budget_tokens.

The between_tools value is the Claude Sonnet 5.5 setting for turning off up-front thinking. The troubleshooting page says only Claude Sonnet 5.5 accepts it; other models return a 400 error with the message "thinking.type.between_tools" is not supported for this model. On claude-opus-5, use thinking type disabled at effort high or below if you want thinking off, or omit thinking.

If you call Anthropic directly, the Models API reports capabilities.thinking.types.disabled.supported for each model. The models overview notes that even when supported is true, the API can still reject a disabled request for another reason, such as an effort level the model does not allow with thinking off. For claude-opus-5, that is exactly the xhigh and max case, so a true value does not mean every combination is allowed.

400 errors that look like thinking errors: temperature, top_p, top_k and prefill

Not every 400 near a thinking change is about thinking. The thinking documentation says that on Claude Opus 5 (and the other recent models it lists), non-default temperature, top_p or top_k values return a 400 error on every request, whether or not thinking is used. The default top_p on these models is 0.99, so top_p 1 returns a 400, and so does a request that includes both temperature and top_p even at their defaults. Starting with API version 2026-10-21, a request that includes temperature, top_p or top_k at any value returns a 400 on every model. The fix is to remove these parameters from the request and from any client or framework settings that add them.

Prefill is another one: the same page says Claude 4.6 and later models reject a prefilled final assistant turn with a 400 error, whether or not thinking is on. Remove the trailing assistant message and put the format instruction in the prompt instead.

Forced tool use is different on Opus 5 than on Opus 5.5. The documentation lists Claude Opus 5.5, Claude Sonnet 5.5, Claude Fable 5.1 and Claude Mythos 5.1 as the models that reject tool_choice any or tool on every request. Claude Opus 5 is not on that list, and forced tool use works with adaptive thinking, so the documentation does not list tool_choice any or tool as a cause of a claude-opus-5 400.

If you keep thinking off: tool calls in text and leaked XML tags

Anthropic's Prompting Claude Opus 5 guide describes two artifacts that can occasionally appear when thinking is disabled. First, the model may write a tool call into its visible text instead of returning a tool_use block; the call never runs, and in agent loops the leaked text stays in the history and affects later turns. This is most common on tool-heavy workloads such as search. Second, the model may emit thinking tags or other internal XML tags in its response.

The guide's primary recommendation is to keep thinking enabled and control cost with a lower effort level: for most tasks, thinking enabled at low effort performs better than thinking disabled at similar cost. It also says to remove system prompt rules that tell the model not to think or not to reason, because those rules increase tag leakage.

If your integration must keep thinking disabled, the guide gives one combined instruction to add to the system prompt: When you use a tool, you may say a brief sentence first. If no tool can express what the user asked for, say so instead of guessing. Do not include internal or system XML tags in your response. The guide notes that naming thinking tags specifically is less effective than this general wording.

Reply cut off or cache hits dropped after changing thinking settings

If the response ends with stop_reason max_tokens and a short or missing text block, the troubleshooting page explains that thinking tokens count toward max_tokens, so a long thinking pass can use up the budget before the text is finished. Raise max_tokens, or lower effort so less is spent on thinking. Keep this in mind when you move from thinking disabled to adaptive thinking at xhigh or max, where the effort documentation suggests starting max_tokens at 64k.

If cache_read_input_tokens drops to zero after the change, the troubleshooting page explains why: the thinking configuration and the effort level are part of the cached prompt prefix, so switching thinking modes or changing effort starts a new prefix. Keep both constant across requests in the same conversation. The documentation notes that setting a parameter explicitly to its default is the same as omitting it and does not invalidate the cache.

How to verify the fix through an Anthropic-compatible relay

Step 1, check the connection. For the Anthropic Messages format on OpenLux, the base URL is https://api.openlux.ai without /v1, and your client appends /v1/messages. The key goes in x-api-key or Authorization: Bearer. Create the key on the Tokens page of the OpenLux console. A GET to https://api.openlux.ai/v1/models with the header Authorization: Bearer and your key that lists models confirms the key and address are right. A 401 Invalid token means the key is wrong or missing; a 404 Invalid URL (POST /v1/v1/messages) means the base URL has an extra /v1.

Step 2, test thinking off. Send a minimal Messages request with model claude-opus-5, a max_tokens value, thinking {"type": "disabled"} and output_config {"effort": "high"}, with no temperature, top_p, top_k or prefill. Success means an HTTP 200 response with a text content block instead of a 400.

Step 3, test high effort. Send the same request with effort xhigh and no thinking field (or thinking type adaptive), and a larger max_tokens. This should also return 200. If you change only the thinking field back to disabled while keeping xhigh, the 400 should come back, which confirms the effort rule was the cause.

If a request that matches the rules above still returns 400 through a relay, compare the request body your code actually sends with the documented fields, then send the error message and request id to the service provider. Prices are listed on the official pricing page; check it before running long xhigh or max workloads.

Still stuck? Full documentation and support are at learn more.

More on this site

Get started

Check the live pricing response and validate `claude-opus-5` in your environment

Get a free API key

Official site: see the docs

Last updated 2026-10-30 | Written and maintained by OpenLux.
Latency and pricing figures come from our own measurements. Where they differ from the vendor's site, the vendor's live page wins.