litellm - 💡(How to fix) Fix [Bug]: OpenAI responses API not using configured `base_url` [1 pull requests]

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…

Error Message

Proxy configuration

proxy_config: general_settings: alerting: ["slack"] alerting_threshold: 340 # seconds before a hanging request triggers an alert allow_requests_on_db_unavailable: true database_connection_pool_limit: 10 disable_error_logs: false # turn off writing LLM Exceptions to DB master_key: os.environ/LITELLM_MASTER_KEY proxy_batch_write_at: 60 store_prompts_in_spend_logs: true

litellm_settings: drop_params: true timeout: 165 stream_timeout: 90 set_verbose: false json_logs: true redact_messages_in_exceptions: false timezone: "Europe/Amsterdam"

model_list: - model_name: gpt-5.4-mini litellm_params: model: openai/gpt-5.4-mini api_key: os.environ/OPENAI_API_KEY base_url: https://eu.api.openai.com/v1

Fix Action

Fixed

Code Example

# Proxy configuration
proxy_config:
  general_settings:
    alerting: ["slack"]
    alerting_threshold: 340 # seconds before a hanging request triggers an alert
    allow_requests_on_db_unavailable: true
    database_connection_pool_limit: 10
    disable_error_logs: false # turn off writing LLM Exceptions to DB
    master_key: os.environ/LITELLM_MASTER_KEY
    proxy_batch_write_at: 60
    store_prompts_in_spend_logs: true

  litellm_settings:
    drop_params: true
    timeout: 165
    stream_timeout: 90
    set_verbose: false
    json_logs: true
    redact_messages_in_exceptions: false
    timezone: "Europe/Amsterdam"

  model_list:
    - model_name: gpt-5.4-mini
      litellm_params:
        model: openai/gpt-5.4-mini
        api_key: os.environ/OPENAI_API_KEY
        base_url: https://eu.api.openai.com/v1

---

from openai import OpenAI

url = <litellm-proxy-url>
key = <litellm-api-key>

client = OpenAI(base_url=url, api_key=key)
response = client.responses.create(
    model="gpt-5.4-mini", input="Tell me a three sentence bedtime story about a unicorn."
)

---

AuthenticationError: Error code: 401 - {'error': {'message': 'litellm.AuthenticationError: AuthenticationError: OpenAIException - {\n  "error": {\n    "message": "Attempted to access resource from outside project geography EU",\n    "type": null,\n    "code": null,\n    "param": null\n  },\n  "status": 401\n}. Received Model Group=gpt-5.4-mini\nAvailable Model Group Fallbacks=None', 'type': None, 'param': None, 'code': '401'}}

---

{'message': '{\'text\': \'Alert type: `llm_exceptions`\\nLevel: `High`\\nTimestamp: `13:03:57`\\n\\nMessage: LLM API call failed: `litellm.AuthenticationError: AuthenticationError: OpenAIException - {\\n  "error": {\\n    "message": "Attempted to access resource from outside project geography EU",\\n    "type": null,\\n    "code": null,\\n    "param": null\\n  },\\n  "status": 401\\n}. Received Model Group=gpt-5.4-mini\\nAvailable Model Group Fallbacks=None\\nModel: openai/gpt-5.4-mini\\nAPI Base: `[https://api.openai.com`\\nMessages](https://api.openai.com`//nMessages): `None``\'}',
 'level': 'WARNING',
 'timestamp': '2026-06-09T13:04:01.619043',
 'text': 'Alert type: `llm_exceptions`\nLevel: `High`\nTimestamp: `13:03:57`\n\nMessage: LLM API call failed: `litellm.AuthenticationError: AuthenticationError: OpenAIException - {\n  "error": {\n    "message": "Attempted to access resource from outside project geography EU",\n    "type": null,\n    "code": null,\n    "param": null\n  },\n  "status": 401\n}. Received Model Group=gpt-5.4-mini\nAvailable Model Group Fallbacks=None\nModel: openai/gpt-5.4-mini\nAPI Base: `[https://api.openai.com`\nMessages](https://api.openai.com`/nMessages): `None``',
 'component': 'LiteLLM Proxy',
 'logger': 'batching_handler.py:53'}

---

from openai import OpenAI

url = <litellm-proxy-url>
key = <litellm-api-key>

client = OpenAI(base_url=url, api_key=key)
response = client.chat.completions.parse(
    model="gpt-5.4-mini", messages=[{"role": "user", "content": "Tell me a three sentence bedtime story about a unicorn."}]
)

---

from openai import OpenAI

url = "https://eu.api.openai.com/v1"
key = <openai-api-key>

client = OpenAI(base_url=url, api_key=key)
response = client.responses.create(
    model="gpt-5.4-mini", input="Tell me a three sentence bedtime story about a unicorn."
)

---

{'message': '{\'text\': \'Alert type: `llm_exceptions`\\nLevel: `High`\\nTimestamp: `13:03:57`\\n\\nMessage: LLM API call failed: `litellm.AuthenticationError: AuthenticationError: OpenAIException - {\\n  "error": {\\n    "message": "Attempted to access resource from outside project geography EU",\\n    "type": null,\\n    "code": null,\\n    "param": null\\n  },\\n  "status": 401\\n}. Received Model Group=gpt-5.4-mini\\nAvailable Model Group Fallbacks=None\\nModel: openai/gpt-5.4-mini\\nAPI Base: `[https://api.openai.com`\\nMessages](https://api.openai.com`//nMessages): `None``\'}',
 'level': 'WARNING',
 'timestamp': '2026-06-09T13:04:01.619043',
 'text': 'Alert type: `llm_exceptions`\nLevel: `High`\nTimestamp: `13:03:57`\n\nMessage: LLM API call failed: `litellm.AuthenticationError: AuthenticationError: OpenAIException - {\n  "error": {\n    "message": "Attempted to access resource from outside project geography EU",\n    "type": null,\n    "code": null,\n    "param": null\n  },\n  "status": 401\n}. Received Model Group=gpt-5.4-mini\nAvailable Model Group Fallbacks=None\nModel: openai/gpt-5.4-mini\nAPI Base: `[https://api.openai.com`\nMessages](https://api.openai.com`/nMessages): `None``',
 'component': 'LiteLLM Proxy',
 'logger': 'batching_handler.py:53'}
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?

We have the following config.yaml file for our proxy:

# Proxy configuration
proxy_config:
  general_settings:
    alerting: ["slack"]
    alerting_threshold: 340 # seconds before a hanging request triggers an alert
    allow_requests_on_db_unavailable: true
    database_connection_pool_limit: 10
    disable_error_logs: false # turn off writing LLM Exceptions to DB
    master_key: os.environ/LITELLM_MASTER_KEY
    proxy_batch_write_at: 60
    store_prompts_in_spend_logs: true

  litellm_settings:
    drop_params: true
    timeout: 165
    stream_timeout: 90
    set_verbose: false
    json_logs: true
    redact_messages_in_exceptions: false
    timezone: "Europe/Amsterdam"

  model_list:
    - model_name: gpt-5.4-mini
      litellm_params:
        model: openai/gpt-5.4-mini
        api_key: os.environ/OPENAI_API_KEY
        base_url: https://eu.api.openai.com/v1

I execute a call to the responses api as follows:

from openai import OpenAI

url = <litellm-proxy-url>
key = <litellm-api-key>

client = OpenAI(base_url=url, api_key=key)
response = client.responses.create(
    model="gpt-5.4-mini", input="Tell me a three sentence bedtime story about a unicorn."
)

This yields the following error:

AuthenticationError: Error code: 401 - {'error': {'message': 'litellm.AuthenticationError: AuthenticationError: OpenAIException - {\n  "error": {\n    "message": "Attempted to access resource from outside project geography EU",\n    "type": null,\n    "code": null,\n    "param": null\n  },\n  "status": 401\n}. Received Model Group=gpt-5.4-mini\nAvailable Model Group Fallbacks=None', 'type': None, 'param': None, 'code': '401'}}

Inspecting the pod with the litellm server shows me a more extensive error:

{'message': '{\'text\': \'Alert type: `llm_exceptions`\\nLevel: `High`\\nTimestamp: `13:03:57`\\n\\nMessage: LLM API call failed: `litellm.AuthenticationError: AuthenticationError: OpenAIException - {\\n  "error": {\\n    "message": "Attempted to access resource from outside project geography EU",\\n    "type": null,\\n    "code": null,\\n    "param": null\\n  },\\n  "status": 401\\n}. Received Model Group=gpt-5.4-mini\\nAvailable Model Group Fallbacks=None\\nModel: openai/gpt-5.4-mini\\nAPI Base: `[https://api.openai.com`\\nMessages](https://api.openai.com`//nMessages): `None``\'}',
 'level': 'WARNING',
 'timestamp': '2026-06-09T13:04:01.619043',
 'text': 'Alert type: `llm_exceptions`\nLevel: `High`\nTimestamp: `13:03:57`\n\nMessage: LLM API call failed: `litellm.AuthenticationError: AuthenticationError: OpenAIException - {\n  "error": {\n    "message": "Attempted to access resource from outside project geography EU",\n    "type": null,\n    "code": null,\n    "param": null\n  },\n  "status": 401\n}. Received Model Group=gpt-5.4-mini\nAvailable Model Group Fallbacks=None\nModel: openai/gpt-5.4-mini\nAPI Base: `[https://api.openai.com`\nMessages](https://api.openai.com`/nMessages): `None``',
 'component': 'LiteLLM Proxy',
 'logger': 'batching_handler.py:53'}

The important part to me seems this: API Base: [https://api.openai.com \nMessages](https://api.openai.com /nMessages): None, this seems to indicate that the API base is not actually correctly set.

This error does not occur if I use the completions api. This works fine:

from openai import OpenAI

url = <litellm-proxy-url>
key = <litellm-api-key>

client = OpenAI(base_url=url, api_key=key)
response = client.chat.completions.parse(
    model="gpt-5.4-mini", messages=[{"role": "user", "content": "Tell me a three sentence bedtime story about a unicorn."}]
)

The error also does not occur when calling OpenAI directly. This works fine:

from openai import OpenAI

url = "https://eu.api.openai.com/v1"
key = <openai-api-key>

client = OpenAI(base_url=url, api_key=key)
response = client.responses.create(
    model="gpt-5.4-mini", input="Tell me a three sentence bedtime story about a unicorn."
)

Steps to Reproduce

  1. Set up LiteLLM Proxy with the settings given above.
  2. Call the responses api with the LiteLLM proxy url and api key.
  3. Profit!

Relevant log output

{'message': '{\'text\': \'Alert type: `llm_exceptions`\\nLevel: `High`\\nTimestamp: `13:03:57`\\n\\nMessage: LLM API call failed: `litellm.AuthenticationError: AuthenticationError: OpenAIException - {\\n  "error": {\\n    "message": "Attempted to access resource from outside project geography EU",\\n    "type": null,\\n    "code": null,\\n    "param": null\\n  },\\n  "status": 401\\n}. Received Model Group=gpt-5.4-mini\\nAvailable Model Group Fallbacks=None\\nModel: openai/gpt-5.4-mini\\nAPI Base: `[https://api.openai.com`\\nMessages](https://api.openai.com`//nMessages): `None``\'}',
 'level': 'WARNING',
 'timestamp': '2026-06-09T13:04:01.619043',
 'text': 'Alert type: `llm_exceptions`\nLevel: `High`\nTimestamp: `13:03:57`\n\nMessage: LLM API call failed: `litellm.AuthenticationError: AuthenticationError: OpenAIException - {\n  "error": {\n    "message": "Attempted to access resource from outside project geography EU",\n    "type": null,\n    "code": null,\n    "param": null\n  },\n  "status": 401\n}. Received Model Group=gpt-5.4-mini\nAvailable Model Group Fallbacks=None\nModel: openai/gpt-5.4-mini\nAPI Base: `[https://api.openai.com`\nMessages](https://api.openai.com`/nMessages): `None``',
 'component': 'LiteLLM Proxy',
 'logger': 'batching_handler.py:53'}

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

1.83.10-stable

Twitter / LinkedIn details

No response

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