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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix(registry): add vertex veo 3.1 resolution tier pricing per vertex pricing page
mateo-berri06d4521fc0b7
diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.jsonindex dd45495884d..2cfa1f93f79 100644--- a/litellm/model_prices_and_context_window_backup.json+++ b/litellm/model_prices_and_context_window_backup.json@@ -43509,7 +43509,8 @@"max_tokens": 1024,"mode": "video_generation","output_cost_per_second": 0.4,- "source": "https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/veo/3-1-generate",+ "output_cost_per_second_4k": 0.6,+ "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing","supported_modalities": ["text"],@@ -43523,6 +43524,8 @@"max_tokens": 1024,"mode": "video_generation","output_cost_per_second": 0.1,+ "output_cost_per_second_1080p": 0.12,+ "output_cost_per_second_4k": 0.3,"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing","supported_modalities": ["text"@@ -43538,7 +43541,8 @@"max_tokens": 1024,"mode": "video_generation","output_cost_per_second": 0.4,- "source": "https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/veo/3-1-generate",+ "output_cost_per_second_4k": 0.6,+ "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing","supported_modalities": ["text"],@@ -43553,6 +43557,8 @@"max_tokens": 1024,"mode": "video_generation","output_cost_per_second": 0.1,+ "output_cost_per_second_1080p": 0.12,+ "output_cost_per_second_4k": 0.3,"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing","supported_modalities": ["text"diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.jsonindex dd45495884d..2cfa1f93f79 100644--- a/model_prices_and_context_window.json+++ b/model_prices_and_context_window.json@@ -43509,7 +43509,8 @@"max_tokens": 1024,"mode": "video_generation","output_cost_per_second": 0.4,- "source": "https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/veo/3-1-generate",+ "output_cost_per_second_4k": 0.6,+ "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing","supported_modalities": ["text"],@@ -43523,6 +43524,8 @@"max_tokens": 1024,"mode": "video_generation","output_cost_per_second": 0.1,+ "output_cost_per_second_1080p": 0.12,+ "output_cost_per_second_4k": 0.3,"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing","supported_modalities": ["text"@@ -43538,7 +43541,8 @@"max_tokens": 1024,"mode": "video_generation","output_cost_per_second": 0.4,- "source": "https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/veo/3-1-generate",+ "output_cost_per_second_4k": 0.6,+ "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing","supported_modalities": ["text"],@@ -43553,6 +43557,8 @@"max_tokens": 1024,"mode": "video_generation","output_cost_per_second": 0.1,+ "output_cost_per_second_1080p": 0.12,+ "output_cost_per_second_4k": 0.3,"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing","supported_modalities": ["text"diff --git a/tests/test_litellm/test_video_generation.py b/tests/test_litellm/test_video_generation.pyindex b166e902d6e..2a60ff9c4b5 100644--- a/tests/test_litellm/test_video_generation.py+++ b/tests/test_litellm/test_video_generation.py@@ -532,6 +532,41 @@ class TestVideoGeneration:assert abs(cost_for("runwayml/seedance2_5", "480p", 8.0) - 1.6) < 0.001assert abs(cost_for("runwayml/gen4.5", None, 8.0) - 0.96) < 0.001+ def test_completion_cost_veo_31_tiers_pin_published_rates(self, monkeypatch):+ """The gemini and vertex_ai veo 3.1 entries bill Google's published per-second tier rates."""+ from litellm.cost_calculator import completion_cost++ local_map_path = os.path.join(+ os.path.dirname(__file__), "..", "..", "model_prices_and_context_window.json"+ )+ with open(local_map_path, "r") as f:+ monkeypatch.setattr(litellm, "model_cost", json.load(f))++ def cost_for(model: str, provider: str, resolution: str | None, duration: float) -> float:+ mock_response = MagicMock()+ mock_response.usage = {+ "duration_seconds": duration,+ **({"video_resolution": resolution} if resolution else {}),+ }+ type(mock_response)._hidden_params = {}+ return completion_cost(+ completion_response=mock_response,+ model=model,+ call_type="create_video",+ custom_llm_provider=provider,+ )++ for provider in ("gemini", "vertex_ai"):+ for suffix in ("generate-preview", "generate-001"):+ standard = f"{provider}/veo-3.1-{suffix}"+ fast = f"{provider}/veo-3.1-fast-{suffix}"+ assert abs(cost_for(standard, provider, None, 8.0) - 3.2) < 1e-6+ assert abs(cost_for(standard, provider, "1080p", 8.0) - 3.2) < 1e-6+ assert abs(cost_for(standard, provider, "4k", 8.0) - 4.8) < 1e-6+ assert abs(cost_for(fast, provider, "720p", 8.0) - 0.8) < 1e-6+ assert abs(cost_for(fast, provider, "1080p", 8.0) - 0.96) < 1e-6+ assert abs(cost_for(fast, provider, "4k", 8.0) - 2.4) < 1e-6+def test_video_generation_with_files(self):"""Test video generation with file uploads."""config = OpenAIVideoConfig()