Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

[Fix] GEMINI - CLI - add google_routes to llm_api_routes (#15500)

Ishaan Jafff13eb283e199
diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py
index 41b36d46c75..d205d73da8e 100644
--- a/litellm/proxy/_types.py
+++ b/litellm/proxy/_types.py
@@ -377,6 +377,7 @@ class LiteLLMRoutes(enum.Enum):
llm_api_routes = (
openai_routes
+ anthropic_routes
+ + google_routes
+ mapped_pass_through_routes
+ passthrough_routes_wildcard
+ apply_guardrail_routes
diff --git a/tests/test_litellm/proxy/auth/test_route_checks.py b/tests/test_litellm/proxy/auth/test_route_checks.py
index 0c72c8bb163..7d00b812a5c 100644
--- a/tests/test_litellm/proxy/auth/test_route_checks.py
+++ b/tests/test_litellm/proxy/auth/test_route_checks.py
@@ -156,6 +156,31 @@ def test_virtual_key_llm_api_route_includes_passthrough_prefix(route):
assert result is True
+ "route",
+ [
+ "/v1beta/models/gemini-2.5-flash:countTokens",
+ "/v1beta/models/gemini-2.0-flash:generateContent",
+ "/v1beta/models/gemini-1.5-pro:streamGenerateContent",
+ "/models/gemini-2.5-flash:countTokens",
+ "/models/gemini-2.0-flash:generateContent",
+ "/models/gemini-1.5-pro:streamGenerateContent",
+ ],
+)
+def test_virtual_key_llm_api_routes_allows_google_routes(route):
+ """
+ Test that virtual keys with llm_api_routes permission can access Google AI Studio routes.
+ """
+
+ valid_token = UserAPIKeyAuth(user_id="test_user", allowed_routes=["llm_api_routes"])
+
+ result = RouteChecks.is_virtual_key_allowed_to_call_route(
+ route=route, valid_token=valid_token
+ )
+
+ assert result is True
+
+
def test_virtual_key_allowed_routes_with_multiple_litellm_routes_member_names():
"""Test that virtual key works with multiple LiteLLMRoutes member names in allowed_routes"""