Check for existing issues
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
- 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}"
-
Run LiteLLM proxy.
-
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
- Send a prompt in Claude Code.
Example:
- 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/
Check for existing issues
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:
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
docker-compose.yml
config.yaml
.env
Run LiteLLM proxy.
Configure Claude Code to use the proxy.
Example:
Relevant log output
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/