Skip to content

Claude Code fails with non-Anthropic models via LiteLLM Proxy (Unknown parameter: output_config) #22963

Description

@birdalugur

Check for existing issues

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

What happened?

I’m trying to use Claude Code with non-Anthropic models via LiteLLM Proxy following the official tutorial:

https://docs.litellm.ai/docs/tutorials/claude_non_anthropic_models

The LiteLLM proxy is running correctly and the configured model works without any issues in the LiteLLM Playground.

However, when using Claude Code with the proxy, the request fails with the following error:

Unknown parameter: 'output_config'

This appears to happen because Claude Code sends a parameter (output_config) that is forwarded to the OpenAI API through LiteLLM, but OpenAI does not recognize this parameter.

As a result, Claude Code cannot be used with non-Anthropic models via LiteLLM proxy.

Steps to Reproduce

  1. Start LiteLLM proxy using Docker Compose with the following configuration.

docker-compose.yml

services:
  litellm:
    image: docker.litellm.ai/berriai/litellm:main-stable
    volumes:
     - ./config.yaml:/app/config.yaml
    command:
     - "--config=/app/config.yaml"
    ports:
      - "4000:4000"
    environment:
      DATABASE_URL: "postgresql://llmproxy:dbpassword9090@db:5432/litellm"
      STORE_MODEL_IN_DB: "True"
    env_file:
      - .env
    depends_on:
      - db
    healthcheck:
      test:
        - CMD-SHELL
        - python3 -c "import urllib.request; urllib.request.urlopen('http://localhost:4000/health/liveliness')"
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s

  db:
    image: postgres:16
    restart: always
    container_name: litellm_db
    environment:
      POSTGRES_DB: litellm
      POSTGRES_USER: llmproxy
      POSTGRES_PASSWORD: dbpassword9090
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -d litellm -U llmproxy"]
      interval: 1s
      timeout: 5s
      retries: 10

volumes:
  postgres_data:

config.yaml

model_list:
  - model_name: gpt-5.1
    litellm_params:
      model: gpt-5.1
      api_base: https://api.openai.com/v1
      api_key: os.environ/OPENAI_API_KEY

.env

LITELLM_MASTER_KEY="sk-1234"
UI_USERNAME=admin
UI_PASSWORD=admin
OPENAI_API_KEY="sk-{your-api-key}"

  1. Run LiteLLM proxy.

  2. Configure Claude Code to use the proxy.

export ANTHROPIC_BASE_URL="http://0.0.0.0:4000"
export ANTHROPIC_AUTH_TOKEN="sk-1234"

claude --model gpt-5.1
  1. Send a prompt in Claude Code.

Example:

prompt: hi
  1. The request fails with an error.

Relevant log output

LiteLLM proxy logs:


Error Code: unknown_parameter
Message: litellm.BadRequestError: OpenAIException - Unknown parameter: 'output_config'.

Received Model Group=gpt-5.1
Available Model Group Fallbacks=None


Traceback excerpt:


File \"/usr/lib/python3.13/site-packages/litellm/proxy/anthropic_endpoints/endpoints.py\", line 53, in anthropic_response\n    
result = await base_llm_response_processor.base_process_llm_request

File "/usr/lib/python3.13/site-packages/litellm/llms/anthropic/experimental_pass_through/messages/handler.py"
response = await init_response

File "/usr/lib/python3.13/site-packages/litellm/llms/anthropic/experimental_pass_through/adapters/handler.py"
completion_response = await litellm.acompletion(**completion_kwargs)

File "/usr/lib/python3.13/site-packages/litellm/main.py", line 631, in acompletion
raise exception_type(...)


Claude Code output:


API Error: 400
{
  "error": {
    "message": "litellm.BadRequestError: OpenAIException - Unknown parameter: 'output_config'",
    "type": "invalid_request_error",
    "param": "output_config",
    "code": "400"
  }
}

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.81.14

Twitter / LinkedIn details

https://www.linkedin.com/in/birdalugur/

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