Skip to content

fix(proxy)!: scope /health by wildcard keys and team model allowlists the way auth does - #47749

Closed
mateo-berri wants to merge 18 commits into
mainfrom
litellm_health_scope_like_auth
Closed

mateo-berri wants to merge 18 commits into
mainfrom
litellm_health_scope_like_auth

Conversation

@mateo-berri

@mateo-berri mateo-berri commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

/health matches deployments by literal name, so a wildcard key can't see a model it chats with, and a team key sees and can probe models its team forbids

This runs chat's key, team, user, and agent model checks on each name the key could send, so /health matches chat

Original

TLDR

Problem this solves:

  • /health ignores wildcard key models like openai/*
  • /health ignores team, user, and agent model limits
  • A team key can trigger billed probes of forbidden models

How it solves it:

  • Scope /health with chat's model checks, following aliases and wildcards
  • Yield between checks so other requests keep running
  • Answer other auth errors the way chat does
  • Admin keys with no model list still see everything

Intentional product change: a team key's /health hides deployments its team forbids

User Flow

Before: a wildcard key's /health hides a model it can chat with, and a team key probes models its team forbids

  1. The admin creates a key with "models": ["openai/*"], and a key with no models on a team that allows only gpt-5.4-mini
  2. The wildcard key's POST https://litellm-domain/v1/chat/completions with openai/gpt-5.4-nano gets a 200
  3. Its GET https://litellm-domain/health lists only the openai/* deployment, and ?model_id=<the nano deployment> gets a 403
  4. The team key's chat request for openai/gpt-5.4-nano gets a 403 team_model_access_denied
  5. Its GET https://litellm-domain/health lists every deployment, and ?model_id=<the forbidden deployment> makes a billed provider call

After: /health shows each key only what it can call

  1. The admin creates the same two keys, and chat answers them as before
  2. The wildcard key's GET https://litellm-domain/health lists the nano deployment, and ?model_id=<that deployment> probes it
  3. The team key's GET https://litellm-domain/health lists only gpt-5.4-mini, and ?model_id=<the forbidden deployment> gets a 403 with no provider call

Pre-Submission checklist

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

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*, make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • Every automated review on my PR's latest commit has finished, and I have addressed or replied to each of its findings before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

Each leg ran two 2-worker proxies ($A, $B) on shared Postgres and Redis. Lines show the HTTP status and model ids, with IDS='.error // .detail // {healthy: [.healthy_endpoints[].model_id], unhealthy: [.unhealthy_endpoints[].model_id]}'

Config and keys
model_list:
  - model_name: openai/gpt-5.4-nano
    litellm_params:
      model: openai/gpt-5.4-nano
      api_key: os.environ/OPENAI_API_KEY
    model_info:
      id: openai-prefixed-nano
  - model_name: gpt-5.4-mini
    litellm_params:
      model: openai/gpt-5.4-mini
      api_key: os.environ/OPENAI_API_KEY
    model_info:
      id: global-mini
  - model_name: claude-haiku-5-5
    litellm_params:
      model: anthropic/claude-haiku-5-5
      api_key: os.environ/ANTHROPIC_API_KEY
    model_info:
      id: anthropic-haiku
      access_groups: ["haiku-group"]
  - model_name: openai/*
    litellm_params:
      model: openai/*
      api_key: os.environ/OPENAI_API_KEY
    model_info:
      id: openai-wildcard
      health_check_model: openai/gpt-5.4-nano
  - model_name: shared-nano
    litellm_params:
      model: openai/gpt-5.4-nano
      api_key: os.environ/OPENAI_API_KEY
    model_info:
      id: shared-nano-premium
      access_groups: ["premium"]
  - model_name: shared-nano
    litellm_params:
      model: openai/gpt-5.4-nano
      api_key: os.environ/OPENAI_API_KEY
    model_info:
      id: shared-nano-standard
router_settings:
  default_fallbacks: ["gpt-5.4-mini"]
  model_group_alias:
    legacy-mini: gpt-5.4-mini
  redis_host: 127.0.0.1
  redis_port: os.environ/QA_REDIS_PORT
general_settings:
  master_key: os.environ/LITELLM_MASTER_KEY
  database_connection_pool_limit: 5

The background pair adds background_health_checks: true and health_check_interval: 20. Teams come from POST /team/new with {"models":["gpt-5.4-mini"]}, {"models":["claude-haiku-5-5"],"model_aliases":{"claude-haiku-5-5":"gpt-5.4-mini"}}, {"models":["openai/gpt-5.6"]}, {"models":["legacy-mini"]}, {"models":["my-mini"],"model_aliases":{"my-mini":"gpt-5.4-mini"}}, and {"models":["openai/gpt-5.4-nano","gpt-4-retired"]}. TEAM_KEY, TEAM_ALIAS_KEY, WILD_TEAM_KEY, LEGACY_TEAM_KEY, OWN_ALIAS_TEAM_KEY, and STALE_TEAM_KEY are POST /key/generate with {"team_id":"<that team>"} (TEAM_KEY also sends "models":[]). The other keys send {"models":["openai/*"]} (WILDCARD_KEY), {"models":["haiku-group"]} (GROUP_KEY), {"models":["premium"]} (PREMIUM_KEY), {"models":["openai/gpt-5.4-nano","gpt-4-retired"]} (STALE_KEY), {"models":["gpt-5.4-mini"],"aliases":{"claude-haiku-5-5":"gpt-5.4-mini"}} (KEY_ALIAS_KEY), {"models":["gpt-5.4-mini"],"router_settings":{"model_group_alias":{"claude-haiku-5-5":"gpt-5.4-mini"}}} (ROUTER_ALIAS_KEY), {"models":["gpt-5.4-mini","openai/gpt-5.4-nano"],"router_settings":{"model_group_alias":{"gpt-5.4-mini":"claude-haiku-5-5"}}} (FORBIDDEN_ALIAS_KEY), and {"models":[],"router_settings":{"model_group_alias":{"claude-haiku-5-5":"gpt-5.4-mini"}}} (OPEN_ALIAS_KEY). OWNER_KEY belongs to a user made by POST /user/new with {"models":["gpt-5.4-mini"]}, and OWNER_WILD_KEY to one with {"models":["openai/gpt-5.6"]}. AGENT_KEY belongs to an agent made by POST /v1/agents whose access group, from POST /v1/access_group, holds only gpt-5.4-mini. Each /health command prints its HTTP status, then jq lists the model_id of every healthy and unhealthy endpoint, or the error

Case Before After
Team key All 6 global-mini
Team allows a wildcard name All 6 openai-wildcard
Team alias, 3 kinds All 6 global-mini
?model= an alias name Key 403, team haiku Both global-mini
Team allows a retired name All 6 Nano only
Owner allows only mini All 6, nano probed global-mini, nano 403
Owner allows a wildcard name All 6 openai-wildcard
Agent group holds only mini All 6, nano probed global-mini, nano 403
?model= a wildcard name 403 openai-wildcard
Wildcard key Wildcard only, nano 403 Nano, mini, wildcard
Group holds one of two Both Premium only
Agent sends unknown user or team id All 6 401 or 404, like chat (gist)
Background checks Team keys: all 6 Same as live
Cases that answer the same on both legs
Case Before and after
Key alias to a forbidden model Nano and mini
Open key with an alias All 6
Key or router alias global-mini
Key allows a retired name Nano only
Access-group key anthropic-haiku
Admin key All 6

Team key

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $TEAM_KEY" -H 'Content-Type: application/json' -d '{"model":"openai/gpt-5.4-nano","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    Before and after

    HTTP 403  x-litellm-model-id:
    
  2. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $TEAM_KEY"; jq -c "$IDS" h.json

    Before (ffcc4f7)

    HTTP 200  {"healthy":["global-mini","openai-prefixed-nano","anthropic-haiku","openai-wildcard","shared-nano-premium","shared-nano-standard"],"unhealthy":[]}
    

    After (49efac1)

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model_id=openai-prefixed-nano" -H "Authorization: Bearer $TEAM_KEY"; jq -c "$IDS" h.json

    Before (ffcc4f7)

    HTTP 200  {"healthy":["openai-prefixed-nano"],"unhealthy":[]}
    

    After (49efac1)

    HTTP 403  {"error":"key not allowed to health-check model_id openai-prefixed-nano"}
    

Every other case

Before (ffcc4f7)

Team key, other steps

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $TEAM_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    

Team allows a wildcard-only name

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $WILD_TEAM_KEY" -H 'Content-Type: application/json' -d '{"model":"openai/gpt-5.6","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: openai-wildcard
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $WILD_TEAM_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $WILD_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini","openai-prefixed-nano","anthropic-haiku","openai-wildcard","shared-nano-premium","shared-nano-standard"],"unhealthy":[]}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model_id=openai-wildcard" -H "Authorization: Bearer $WILD_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["openai-wildcard"],"unhealthy":[]}
    
  5. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model=openai/gpt-5.6" -H "Authorization: Bearer $WILD_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"error":"key not allowed to health-check model openai/gpt-5.6"}
    

Team allows a router alias

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $LEGACY_TEAM_KEY" -H 'Content-Type: application/json' -d '{"model":"legacy-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $LEGACY_TEAM_KEY" -H 'Content-Type: application/json' -d '{"model":"openai/gpt-5.4-nano","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health" -H "Authorization: Bearer $LEGACY_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini","openai-prefixed-nano","anthropic-haiku","openai-wildcard","shared-nano-premium","shared-nano-standard"],"unhealthy":[]}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model_id=global-mini" -H "Authorization: Bearer $LEGACY_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    
  5. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model=legacy-mini" -H "Authorization: Bearer $LEGACY_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    

Team allows its own alias

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $OWN_ALIAS_TEAM_KEY" -H 'Content-Type: application/json' -d '{"model":"my-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $OWN_ALIAS_TEAM_KEY" -H 'Content-Type: application/json' -d '{"model":"openai/gpt-5.4-nano","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $OWN_ALIAS_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini","openai-prefixed-nano","anthropic-haiku","openai-wildcard","shared-nano-premium","shared-nano-standard"],"unhealthy":[]}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model_id=global-mini" -H "Authorization: Bearer $OWN_ALIAS_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    

Key alias to a forbidden model

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $FORBIDDEN_ALIAS_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $FORBIDDEN_ALIAS_KEY" -H 'Content-Type: application/json' -d '{"model":"openai/gpt-5.4-nano","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: openai-prefixed-nano
    
  3. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $FORBIDDEN_ALIAS_KEY" -H 'Content-Type: application/json' -d '{"model":"legacy-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health" -H "Authorization: Bearer $FORBIDDEN_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["openai-prefixed-nano","global-mini"],"unhealthy":[]}
    
  5. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model_id=global-mini" -H "Authorization: Bearer $FORBIDDEN_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    

Unrestricted key whose alias hides a deployment

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $OPEN_ALIAS_KEY" -H 'Content-Type: application/json' -d '{"model":"claude-haiku-5-5","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $OPEN_ALIAS_KEY" -H 'Content-Type: application/json' -d '{"model":"anthropic-haiku","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: anthropic-haiku
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $OPEN_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini","openai-prefixed-nano","anthropic-haiku","openai-wildcard","shared-nano-premium","shared-nano-standard"],"unhealthy":[]}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model_id=anthropic-haiku" -H "Authorization: Bearer $OPEN_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["anthropic-haiku"],"unhealthy":[]}
    

Wildcard key

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $WILDCARD_KEY" -H 'Content-Type: application/json' -d '{"model":"openai/gpt-5.4-nano","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: openai-prefixed-nano
    
  2. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health" -H "Authorization: Bearer $WILDCARD_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["openai-wildcard"],"unhealthy":[]}
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model_id=openai-prefixed-nano" -H "Authorization: Bearer $WILDCARD_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"error":"key not allowed to health-check model_id openai-prefixed-nano"}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model=claude-haiku-5-5" -H "Authorization: Bearer $WILDCARD_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"message":"The requested model 'claude-haiku-5-5' is not available for this API key, or the model name is invalid. Check the models available to you and try again.","type":"key_model_access_denied","param":"model","code":"403"}
    

Access-group key

  1. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $GROUP_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["anthropic-haiku"],"unhealthy":[]}
    

Admin key

  1. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health" -H "Authorization: Bearer $MASTER_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini","openai-prefixed-nano","anthropic-haiku","openai-wildcard","shared-nano-premium","shared-nano-standard"],"unhealthy":[]}
    

Key alias

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $KEY_ALIAS_KEY" -H 'Content-Type: application/json' -d '{"model":"claude-haiku-5-5","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $KEY_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model_id=anthropic-haiku" -H "Authorization: Bearer $KEY_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"error":"key not allowed to health-check model_id anthropic-haiku"}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model=claude-haiku-5-5" -H "Authorization: Bearer $KEY_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"error":"key not allowed to health-check model claude-haiku-5-5"}
    

Team alias

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $TEAM_ALIAS_KEY" -H 'Content-Type: application/json' -d '{"model":"claude-haiku-5-5","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health" -H "Authorization: Bearer $TEAM_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini","openai-prefixed-nano","anthropic-haiku","openai-wildcard","shared-nano-premium","shared-nano-standard"],"unhealthy":[]}
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model_id=anthropic-haiku" -H "Authorization: Bearer $TEAM_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["anthropic-haiku"],"unhealthy":[]}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model=claude-haiku-5-5" -H "Authorization: Bearer $TEAM_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["anthropic-haiku"],"unhealthy":[]}
    

Router alias

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $ROUTER_ALIAS_KEY" -H 'Content-Type: application/json' -d '{"model":"claude-haiku-5-5","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $ROUTER_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model_id=anthropic-haiku" -H "Authorization: Bearer $ROUTER_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"error":"key not allowed to health-check model_id anthropic-haiku"}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model=claude-haiku-5-5" -H "Authorization: Bearer $ROUTER_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"message":"The requested model 'claude-haiku-5-5' is not available for this API key, or the model name is invalid. Check the models available to you and try again.","type":"key_model_access_denied","param":"model","code":"403"}
    

Key allows a retired name

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $STALE_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-4-retired","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $STALE_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $STALE_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["openai-prefixed-nano"],"unhealthy":[]}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model_id=global-mini" -H "Authorization: Bearer $STALE_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"error":"key not allowed to health-check model_id global-mini"}
    
  5. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model=gpt-4-retired" -H "Authorization: Bearer $STALE_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"error":"key not allowed to health-check model gpt-4-retired"}
    

Team allows a retired name

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $STALE_TEAM_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-4-retired","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $STALE_TEAM_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health" -H "Authorization: Bearer $STALE_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini","openai-prefixed-nano","anthropic-haiku","openai-wildcard","shared-nano-premium","shared-nano-standard"],"unhealthy":[]}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model_id=global-mini" -H "Authorization: Bearer $STALE_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    

Access-group key with a fallback

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $GROUP_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  2. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health" -H "Authorization: Bearer $GROUP_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["anthropic-haiku"],"unhealthy":[]}
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model_id=global-mini" -H "Authorization: Bearer $GROUP_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"error":"key not allowed to health-check model_id global-mini"}
    

Access group holds one of two

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $PREMIUM_KEY" -H 'Content-Type: application/json' -d '{"model":"shared-nano","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: shared-nano-premium
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $PREMIUM_KEY" -H 'Content-Type: application/json' -d '{"model":"shared-nano","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: shared-nano-premium
    
  3. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $PREMIUM_KEY" -H 'Content-Type: application/json' -d '{"model":"shared-nano","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: shared-nano-premium
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $PREMIUM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["shared-nano-premium","shared-nano-standard"],"unhealthy":[]}
    
  5. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model_id=shared-nano-standard" -H "Authorization: Bearer $PREMIUM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["shared-nano-standard"],"unhealthy":[]}
    
  6. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model=shared-nano" -H "Authorization: Bearer $PREMIUM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["shared-nano-premium","shared-nano-standard"],"unhealthy":[]}
    

Personal key whose owner may call only gpt-5.4-mini

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $OWNER_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $OWNER_KEY" -H 'Content-Type: application/json' -d '{"model":"openai/gpt-5.4-nano","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $OWNER_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini","openai-prefixed-nano","anthropic-haiku","openai-wildcard","shared-nano-premium","shared-nano-standard"],"unhealthy":[]}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model_id=openai-prefixed-nano" -H "Authorization: Bearer $OWNER_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["openai-prefixed-nano"],"unhealthy":[]}
    

Personal key whose owner may call only a wildcard-served name

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $OWNER_WILD_KEY" -H 'Content-Type: application/json' -d '{"model":"openai/gpt-5.6","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: openai-wildcard
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $OWNER_WILD_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $OWNER_WILD_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini","openai-prefixed-nano","anthropic-haiku","openai-wildcard","shared-nano-premium","shared-nano-standard"],"unhealthy":[]}
    

Agent key whose access group holds only gpt-5.4-mini

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $AGENT_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $AGENT_KEY" -H 'Content-Type: application/json' -d '{"model":"openai/gpt-5.4-nano","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health" -H "Authorization: Bearer $AGENT_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini","openai-prefixed-nano","anthropic-haiku","openai-wildcard","shared-nano-premium","shared-nano-standard"],"unhealthy":[]}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model_id=openai-prefixed-nano" -H "Authorization: Bearer $AGENT_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["openai-prefixed-nano"],"unhealthy":[]}
    

Background health checks

Both legs' outputs are in this gist

After (49efac1)

Team key, other steps

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $TEAM_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    

Team allows a wildcard-only name

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $WILD_TEAM_KEY" -H 'Content-Type: application/json' -d '{"model":"openai/gpt-5.6","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: openai-wildcard
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $WILD_TEAM_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $WILD_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["openai-wildcard"],"unhealthy":[]}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model_id=openai-wildcard" -H "Authorization: Bearer $WILD_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["openai-wildcard"],"unhealthy":[]}
    
  5. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model=openai/gpt-5.6" -H "Authorization: Bearer $WILD_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["openai-wildcard"],"unhealthy":[]}
    

Team allows a router alias

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $LEGACY_TEAM_KEY" -H 'Content-Type: application/json' -d '{"model":"legacy-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $LEGACY_TEAM_KEY" -H 'Content-Type: application/json' -d '{"model":"openai/gpt-5.4-nano","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health" -H "Authorization: Bearer $LEGACY_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model_id=global-mini" -H "Authorization: Bearer $LEGACY_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    
  5. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model=legacy-mini" -H "Authorization: Bearer $LEGACY_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    

Team allows its own alias

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $OWN_ALIAS_TEAM_KEY" -H 'Content-Type: application/json' -d '{"model":"my-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $OWN_ALIAS_TEAM_KEY" -H 'Content-Type: application/json' -d '{"model":"openai/gpt-5.4-nano","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $OWN_ALIAS_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model_id=global-mini" -H "Authorization: Bearer $OWN_ALIAS_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    

Key alias to a forbidden model

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $FORBIDDEN_ALIAS_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $FORBIDDEN_ALIAS_KEY" -H 'Content-Type: application/json' -d '{"model":"openai/gpt-5.4-nano","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: openai-prefixed-nano
    
  3. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $FORBIDDEN_ALIAS_KEY" -H 'Content-Type: application/json' -d '{"model":"legacy-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health" -H "Authorization: Bearer $FORBIDDEN_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini","openai-prefixed-nano"],"unhealthy":[]}
    
  5. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model_id=global-mini" -H "Authorization: Bearer $FORBIDDEN_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    

Unrestricted key whose alias hides a deployment

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $OPEN_ALIAS_KEY" -H 'Content-Type: application/json' -d '{"model":"claude-haiku-5-5","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $OPEN_ALIAS_KEY" -H 'Content-Type: application/json' -d '{"model":"anthropic-haiku","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: anthropic-haiku
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $OPEN_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini","openai-prefixed-nano","anthropic-haiku","openai-wildcard","shared-nano-premium","shared-nano-standard"],"unhealthy":[]}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model_id=anthropic-haiku" -H "Authorization: Bearer $OPEN_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["anthropic-haiku"],"unhealthy":[]}
    

Wildcard key

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $WILDCARD_KEY" -H 'Content-Type: application/json' -d '{"model":"openai/gpt-5.4-nano","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: openai-prefixed-nano
    
  2. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health" -H "Authorization: Bearer $WILDCARD_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini","openai-prefixed-nano","openai-wildcard"],"unhealthy":[]}
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model_id=openai-prefixed-nano" -H "Authorization: Bearer $WILDCARD_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["openai-prefixed-nano"],"unhealthy":[]}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model=claude-haiku-5-5" -H "Authorization: Bearer $WILDCARD_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"message":"The requested model 'claude-haiku-5-5' is not available for this API key, or the model name is invalid. Check the models available to you and try again.","type":"key_model_access_denied","param":"model","code":"403"}
    

Access-group key

  1. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $GROUP_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["anthropic-haiku"],"unhealthy":[]}
    

Admin key

  1. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health" -H "Authorization: Bearer $MASTER_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini","openai-prefixed-nano","anthropic-haiku","openai-wildcard","shared-nano-premium","shared-nano-standard"],"unhealthy":[]}
    

Key alias

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $KEY_ALIAS_KEY" -H 'Content-Type: application/json' -d '{"model":"claude-haiku-5-5","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $KEY_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model_id=anthropic-haiku" -H "Authorization: Bearer $KEY_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"error":"key not allowed to health-check model_id anthropic-haiku"}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model=claude-haiku-5-5" -H "Authorization: Bearer $KEY_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    

Team alias

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $TEAM_ALIAS_KEY" -H 'Content-Type: application/json' -d '{"model":"claude-haiku-5-5","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health" -H "Authorization: Bearer $TEAM_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model_id=anthropic-haiku" -H "Authorization: Bearer $TEAM_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"error":"key not allowed to health-check model_id anthropic-haiku"}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model=claude-haiku-5-5" -H "Authorization: Bearer $TEAM_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    

Router alias

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $ROUTER_ALIAS_KEY" -H 'Content-Type: application/json' -d '{"model":"claude-haiku-5-5","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $ROUTER_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model_id=anthropic-haiku" -H "Authorization: Bearer $ROUTER_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"error":"key not allowed to health-check model_id anthropic-haiku"}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model=claude-haiku-5-5" -H "Authorization: Bearer $ROUTER_ALIAS_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"message":"The requested model 'claude-haiku-5-5' is not available for this API key, or the model name is invalid. Check the models available to you and try again.","type":"key_model_access_denied","param":"model","code":"403"}
    

Key allows a retired name

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $STALE_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-4-retired","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $STALE_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $STALE_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["openai-prefixed-nano"],"unhealthy":[]}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model_id=global-mini" -H "Authorization: Bearer $STALE_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"error":"key not allowed to health-check model_id global-mini"}
    
  5. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model=gpt-4-retired" -H "Authorization: Bearer $STALE_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"error":"key not allowed to health-check model gpt-4-retired"}
    

Team allows a retired name

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $STALE_TEAM_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-4-retired","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $STALE_TEAM_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health" -H "Authorization: Bearer $STALE_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["openai-prefixed-nano"],"unhealthy":[]}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model_id=global-mini" -H "Authorization: Bearer $STALE_TEAM_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"error":"key not allowed to health-check model_id global-mini"}
    

Access-group key with a fallback

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $GROUP_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  2. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health" -H "Authorization: Bearer $GROUP_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["anthropic-haiku"],"unhealthy":[]}
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model_id=global-mini" -H "Authorization: Bearer $GROUP_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"error":"key not allowed to health-check model_id global-mini"}
    

Access group holds one of two

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $PREMIUM_KEY" -H 'Content-Type: application/json' -d '{"model":"shared-nano","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: shared-nano-premium
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $PREMIUM_KEY" -H 'Content-Type: application/json' -d '{"model":"shared-nano","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: shared-nano-premium
    
  3. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $PREMIUM_KEY" -H 'Content-Type: application/json' -d '{"model":"shared-nano","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: shared-nano-premium
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $PREMIUM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["shared-nano-premium"],"unhealthy":[]}
    
  5. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model_id=shared-nano-standard" -H "Authorization: Bearer $PREMIUM_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"error":"key not allowed to health-check model_id shared-nano-standard"}
    
  6. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model=shared-nano" -H "Authorization: Bearer $PREMIUM_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["shared-nano-premium"],"unhealthy":[]}
    

Personal key whose owner may call only gpt-5.4-mini

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $OWNER_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $OWNER_KEY" -H 'Content-Type: application/json' -d '{"model":"openai/gpt-5.4-nano","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $OWNER_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health?model_id=openai-prefixed-nano" -H "Authorization: Bearer $OWNER_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"error":"key not allowed to health-check model_id openai-prefixed-nano"}
    

Personal key whose owner may call only a wildcard-served name

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $OWNER_WILD_KEY" -H 'Content-Type: application/json' -d '{"model":"openai/gpt-5.6","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: openai-wildcard
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $OWNER_WILD_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health" -H "Authorization: Bearer $OWNER_WILD_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["openai-wildcard"],"unhealthy":[]}
    

Agent key whose access group holds only gpt-5.4-mini

  1. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $B/chat/completions -H "Authorization: Bearer $AGENT_KEY" -H 'Content-Type: application/json' -d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 200  x-litellm-model-id: global-mini
    
  2. curl -s -o /dev/null -w 'HTTP %{http_code} x-litellm-model-id: %header{x-litellm-model-id}\n' $A/chat/completions -H "Authorization: Bearer $AGENT_KEY" -H 'Content-Type: application/json' -d '{"model":"openai/gpt-5.4-nano","messages":[{"role":"user","content":"say ok"}],"max_completion_tokens":16}'

    HTTP 403  x-litellm-model-id:
    
  3. curl -s -o h.json -w 'HTTP %{http_code} ' "$A/health" -H "Authorization: Bearer $AGENT_KEY"; jq -c "$IDS" h.json

    HTTP 200  {"healthy":["global-mini"],"unhealthy":[]}
    
  4. curl -s -o h.json -w 'HTTP %{http_code} ' "$B/health?model_id=openai-prefixed-nano" -H "Authorization: Bearer $AGENT_KEY"; jq -c "$IDS" h.json

    HTTP 403  {"error":"key not allowed to health-check model_id openai-prefixed-nano"}
    

Background health checks

Both legs' outputs are in this gist

Observed during the run

  • Global alias legacy-mini reaches global-mini past a key alias
  • openai/* key chats with bare gpt-5.4-mini, so /health lists it
/live-pr-risk at 49efac1

Every cell ran on both legs against real proxies, Postgres, Redis, and real OpenAI and Anthropic calls, with outputs above and in the gist

Breaking

  • An agent key that sent an unknown x-litellm-user-id got 500 from /health at c6f1dce, where chat answers 401. It gets 401 now, fixed in 5166ba9
  • Two existing unit tests called the health helper without its new argument, fixed in 23377f3
  • An agent key that sends an unknown x-litellm-team-id now gets 404 from /health where base answered 200. Chat answers 404 the same way, which is the auth parity mateo-berri asked for in the ticket this PR resolves

Backward incompatible

  • A scoped ?model= check was saved under the served group's name at c6f1dce, which moved /health/history and /health/latest. It is saved under the requested name again, fixed in 5166ba9
  • Team, user, and agent keys now see fewer deployments in /health, the intended change mateo-berri asked for in the ticket
  • A wildcard key's /health admits more ?model= values and probes every deployment its pattern reaches, as the same ticket from mateo-berri asks
  • alias_map now takes any read-only mapping. Every load path still hands it a dict, so no caller sees a difference, kept by mateo-berri as a Low caveat
  • The /health docs page still describes the old scoping. A litellm-docs update is filed as a follow-up by mateo-berri

Regression risk

  • /health now runs chat's database lookups, so a database fault after key auth fails the call the way it fails chat. A live outage cell failed at key auth on both legs, with no head-only 500
  • Each non-admin call checks its candidate names one by one. At 2,215 deployments it added about 0.1 to 0.25 s per call, while an unfiltered team-key call went from 38.6 s and 2,006 provider calls to 1.06 s and 1
  • The agent refactor runs team alias resolution on every request with a team. It cannot raise, and chat through key and team aliases answered the same on both legs
  • The router lookups /health uses are main's public registry API since refactor(router): move router callers onto the entry points and invert the proxy imports #48847, so this PR no longer changes the router

Dependency graph

Dependent Entry Status
Team key GET /health Live, tested
Wildcard key GET /health Live, tested
Agent key and caller headers GET /health Live, tested
Background cache GET /health Live, tested
?model= target GET /health Live, tested
Health history rows /health/history Live
Latest results /health/latest Live
Model hub badge /public/model_hub Live
Dashboard Health tab ?model_id= Traced
Key and team alias chat /chat/completions Live, tested
Model listing GET /v1/models Live, tested
Single model info /v1/models/{id} Traced
Realtime auth websocket Tested
Database outage GET /health Live
Large deployment lists GET /health Live
Provider probe count upstream Live
Docs page docs site Stale

Not verified

  • Database faults on one table after key auth passes, which needs a table-level fault on a rig
  • Database reads per call, since the shared Postgres has no per-database pg_stat_statements
  • Managed agent grants, covered by unit tests only
  • The dashboard Health tab and the docs page, traced and read but not loaded
  • A real provider realtime session, beyond the 127 websocket rejection cases in the legacy suite
  • The legacy integration lane at 49efac1, which last ran at c6f1dce with no head-only red
  • Main moved to 4ce724e after the base and merges clean, with none of this PR's files changed there

Type

🐛 Bug Fix
✅ Test

Caveats (if any)

Medium

  • A non-admin /health call costs about 0.2 s of CPU at 2,000 deployments, or 1.4 s when a team lists all 2,000
  • ?model= still answers 403 for a name only a router alias serves, as before
  • /health still skips tag, region, and pause filters, as before

Low

  • /health leaves out the default_fallbacks target, since listing it lets any key holding a retired name probe the catch-all, and a 403 breaks monitors
  • A wildcard key's /health now makes a billed probe of every deployment its pattern reaches
  • ?model= answers 200 for some names the key can't chat with, but probes only reachable deployments
  • A wildcard deployment probes its admin-set health_check_model
  • alias_map takes any read-only mapping
  • The required unit check failed 6 otel tests at 49efac1, as on main until test(otel): fix main's Langfuse destination tests after the stdout opt-in change #49129 fixed them
  • rust-test fails as it does on main

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR
Bugbot summary

[!NOTE]
Medium Risk
Authorization behavior on /health changes materially (including fewer deployments for restricted keys and more probes for wildcards), with per-request auth work that can add latency on large routers.

Overview
/health no longer lists or probes deployments from literal key model names alone. It builds a reachable set by running the same key, team, user, and agent checks as chat (plus aliases, wildcards, access groups, and routing), yields between checks, returns 403 before any provider probe when model / model_id is out of scope, and filters background-cache results the same way. Admin keys with an unrestricted model list still see everything.

Supporting changes: public agent_model_grants and refactored agent access-group ceiling resolution; auth_failure_as_proxy_exception (renamed from _as_proxy_exception) reused when health scoping hits auth errors; dispatched_model and a non-strict alias_map for key aliases; recorded_model_name so health history keeps the caller’s requested name when an alias redirects the probe.

Extensive unit tests cover wildcards, team limits, aliases, owners, managed agents, access groups, and cache paths.

Reviewed by Cursor Bugbot for commit 49efac1. Bugbot is set up for automated code reviews on this repo. Configure here.

@mateo-berri

Copy link
Copy Markdown
Contributor Author

@litellm-stampbot

@kerry-berri

kerry-berri commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

litellm-stampbot: risk low

Approved at 6803894.

Rules (stampbot/risk_rules.yml):

  • low: 0 changed source lines (only tests, docs, cookbook, markdown or the cost map changed), approved without asking Bugbot or the judge

Judge: skipped, the rules alone decided.

Pushes do not re-run this check. Comment @litellm-stampbot again to re-check the new head.

@kerry-berri kerry-berri added the risk:low Small, isolated, low-risk change label Oct 21, 2026

@kerry-berri kerry-berri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low risk by rule and by judgement at 6803894

@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.87500% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...itellm/proxy/health_endpoints/_health_endpoints.py 96.24% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 38 untouched benchmarks


Comparing litellm_health_scope_like_auth (49efac1) with main (d884167)

Open in CodSpeed


async def _key_may_call_model(model_name: str, user_api_key_dict: UserAPIKeyAuth, llm_router: Router | None) -> bool:
try:
await can_key_call_resolved_model(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium: Alias authorization admits the wrong deployment

For a key with models=["cheap"] and aliases={"expensive":"cheap"}, this helper authorizes expensive by checking cheap, but the health endpoint retains the real expensive deployment: its holder can now use GET /health to probe that deployment with stored credentials or retrieve its cached health data, whereas inference rewrites the request to cheap and the previous health filter excluded expensive. Resolve aliases before selecting deployments and scope both live probes and cached results to the authorized target, rather than treating authorization of an alias as permission to probe the deployment it shadows.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 4f15b37. /health now keeps only the model group an allowed name routes to, so the shadowed deployment is hidden and refused

@veria-ai

veria-ai Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

PR overview

The PR updates /health deployment filtering to apply wildcard key permissions and team model allowlists in line with authentication behavior.

One open issue remains in alias handling: authorization checks the allowed alias target but retains the original deployment. This lets a key holder trigger health probes using stored credentials or retrieve cached health data for a deployment outside their allowed target. No issues have been addressed yet.

Open issues (1)

Fixed/addressed: 0 · PR risk: 5/10

@mateo-berri

Copy link
Copy Markdown
Contributor Author

@litereview code-review

@litereview

litereview Bot commented Oct 21, 2026

Copy link
Copy Markdown

✅ code-review

5/5 · Ready for human review

Scope: full · Full PR review.

No correctness findings.

I traced /health through both the live-probe path and the background-cache path. Both now filter through can_key_call_resolved_model, the same check that chat requests use in common_request_processing.py. The tests cover wildcard keys, team allowlists, and a 403 for a forbidden model_id that never reaches the provider probe.

Checks and execution details
  • Passed · Real testing evidence (required): Not applicable: no LLM translation changes in the scoped paths. The PR changes only litellm/proxy/health_endpoints/_health_endpoints.py and tests/unit/proxy/health_endpoints/test_health_endpoints.py. Neither file is under litellm/llms/** or litellm/litellm_core_utils/prompt_templates/**.

  • Passed · Compatibility requirements (required): Here are the before/after results, traced through the code and confirmed by the PR's live capture.

  • Team key, model outside the team allowlist: before, GET /health?model_id=&lt;forbidden> returned 200 and ran a billed probe. Now it returns 403 with no probe.

  • Wildcard key openai/*: before, it got an empty list. Now it sees the deployments it can call.

  • Admin keys with no model list: no change, because restrict_to_allowed_models is still false.

  • Unrestricted non-admin keys: they still pass can_key_call_model and can_team_access_model, so their visibility is the same.

The only inputs that newly fail let a key probe models that auth already refuses for chat. The endpoint's own docstring calls this "same deployment visibility rule as routing", so this is an authorization fix, not a supported behavior being removed. No ! marker is needed.

  • Passed · Changed behavior and result consistency (required): Standards I read: root and tests/unit/AGENTS.md guidance as listed in review-context.json.

Path I traced: health_endpoint → _key_models_unrestricted → _model_names_key_may_call. That function collects each distinct model_name, plus the team_public_model_name when the deployment belongs to the caller's team, and checks each one with can_key_call_resolved_model. That check covers key models, access groups, access_group_ids, the team allowlist with key access-group fallback, member access, personal-key team grants, project limits, and end-user limits. Next comes _caller_may_probe_deployment, which runs deployment_usable_by_team and then intersects the names. After that, _resolve_targeted_model_ids returns a 403 when nothing matches. Finally, either _perform_health_check_and_save runs or the background cache is filtered by allowed_model_ids or targeted_ids.

Boundary cases I checked:

  • Admin with no models: unrestricted.
  • Admin with restricted models: the team visibility check is skipped, as before.
  • Wildcard deployment name openai/* with a concrete key model: excluded both before and after.
  • Another team's deployment: excluded by deployment_usable_by_team.
  • A team lookup failure falls back to the token's team_models. Any error other than a ProxyException propagates and fails the request rather than widening access.

Test run: .venv/bin/python -m pytest tests/unit/proxy/health_endpoints/test_health_endpoints.py -q gave 295 passed. That includes the new parametrized wildcard and team-allowlist cases on the live and background paths, and the assertion that a forbidden model_id gets a 403 and _perform_health_check_and_save is never awaited.

  • Passed · Health endpoint unit suite (optional): tests/unit/proxy/health_endpoints/test_health_endpoints.py: 295 passed in 19.62s at head 3c862ef.

View review · Reviewed 3c862ef5ab40

A key alias, team alias, or router model_group_alias lets auth admit a
requested name by checking its target, so /health also kept the deployment
under the requested name, one the key's requests never reach. Keep only the
served model group each admitted name dispatches to, through the same alias
layers /v1/models mirrors, and let alias_map read its own read-only output.
@mateo-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with no confirmed new blocking issues or outstanding numbered findings

Summary

/health now checks which deployments the caller can reach instead of matching literal key model names

  • Health checks now follow the models each caller can reach.

No new actionable issues were confirmed. The previous wildcard finding was cleared because chat follows the same early-return path

Reviews (8) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

…like_auth

# Conflicts:
#	litellm/proxy/health_endpoints/_health_endpoints.py
… grant, and keep access-group keys to their group's deployments
@mateo-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@mateo-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@mateo-berri mateo-berri changed the title fix(proxy): scope /health by wildcard keys and team model allowlists the way auth does fix(proxy)!: scope /health by wildcard keys and team model allowlists the way auth does Oct 29, 2026
…tween checks

/health now runs the same user and agent model checks chat runs, so a personal
key whose owner may call only some models, or an agent key limited by its access
group, no longer sees or probes other deployments. Each per-name check yields to
the event loop, and ?model= reaches the wildcard deployment serving an allowed name
@mateo-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@mateo-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@mateo-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@mateo-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@mateo-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

…like_auth

# Conflicts:
#	litellm/proxy/health_endpoints/_health_endpoints.py
#	tests/code_coverage_tests/router_surface_allowlist.json
@mateo-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@mateo-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 49efac1. Configure here.

@mateo-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@mateo-berri
mateo-berri deleted the litellm_health_scope_like_auth branch October 30, 2026 00:53
@mateo-berri

Copy link
Copy Markdown
Contributor Author

Superseded by #49155, which carries this branch at the same commit so it can get the one approval main requires

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:low Small, isolated, low-risk change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants