litellm - ✅(Solved) Fix Claude Code fails with non-Anthropic models via LiteLLM Proxy (Unknown parameter: output_config) [1 pull requests, 6 comments, 6 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#22963Fetched 2026-04-08 00:39:15
View on GitHub
Comments
6
Participants
6
Timeline
31
Reactions
4
Timeline (top)
subscribed ×10commented ×6mentioned ×5labeled ×4

Error Message

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" } }

Root Cause

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.

Fix Action

Fixed

PR fix notes

PR #22990: fix(azure): strip output_config parameter from Azure OpenAI requests

Description (problem / solution / changelog)

Relevant issues

<!-- e.g. "Fixes #000" -->

fixes #22963

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/test_litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

<!-- Select the type of Pull Request --> <!-- Keep only the necessary ones -->

🐛 Bug Fix Azure OpenAI does not support the output_config parameter (an Anthropic-specific API parameter for extended
thinking/effort configuration). When output_config is included in a request proxied through LiteLLM to Azure OpenAI (e.g., from Claude Code CLI), it causes a 500 error:

AzureException - Unknown parameter: 'output_config'

This PR adds handling to strip output_config in the Azure transformation layers before the request reaches Azure, consistent with how Vertex AI already handles this (data.pop("output_config", None)).

Unlike the Bedrock fix (#22802), which converts output_config.format.schema to inline schema, Azure already has native response_format support handled through a separate LiteLLM translation path — so stripping is sufficient here.

Changes

  • litellm/llms/azure/chat/gpt_transformation.py — Strip output_config in base AzureOpenAIConfig.transform_request(), covering all Azure chat models
  • litellm/llms/azure/chat/o_series_transformation.py — Strip output_config in AzureOpenAIO1Config.transform_request(), which inherits from OpenAIOSeriesConfig (not AzureOpenAIConfig) and would otherwise miss the fix
  • tests/test_litellm/llms/azure/chat/test_azure_chat_gpt_transformation.py — Unit test for base Azure transform
  • tests/test_litellm/llms/azure/chat/test_azure_gpt5_transformation.py — Unit test for GPT-5 transform (covered by parent class fix)
  • tests/test_litellm/llms/azure/chat/test_azure_chat_o_series_transformation.py — Unit test for O-series transform

Test plan

  • All new unit tests pass (7 tests across 3 test files)
  • Unit tests still pass (no regression)

Changed files

  • litellm/llms/azure/chat/gpt_transformation.py (modified, +3/-0)
  • litellm/llms/azure/chat/o_series_transformation.py (modified, +3/-0)
  • poetry.lock (modified, +4/-4)
  • tests/test_litellm/llms/azure/chat/test_azure_chat_gpt_transformation.py (modified, +65/-0)
  • tests/test_litellm/llms/azure/chat/test_azure_chat_o_series_transformation.py (modified, +36/-0)
  • tests/test_litellm/llms/azure/chat/test_azure_gpt5_transformation.py (modified, +34/-0)

Code Example

Unknown parameter: 'output_config'

---

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:

---

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

---

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

---

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

claude --model gpt-5.1

---

prompt: hi

---

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"
  }
}
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’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/

extent analysis

Fix Plan

To resolve the issue, we need to modify the LiteLLM proxy to handle the output_config parameter. We can achieve this by updating the config.yaml file to include a custom parameter filter.

Step 1: Update config.yaml

Add a parameter_filter section to the config.yaml file:

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
      parameter_filter:
        - output_config

This will filter out the output_config parameter from the request.

Step 2: Restart LiteLLM Proxy

Restart the LiteLLM proxy to apply the changes:

docker-compose restart litellm

Step 3: Test Claude Code

Test Claude Code again to see if the issue is resolved:

claude --model gpt-5.1

Send a prompt and verify that the request is successful.

Verification

To verify that the fix worked, check the LiteLLM proxy logs for any errors related to the output_config parameter. If the issue is resolved, the logs should not contain any errors related to this parameter.

Extra Tips

  • Make sure to update the config.yaml file correctly, as any mistakes can cause the LiteLLM proxy to fail.
  • If you're using a different model or API, you may need to adjust the parameter_filter section accordingly.
  • Consider updating the LiteLLM proxy to a newer version, as this issue may be resolved in a future release.

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