litellm - ✅(Solved) Fix [Bug]: Anthropic message transformer always sets effort level to xhigh on all claude models which results in invalid request error [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#27168Fetched 2026-05-06 06:15:51
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×4cross-referenced ×1referenced ×1

Error Message

Claude Code always gets API error in the new release, v1.83.10. API Error: 400 {"error":{"message":"{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"This model API Error: 400 {"error":{"message":"{"type":"error","error":{"type":"invalid_request_error","message":"adaptive After an investigation, it seems that for supporting opus-4.7, the newly introduced function, _translate_legacy_thinking_for_adaptive_model, in litellm/llms/anthropic/experimental_pass_through/messages/transformation.py, always sets effort level to xhigh which results in invalid request error. 3. API Error: 400 returned Error Code: 400 Message: {"type":"error","error":{"type":"invalid_request_error","message":"This model does not support effort level 'xhigh'. Supported levels: high, low, max, medium."},"request_id":"req_011CahfRsaJuspamBxb1zcyb"}

Fix Action

Fix / Workaround

Claude Code always gets API error in the new release, v1.83.10. API Error: 400 {"error":{"message":"{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"This model does not support effort level 'xhigh'. Supported levels: high, low, max, medium.\"},\"request_id\":\"req_011CahKFpUAzcJVuufFxtJyK\"}. Received Model Group=claude-opus-4.6\nAvailable Model Group Fallbacks=None","type":"None","param":"None","code":"400"}} API Error: 400 {"error":{"message":"{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"adaptive thinking is not supported on this model\"},\"request_id\":\"req_011CahftyYjeUQQMbHbZ5QtJ\"}. Received Model Group=claude-haiku-4.5\nAvailable Model Group Fallbacks=None","type":"None","param":"None","code":"400"}} After an investigation, it seems that for supporting opus-4.7, the newly introduced function, _translate_legacy_thinking_for_adaptive_model, in litellm/llms/anthropic/experimental_pass_through/messages/transformation.py, always sets effort level to xhigh which results in invalid request error. It doesn't matter if you have reasoning_effort set in litellm_params. A quick mitigation is to set the followings in litellm_params. "output_config": { "effort": "high" }

PR fix notes

PR #27223: fix(anthropic): cap budget->effort at "high" when model does not support "xhigh"

Description (problem / solution / changelog)

Summary

_translate_legacy_thinking_for_adaptive_model mapped budget_tokens >= 24000 to effort="xhigh" for all adaptive-thinking models. claude-opus-4-6 and claude-sonnet-4-6 support high / medium / low / max but not xhigh, so those requests failed with:

invalid_request_error: This model does not support effort level 'xhigh'.
Supported levels: high, low, max, medium.

Only claude-opus-4-7 (and newer models that opt-in) expose xhigh.

Root cause

The budget → effort table was written when adding claude-opus-4.7 support and assumed all adaptive-thinking models would accept the same effort vocabulary. No per-model gate was applied, so every 4.6 model with budget_tokens >= 24000 (the default for Claude Code extended thinking) hit the 400.

Fix

Use AnthropicConfig._supports_effort_level(model, "xhigh") — the same per-model lookup already used by _validate_effort_for_model — to decide whether "xhigh" is valid for the model. Fall back to "high" otherwise.

# Before
if budget >= 24000:
    effort = "xhigh"

# After
if budget >= 24000:
    effort = (
        "xhigh"
        if AnthropicConfig._supports_effort_level(model, "xhigh")
        else "high"
    )

Fixes #27168

Changed files

  • litellm/llms/anthropic/experimental_pass_through/messages/transformation.py (modified, +9/-1)

Code Example

Request Failed
Error Code: 400
Message: {"type":"error","error":{"type":"invalid_request_error","message":"This model does not support effort level 'xhigh'. Supported levels: high, low, max, medium."},"request_id":"req_011CahfRsaJuspamBxb1zcyb"}
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

Claude Code always gets API error in the new release, v1.83.10. API Error: 400 {"error":{"message":"{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"This model does not support effort level 'xhigh'. Supported levels: high, low, max, medium.\"},\"request_id\":\"req_011CahKFpUAzcJVuufFxtJyK\"}. Received Model Group=claude-opus-4.6\nAvailable Model Group Fallbacks=None","type":"None","param":"None","code":"400"}} API Error: 400 {"error":{"message":"{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"adaptive thinking is not supported on this model\"},\"request_id\":\"req_011CahftyYjeUQQMbHbZ5QtJ\"}. Received Model Group=claude-haiku-4.5\nAvailable Model Group Fallbacks=None","type":"None","param":"None","code":"400"}} After an investigation, it seems that for supporting opus-4.7, the newly introduced function, _translate_legacy_thinking_for_adaptive_model, in litellm/llms/anthropic/experimental_pass_through/messages/transformation.py, always sets effort level to xhigh which results in invalid request error. It doesn't matter if you have reasoning_effort set in litellm_params. A quick mitigation is to set the followings in litellm_params. "output_config": { "effort": "high" }

Steps to Reproduce

  1. launch Claude Code, claude --effort high
  2. send greeting, hello
  3. API Error: 400 returned

Relevant log output

Request Failed
Error Code: 400
Message: {"type":"error","error":{"type":"invalid_request_error","message":"This model does not support effort level 'xhigh'. Supported levels: high, low, max, medium."},"request_id":"req_011CahfRsaJuspamBxb1zcyb"}

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.83.10

Twitter / LinkedIn details

No response

extent analysis

TL;DR

Set the effort level to a supported value, such as "high", in the output_config of litellm_params to mitigate the API error.

Guidance

  • The issue is caused by the _translate_legacy_thinking_for_adaptive_model function setting the effort level to "xhigh", which is not supported by the model.
  • To verify the fix, launch Claude Code with the modified litellm_params and check for API errors.
  • As a temporary workaround, set "output_config": { "effort": "high" } in litellm_params to avoid the invalid request error.
  • Review the transformation.py file to ensure that the effort level is set correctly for different models.

Example

litellm_params = {
    "output_config": {
        "effort": "high"
    }
}

Notes

This fix assumes that the issue is solely caused by the unsupported effort level. If other errors occur, further investigation may be needed.

Recommendation

Apply workaround: set the effort level to a supported value, such as "high", in the output_config of litellm_params. This is because the newly introduced function is causing the issue, and modifying the litellm_params provides a quick mitigation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING