9 views
-/https://github.com/berriai/litellm/issues/24500
GitHub · issue

#24500 Passthrough endpoints with include_subpath and auth disabled reject subpath requests with 401

  • State: open
  • Author: @franpinedab
  • Labels: llm translation

## Bug Description

When a pass-through endpoint is configured with `include_subpath: true` and `auth` not set (defaults to `false`), requests to **subpaths** are rejected with `401 Unauthorized` because the auth check in `check_api_key_for_custom_headers_or_pass_through_endpoints()` uses **exact path matching** (`==`) instead of prefix matching.

## Steps to Reproduce

1. Configure a passthrough endpoint:

```yaml general_settings: master_key: os.environ/PROXY_MASTER_KEY pass_through_endpoints: - path: "/chatgpt" target: "https://chatgpt.com/backend-api/codex" include_subpath: true forward_headers: true ```

2. Send a request to a subpath:

```bash curl http://localhost:4000/chatgpt/responses \ -H "Authorization: Bearer eyJhbG..." \ -H "Content-Type: application/json" \ -d '{"model": "gpt-5", "input": "Hello"}' ```

3. Get error: ``` 401 Unauthorized: Authentication Error, LiteLLM Virtual Key expected. Received=eyJh****lx4A, expected to start with 'sk-'. ```

## Expected Behavior

The request should pass through to the target without requiring a LiteLLM virtual key, since `auth` is not enabled on the endpoint.

## Root Cause

In `litellm/proxy/auth/…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d17h56m35s ago — entered · #import:https:::github.com:berriai:litellm post #2920
Provider-specific request-model and transformation changes carry broader compatibility and testing risk than a localized routing/auth condition fix.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search