Skip to content

[Bug]: Unable to use Claude Opus 4.7 in Claude Code #25877

Description

@saraangelmurphy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions