From 62187103b42aa8a813ae8c712db443fb2c664290 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 14 Jan 2026 15:14:03 -0800 Subject: [PATCH] [Fix] Containers API - Container API routes return 401 for non-admin users - routes missing from openai_routes (#19115) * test_containers_routes_are_llm_api_routes * allow /containers/* API --- litellm/proxy/_types.py | 4 ++++ .../proxy/auth/test_route_checks.py | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py index a1186f8e372..be5d0331df6 100644 --- a/litellm/proxy/_types.py +++ b/litellm/proxy/_types.py @@ -360,6 +360,10 @@ class LiteLLMRoutes(enum.Enum): # OCR "/ocr", "/v1/ocr", + + # containers API + "/containers/*", + "/v1/containers/*", ] mapped_pass_through_routes = [ diff --git a/tests/test_litellm/proxy/auth/test_route_checks.py b/tests/test_litellm/proxy/auth/test_route_checks.py index ef7f2f3c30d..04f973e9f86 100644 --- a/tests/test_litellm/proxy/auth/test_route_checks.py +++ b/tests/test_litellm/proxy/auth/test_route_checks.py @@ -732,6 +732,25 @@ def test_videos_route_is_llm_api_route(route): assert RouteChecks.is_llm_api_route(route) is True +@pytest.mark.parametrize( + "route", + [ + "/containers", + "/v1/containers", + "/containers/container_123", + "/v1/containers/container_123", + "/containers/container_123/files", + "/v1/containers/container_123/files", + "/containers/container_123/files/file_456", + "/v1/containers/container_123/files/file_456", + ], +) +def test_containers_routes_are_llm_api_routes(route): + """Test that container routes are recognized as LLM API routes""" + + assert RouteChecks.is_llm_api_route(route) is True + + def test_videos_route_accessible_to_internal_users(): """ Test that internal users can access the videos routes.