litellm - 💡(How to fix) Fix [Bug]: Unable to use Claude Opus 4.7 in Claude Code [5 comments, 4 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#25877Fetched 2026-04-17 08:28:23
View on GitHub
Comments
5
Participants
4
Timeline
12
Reactions
1
Timeline (top)
commented ×5labeled ×4closed ×1mentioned ×1

Error Message

❯ hello world ⎿  API Error: 400 {"error":{"message":"b'{"type":"error","error":{"type":"invalid_request_error","message":"\\"thinking.type.enabled\\" is not supported for this model. Use \\"thinking.type.adaptive\\" and \\"output_config.effort\\" to control thinking behavior."},"request_id":"req_011Ca7qUXxE8LhWBqa2KebcM"}'","type":"None","param":"None","code":"400"}}

Code Example

❯ hello world
  ⎿  API Error: 400 {"error":{"message":"b'{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"\\\\\"thinking.type.enabled\\\\\" is not supported for this model. Use \\\\\"thinking.type.adaptive\\\\\" and \\\\\"output_config.effort\\\\\" to
     control thinking behavior.\"},\"request_id\":\"req_011Ca7qUXxE8LhWBqa2KebcM\"}'","type":"None","param":"None","code":"400"}}

---

➜  scratch curl -s --location https://<redacted>/chat/completions --header 'Content-Type: application/json' --header "Authorization: Bearer $LITELLM_PROD_API_KEY" --data @data.json  | jq .
{
  "id": "chatcmpl-83449e15-cd2a-483d-ba51-d9a7593b7e3a",
  "created": 1776360820,
  "model": "claude-opus-4-7",
  "object": "chat.completion",
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "Pi to four decimal places is **3.1416**.",
        "role": "assistant",
        "provider_specific_fields": {
          "citations": null,
          "thinking_blocks": null
        }
      }
    }
  ],
  "usage": {
    "completion_tokens": 21,
    "prompt_tokens": 21,
    "total_tokens": 42,
    "completion_tokens_details": {
      "reasoning_tokens": 0,
      "text_tokens": 21
    },
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "cache_creation_tokens": 0,
      "cache_creation_token_details": {
        "ephemeral_5m_input_tokens": 0,
        "ephemeral_1h_input_tokens": 0
      }
    },
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0
  }
}

---

- litellm_params:
    api_key: os.environ/ANTHROPIC_API_KEY
    model: anthropic/claude-opus-4-7
  model_info:
    mode: chat
  model_name: claude-opus-4-7
- litellm_params:
    cache_control_injection_points:
    - location: message
      role: system
    model: vertex_ai/claude-opus-4-7
    use_in_pass_through: true
    vertex_credentials: os.environ/GOOGLE_SA_KEYFILE_PATH
    vertex_location: global
    vertex_project: <redacted>

---

⎿  API Error: 400 {"error":{"message":"b'{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"\\\\\"thinking.type.enabled\\\\\" is not supported for this model. Use \\\\\"thinking.type.adaptive\\\\\" and \\\\\"output_config.effort\\\\\" to
     control thinking behavior.\"},\"request_id\":\"req_011Ca7qUXxE8LhWBqa2KebcM\"}'","type":"None","param":"None","code":"400"}}

---

fastapi.exceptions.HTTPException: 400: b'{"type":"error","error":{"type":"invalid_request_error","message":"\\"thinking.type.enabled\\" is not supported for this model. Use \\"thinking.type.adaptive\\" and \\"output_config.effort\\" to control thinking behavior."},"request_id":"req_011Ca7qUXxE8LhWBqa2KebcM"}'
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?

A bug happened!

Using Claude Opus 4.7 in claude code through liteLLM consistently fails with the error:

❯ hello world
  ⎿  API Error: 400 {"error":{"message":"b'{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"\\\\\"thinking.type.enabled\\\\\" is not supported for this model. Use \\\\\"thinking.type.adaptive\\\\\" and \\\\\"output_config.effort\\\\\" to
     control thinking behavior.\"},\"request_id\":\"req_011Ca7qUXxE8LhWBqa2KebcM\"}'","type":"None","param":"None","code":"400"}}

The model works fine when curling it directly. The same error occurs even in anthropic's passthrough mode (i.e. when I add /anthropic to my ANTHROPIC_BASE_URL.

➜  scratch curl -s --location https://<redacted>/chat/completions --header 'Content-Type: application/json' --header "Authorization: Bearer $LITELLM_PROD_API_KEY" --data @data.json  | jq .
{
  "id": "chatcmpl-83449e15-cd2a-483d-ba51-d9a7593b7e3a",
  "created": 1776360820,
  "model": "claude-opus-4-7",
  "object": "chat.completion",
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "Pi to four decimal places is **3.1416**.",
        "role": "assistant",
        "provider_specific_fields": {
          "citations": null,
          "thinking_blocks": null
        }
      }
    }
  ],
  "usage": {
    "completion_tokens": 21,
    "prompt_tokens": 21,
    "total_tokens": 42,
    "completion_tokens_details": {
      "reasoning_tokens": 0,
      "text_tokens": 21
    },
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "cache_creation_tokens": 0,
      "cache_creation_token_details": {
        "ephemeral_5m_input_tokens": 0,
        "ephemeral_1h_input_tokens": 0
      }
    },
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0
  }
}

Steps to Reproduce

  1. Add Claude Opus 4.7 to the model cost map. I used both Anthropic and Vertex and the issue occurs with both.
- litellm_params:
    api_key: os.environ/ANTHROPIC_API_KEY
    model: anthropic/claude-opus-4-7
  model_info:
    mode: chat
  model_name: claude-opus-4-7
- litellm_params:
    cache_control_injection_points:
    - location: message
      role: system
    model: vertex_ai/claude-opus-4-7
    use_in_pass_through: true
    vertex_credentials: os.environ/GOOGLE_SA_KEYFILE_PATH
    vertex_location: global
    vertex_project: <redacted>
  1. Open Claude Code (v2.1.92)
  2. Set the model to claude-opus-4-7 with /model claude-opus-4-7
  3. Submit any message and receive the error mentioned above.
  ⎿  API Error: 400 {"error":{"message":"b'{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"\\\\\"thinking.type.enabled\\\\\" is not supported for this model. Use \\\\\"thinking.type.adaptive\\\\\" and \\\\\"output_config.effort\\\\\" to
     control thinking behavior.\"},\"request_id\":\"req_011Ca7qUXxE8LhWBqa2KebcM\"}'","type":"None","param":"None","code":"400"}}
  1. The same issue does not occur when using Claude Code without going through LiteLLM, or when using Opus 4.6 (or any other anthropic model)

Relevant log output

fastapi.exceptions.HTTPException: 400: b'{"type":"error","error":{"type":"invalid_request_error","message":"\\"thinking.type.enabled\\" is not supported for this model. Use \\"thinking.type.adaptive\\" and \\"output_config.effort\\" to control thinking behavior."},"request_id":"req_011Ca7qUXxE8LhWBqa2KebcM"}'

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.82.3

Twitter / LinkedIn details

No response

extent analysis

TL;DR

The issue is likely due to an incompatible parameter being sent to the Claude Opus 4.7 model through LiteLLM, and removing or modifying this parameter may resolve the error.

Guidance

  • The error message suggests that the thinking.type.enabled parameter is not supported for the Claude Opus 4.7 model, and instead, thinking.type.adaptive and output_config.effort should be used to control thinking behavior.
  • Verify that the LiteLLM configuration is not sending the thinking.type.enabled parameter to the model, or modify the configuration to use the supported parameters.
  • Check the LiteLLM documentation to see if there are any specific requirements or restrictions for using the Claude Opus 4.7 model.
  • Test the model with a minimal configuration to isolate the issue and determine if it's specific to the LiteLLM setup or the model itself.

Example

No code example is provided as the issue is related to configuration and parameter passing, and the exact code or configuration files are not available.

Notes

The issue may be specific to the LiteLLM version (v1.82.3) or the Claude Opus 4.7 model, and further investigation may be needed to determine the root cause.

Recommendation

Apply a workaround by modifying the LiteLLM configuration to use the supported parameters (thinking.type.adaptive and output_config.effort) instead of thinking.type.enabled, as suggested by the error message.

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