litellm - 💡(How to fix) Fix [Bug]: Claude Code + Microsoft Foundry (Azure) - Unsupported 'reasoning.effort' and AnthropicResponse Pydantic Validation Error [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#27091Fetched 2026-05-04 04:59:11
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×4

Error Message

##Error 1 (Parameter):

litellm.exceptions.BadRequestError: litellm.BadRequestError: OpenAIException - { "error": { "message": "Unsupported parameter: 'reasoning.effort' is not supported with this model.", "type": "invalid_request_error", "param": "reasoning.effort", "code": "unsupported_parameter" } }

Error 2 (Pydantic):

Exception: [Non-Blocking] LiteLLM.Success_Call Error: 1 validation error for AnthropicResponse Input should be a valid dictionary or instance of AnthropicResponse [type=model_type, input_value=ResponseIncompleteEvent(...), input_type=ResponseIncompleteEvent] For further information visit https://errors.pydantic.dev/2.12/v/model_type

Root Cause

Parameter Mapping Failure: Claude Code sends "thinking/reasoning" parameters. LiteLLM translates these to reasoning.effort (OpenAI format). Microsoft Foundry models (non-o1) reject the request with a 400 Bad Request: Unsupported parameter: 'reasoning.effort'. Even with drop_params: true, this specific parameter persists because it is a "valid" OpenAI key, despite being unsupported by the specific deployment.

Code Example

##Error 1 (Parameter):

litellm.exceptions.BadRequestError: litellm.BadRequestError: OpenAIException - {
  "error": {
    "message": "Unsupported parameter: 'reasoning.effort' is not supported with this model.",
    "type": "invalid_request_error",
    "param": "reasoning.effort",
    "code": "unsupported_parameter"
  }
}


## Error 2 (Pydantic):

Exception: [Non-Blocking] LiteLLM.Success_Call Error: 1 validation error for AnthropicResponse
  Input should be a valid dictionary or instance of AnthropicResponse [type=model_type, input_value=ResponseIncompleteEvent(...), input_type=ResponseIncompleteEvent]
    For further information visit https://errors.pydantic.dev/2.12/v/model_type
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?

I am using LiteLLM as an anthropic_proxy to route Claude Code requests to a model (Kimi-K2.6) hosted on Microsoft Foundry (formerly Azure AI Foundry). Two distinct issues occur:

Parameter Mapping Failure: Claude Code sends "thinking/reasoning" parameters. LiteLLM translates these to reasoning.effort (OpenAI format). Microsoft Foundry models (non-o1) reject the request with a 400 Bad Request: Unsupported parameter: 'reasoning.effort'. Even with drop_params: true, this specific parameter persists because it is a "valid" OpenAI key, despite being unsupported by the specific deployment.

Telemetry/Logging Crash (Non-Blocking): After a successful response (if params are manually dropped), LiteLLM's background logging fails. It attempts to validate a ResponseIncompleteEvent or ResponseCompletedEvent against the AnthropicResponse Pydantic model, causing a ValidationError.

Steps to Reproduce

  1. Run LiteLLM Proxy with the following config.yaml:

model_list:

  1. Point Claude Code to the proxy: export ANTHROPIC_BASE_URL="http://0.0.0.0:4000/v1"

  2. Execute a command in Claude Code (e.g., claude list files).

  3. Observe the 400 Bad Request regarding reasoning.effort.

  4. Apply additional_drop_params: ["reasoning.effort"] to bypass the 400, then observe the Pydantic ValidationError in the background logs.

Relevant log output

##Error 1 (Parameter):

litellm.exceptions.BadRequestError: litellm.BadRequestError: OpenAIException - {
  "error": {
    "message": "Unsupported parameter: 'reasoning.effort' is not supported with this model.",
    "type": "invalid_request_error",
    "param": "reasoning.effort",
    "code": "unsupported_parameter"
  }
}


## Error 2 (Pydantic):

Exception: [Non-Blocking] LiteLLM.Success_Call Error: 1 validation error for AnthropicResponse
  Input should be a valid dictionary or instance of AnthropicResponse [type=model_type, input_value=ResponseIncompleteEvent(...), input_type=ResponseIncompleteEvent]
    For further information visit https://errors.pydantic.dev/2.12/v/model_type

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.53.1

Twitter / LinkedIn details

No response

extent analysis

TL;DR

Adding additional_drop_params: ["reasoning.effort"] to the config.yaml file may resolve the Parameter Mapping Failure issue.

Guidance

  • Verify that the additional_drop_params configuration option is correctly applied by checking the LiteLLM logs for the dropped parameter.
  • Investigate the Pydantic ValidationError by reviewing the AnthropicResponse model definition and the ResponseIncompleteEvent or ResponseCompletedEvent data being validated against it.
  • Consider updating the AnthropicResponse model to accommodate the ResponseIncompleteEvent or ResponseCompletedEvent data structure.
  • Check the Microsoft Foundry documentation to confirm the supported parameters for the Kimi-K2.6 model.

Example

No code snippet is provided as the issue is more related to configuration and model compatibility.

Notes

The solution may not work if the additional_drop_params option does not correctly drop the reasoning.effort parameter or if the Pydantic ValidationError is caused by a more complex issue.

Recommendation

Apply workaround: Add additional_drop_params: ["reasoning.effort"] to the config.yaml file, as this is a targeted solution to the Parameter Mapping Failure issue and does not require updating the LiteLLM version.

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

litellm - 💡(How to fix) Fix [Bug]: Claude Code + Microsoft Foundry (Azure) - Unsupported 'reasoning.effort' and AnthropicResponse Pydantic Validation Error [1 participants]