diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index bebbcc321814..7373ffd85979 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -12595,7 +12595,8 @@ "us": 1.1 }, "supports_output_config": true, - "prompt_cache_min_tokens": 1024 + "prompt_cache_min_tokens": 1024, + "source": "https://docs.anthropic.com/en/docs/about-claude/models/overview" }, "claude-sonnet-4-6": { "deprecation_date": "2027-02-17", @@ -12997,7 +12998,8 @@ }, "supports_output_config": true, "prompt_cache_min_tokens": 512, - "supports_native_structured_output": true + "supports_native_structured_output": true, + "source": "https://docs.anthropic.com/en/docs/about-claude/models/overview" }, "claude-opus-5": { "deprecation_date": "2027-07-24", @@ -13037,7 +13039,8 @@ }, "supports_output_config": true, "supports_speed": true, - "prompt_cache_min_tokens": 512 + "prompt_cache_min_tokens": 512, + "source": "https://docs.anthropic.com/en/docs/about-claude/models/overview" }, "claude-opus-4-8": { "deprecation_date": "2027-05-28", @@ -20562,7 +20565,8 @@ "output_cost_per_token": 2e-06, "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", "supported_endpoints": [ - "/vertex_ai/live" + "/vertex_ai/live", + "/v1/realtime" ], "supported_modalities": [ "text", @@ -22015,6 +22019,49 @@ }, "web_search_billing_unit": "per_query" }, + "gemini/nano-banana-pro-preview": { + "input_cost_per_image": 0.0011, + "input_cost_per_token": 2e-06, + "input_cost_per_token_batches": 1e-06, + "litellm_provider": "gemini", + "max_input_tokens": 131072, + "max_output_tokens": 32768, + "max_tokens": 32768, + "mode": "image_generation", + "output_cost_per_image": 0.134, + "output_cost_per_image_token": 0.00012, + "output_cost_per_token": 1.2e-05, + "rpm": 1000, + "tpm": 4000000, + "output_cost_per_token_batches": 6e-06, + "source": "https://ai.google.dev/gemini-api/docs/pricing", + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/completions", + "/v1/batch" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text", + "image" + ], + "supports_function_calling": false, + "supports_prompt_caching": true, + "supports_reasoning": false, + "supports_response_schema": true, + "supports_system_messages": true, + "supports_vision": true, + "supports_web_search": true, + "search_context_cost_per_query": { + "search_context_size_low": 0.014, + "search_context_size_medium": 0.014, + "search_context_size_high": 0.014 + }, + "web_search_billing_unit": "per_query" + }, "gemini/gemini-3.1-flash-image": { "input_cost_per_token": 5e-07, "input_cost_per_token_batches": 2.5e-07, @@ -23047,7 +23094,8 @@ "supports_system_messages": true, "supports_video_input": true, "supports_vision": true, - "tpm": 800000 + "tpm": 800000, + "deprecation_date": "2026-09-30" }, "gemini/gemini-3.1-pro-preview": { "prompt_cache_min_tokens": 4096, @@ -23558,6 +23606,38 @@ "supports_tool_choice": true, "supports_vision": true }, + "gemini/gemma-4-26b-a4b-it": { + "input_cost_per_token": 0.0, + "output_cost_per_token": 0.0, + "litellm_provider": "gemini", + "max_input_tokens": 262144, + "max_output_tokens": 32768, + "max_tokens": 32768, + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_system_messages": true, + "supports_tool_choice": true, + "supports_vision": true, + "source": "https://ai.google.dev/gemini-api/docs/pricing" + }, + "gemini/gemma-4-31b-it": { + "input_cost_per_token": 0.0, + "output_cost_per_token": 0.0, + "litellm_provider": "gemini", + "max_input_tokens": 262144, + "max_output_tokens": 32768, + "max_tokens": 32768, + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_system_messages": true, + "supports_tool_choice": true, + "supports_vision": true, + "source": "https://ai.google.dev/gemini-api/docs/pricing" + }, "gemini/imagen-3.0-fast-generate-001": { "litellm_provider": "gemini", "mode": "image_generation", @@ -26097,7 +26177,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "low/1024-x-1536/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.013, @@ -26108,7 +26189,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "low/1536-x-1024/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.013, @@ -26119,7 +26201,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "medium/1024-x-1024/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.034, @@ -26130,7 +26213,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "medium/1024-x-1536/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.05, @@ -26141,7 +26225,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "medium/1536-x-1024/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.05, @@ -26152,7 +26237,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "high/1024-x-1024/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.133, @@ -26163,7 +26249,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "high/1024-x-1536/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.2, @@ -26174,7 +26261,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "high/1536-x-1024/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.2, @@ -26185,7 +26273,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "standard/1024-x-1024/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.009, @@ -26196,7 +26285,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "standard/1024-x-1536/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.013, @@ -26207,7 +26297,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "standard/1536-x-1024/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.013, @@ -26218,7 +26309,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "1024-x-1024/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.009, @@ -26229,7 +26321,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "1024-x-1536/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.013, @@ -26240,7 +26333,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "1536-x-1024/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.013, @@ -26251,7 +26345,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "gpt-5": { "cache_read_input_token_cost": 1.25e-07, @@ -38941,14 +39036,14 @@ "source": "https://docs.together.ai/docs/serverless-models" }, "together_ai/Qwen/Qwen3.8-2.4T-A95B": { - "cache_read_input_token_cost": 2.5e-07, - "input_cost_per_token": 2e-06, + "cache_read_input_token_cost": 5e-07, + "input_cost_per_token": 2.5e-06, "litellm_provider": "together_ai", "max_input_tokens": 1010000, "max_output_tokens": 1010000, "max_tokens": 1010000, "mode": "chat", - "output_cost_per_token": 6e-06, + "output_cost_per_token": 6.25e-06, "source": "https://docs.together.ai/docs/serverless-models", "supports_prompt_caching": true }, @@ -39186,6 +39281,23 @@ "supports_response_schema": true, "supports_tool_choice": true }, + "together_ai/zai-org/GLM-5.3": { + "cache_read_input_token_cost": 2.6e-07, + "input_cost_per_token": 1.4e-06, + "litellm_provider": "together_ai", + "max_input_tokens": 1048575, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 4.4e-06, + "source": "https://docs.together.ai/docs/serverless-models", + "supports_function_calling": true, + "supports_parallel_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true + }, "together_ai/zai-org/GLM-5.3-Flash": { "cache_read_input_token_cost": 3e-08, "input_cost_per_token": 1.5e-07, @@ -44001,287 +44113,335 @@ ] }, "xai/grok-3": { - "cache_read_input_token_cost": 7.5e-07, - "input_cost_per_token": 3e-06, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 1.5e-05, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_response_schema": false, "supports_tool_choice": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-beta": { - "cache_read_input_token_cost": 7.5e-07, - "input_cost_per_token": 3e-06, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 1.5e-05, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_response_schema": false, "supports_tool_choice": true, - "supports_web_search": true + "supports_web_search": true, + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-fast-beta": { - "cache_read_input_token_cost": 1.25e-06, - "input_cost_per_token": 5e-06, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 2.5e-05, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_response_schema": false, "supports_tool_choice": true, - "supports_web_search": true + "supports_web_search": true, + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-fast-latest": { - "cache_read_input_token_cost": 1.25e-06, - "input_cost_per_token": 5e-06, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 2.5e-05, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_response_schema": false, "supports_tool_choice": true, - "supports_web_search": true + "supports_web_search": true, + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-latest": { - "cache_read_input_token_cost": 7.5e-07, - "input_cost_per_token": 3e-06, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 1.5e-05, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_response_schema": false, "supports_tool_choice": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-mini": { - "cache_read_input_token_cost": 7.5e-08, + "cache_read_input_token_cost": 2e-07, "deprecation_date": "2026-02-28", - "input_cost_per_token": 3e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 5e-07, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_reasoning": true, "supports_response_schema": false, "supports_tool_choice": true, - "supports_web_search": true + "supports_web_search": true, + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-mini-beta": { - "cache_read_input_token_cost": 7.5e-08, + "cache_read_input_token_cost": 2e-07, "deprecation_date": "2026-02-28", - "input_cost_per_token": 3e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 5e-07, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_reasoning": true, "supports_response_schema": false, "supports_tool_choice": true, - "supports_web_search": true + "supports_web_search": true, + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-mini-fast": { - "cache_read_input_token_cost": 1.5e-07, - "input_cost_per_token": 6e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 4e-06, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_reasoning": true, "supports_response_schema": false, "supports_tool_choice": true, - "supports_web_search": true + "supports_web_search": true, + "deprecation_date": "2026-02-28", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-mini-fast-beta": { - "cache_read_input_token_cost": 1.5e-07, - "input_cost_per_token": 6e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 4e-06, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_reasoning": true, "supports_response_schema": false, "supports_tool_choice": true, - "supports_web_search": true + "supports_web_search": true, + "deprecation_date": "2026-02-28", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-mini-fast-latest": { - "cache_read_input_token_cost": 1.5e-07, - "input_cost_per_token": 6e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 4e-06, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_reasoning": true, "supports_response_schema": false, "supports_tool_choice": true, - "supports_web_search": true + "supports_web_search": true, + "deprecation_date": "2026-02-28", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-mini-latest": { - "cache_read_input_token_cost": 7.5e-08, - "input_cost_per_token": 3e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 5e-07, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_reasoning": true, "supports_response_schema": false, "supports_tool_choice": true, - "supports_web_search": true + "supports_web_search": true, + "deprecation_date": "2026-02-28", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4": { - "input_cost_per_token": 3e-06, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 256000, "max_output_tokens": 256000, "max_tokens": 256000, "mode": "chat", - "output_cost_per_token": 1.5e-05, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models", "supports_function_calling": true, "supports_prompt_caching": true, "supports_tool_choice": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4-fast-reasoning": { - "cache_read_input_token_cost": 5e-08, - "input_cost_per_token": 2e-07, - "input_cost_per_token_above_128k_tokens": 4e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 2000000.0, "max_output_tokens": 2000000.0, "max_tokens": 2000000.0, "mode": "chat", - "output_cost_per_token": 5e-07, - "output_cost_per_token_above_128k_tokens": 1e-06, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models", "supports_function_calling": true, "supports_prompt_caching": true, "supports_tool_choice": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4-fast-non-reasoning": { - "cache_read_input_token_cost": 5e-08, - "input_cost_per_token": 2e-07, - "input_cost_per_token_above_128k_tokens": 4e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 2000000.0, "max_output_tokens": 2000000.0, "max_tokens": 2000000.0, "mode": "chat", - "output_cost_per_token": 5e-07, - "output_cost_per_token_above_128k_tokens": 1e-06, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models", "supports_function_calling": true, "supports_prompt_caching": true, "supports_tool_choice": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4-0709": { - "input_cost_per_token": 3e-06, - "input_cost_per_token_above_128k_tokens": 6e-06, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 256000, "max_output_tokens": 256000, "max_tokens": 256000, "mode": "chat", - "output_cost_per_token": 1.5e-05, - "output_cost_per_token_above_128k_tokens": 3e-05, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models", "supports_function_calling": true, "supports_prompt_caching": true, "supports_tool_choice": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4-latest": { - "input_cost_per_token": 3e-06, - "input_cost_per_token_above_128k_tokens": 6e-06, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 256000, "max_output_tokens": 256000, "max_tokens": 256000, "mode": "chat", - "output_cost_per_token": 1.5e-05, - "output_cost_per_token_above_128k_tokens": 3e-05, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models", "supports_function_calling": true, "supports_prompt_caching": true, "supports_tool_choice": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4-1-fast": { - "cache_read_input_token_cost": 5e-08, - "input_cost_per_token": 2e-07, - "input_cost_per_token_above_128k_tokens": 4e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 2000000.0, "max_output_tokens": 2000000.0, "max_tokens": 2000000.0, "mode": "chat", - "output_cost_per_token": 5e-07, - "output_cost_per_token_above_128k_tokens": 1e-06, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models/grok-4-1-fast-reasoning", "supports_audio_input": true, "supports_function_calling": true, @@ -44290,19 +44450,21 @@ "supports_response_schema": true, "supports_tool_choice": true, "supports_vision": true, - "supports_web_search": true + "supports_web_search": true, + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4-1-fast-reasoning": { - "cache_read_input_token_cost": 5e-08, - "input_cost_per_token": 2e-07, - "input_cost_per_token_above_128k_tokens": 4e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 2000000.0, "max_output_tokens": 2000000.0, "max_tokens": 2000000.0, "mode": "chat", - "output_cost_per_token": 5e-07, - "output_cost_per_token_above_128k_tokens": 1e-06, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models/grok-4-1-fast-reasoning", "supports_audio_input": true, "supports_function_calling": true, @@ -44312,19 +44474,20 @@ "supports_tool_choice": true, "supports_vision": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4-1-fast-reasoning-latest": { - "cache_read_input_token_cost": 5e-08, - "input_cost_per_token": 2e-07, - "input_cost_per_token_above_128k_tokens": 4e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 2000000.0, "max_output_tokens": 2000000.0, "max_tokens": 2000000.0, "mode": "chat", - "output_cost_per_token": 5e-07, - "output_cost_per_token_above_128k_tokens": 1e-06, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models/grok-4-1-fast-reasoning", "supports_audio_input": true, "supports_function_calling": true, @@ -44334,19 +44497,20 @@ "supports_tool_choice": true, "supports_vision": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4-1-fast-non-reasoning": { - "cache_read_input_token_cost": 5e-08, - "input_cost_per_token": 2e-07, - "input_cost_per_token_above_128k_tokens": 4e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 2000000.0, "max_output_tokens": 2000000.0, "max_tokens": 2000000.0, "mode": "chat", - "output_cost_per_token": 5e-07, - "output_cost_per_token_above_128k_tokens": 1e-06, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models/grok-4-1-fast-non-reasoning", "supports_audio_input": true, "supports_function_calling": true, @@ -44355,19 +44519,20 @@ "supports_tool_choice": true, "supports_vision": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4-1-fast-non-reasoning-latest": { - "cache_read_input_token_cost": 5e-08, - "input_cost_per_token": 2e-07, - "input_cost_per_token_above_128k_tokens": 4e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 2000000.0, "max_output_tokens": 2000000.0, "max_tokens": 2000000.0, "mode": "chat", - "output_cost_per_token": 5e-07, - "output_cost_per_token_above_128k_tokens": 1e-06, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models/grok-4-1-fast-non-reasoning", "supports_audio_input": true, "supports_function_calling": true, @@ -44376,7 +44541,10 @@ "supports_tool_choice": true, "supports_vision": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4.20-multi-agent-beta-0309": { "cache_read_input_token_cost": 2e-07, @@ -50390,7 +50558,7 @@ "max_tokens": 500000, "mode": "chat", "supports_function_calling": true, - "supports_prompt_caching": true, + "supports_prompt_caching": false, "supports_reasoning": true, "supports_tool_choice": true, "supports_vision": true @@ -50405,7 +50573,7 @@ "max_tokens": 500000, "mode": "chat", "supports_function_calling": true, - "supports_prompt_caching": true, + "supports_prompt_caching": false, "supports_reasoning": true, "supports_tool_choice": true, "supports_vision": true @@ -54596,5 +54764,249 @@ "output_cost_per_token_above_200k_tokens": 5e-06, "cache_read_input_token_cost_above_200k_tokens": 4e-07, "supports_response_schema": true + }, + "groq/qwen/qwen3.8-27b": { + "input_cost_per_token": 8e-07, + "litellm_provider": "groq", + "max_input_tokens": 131042, + "max_output_tokens": 16384, + "max_tokens": 16384, + "mode": "chat", + "output_cost_per_token": 4e-06, + "source": "https://console.groq.com/docs/model/qwen/qwen3.8-27b", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true, + "supports_vision": true + }, + "mistral/mistral-medium-3.5": { + "cache_read_input_token_cost": 1.5e-07, + "input_cost_per_token": 1.5e-06, + "litellm_provider": "mistral", + "max_input_tokens": 262144, + "max_output_tokens": 262144, + "max_tokens": 262144, + "mode": "chat", + "output_cost_per_token": 7.5e-06, + "source": "https://docs.mistral.ai/models/model-cards/mistral-medium-3-5-26-04", + "supports_assistant_prefill": true, + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true, + "supports_vision": true + }, + "mistral/mistral-vibe-cli-latest": { + "cache_read_input_token_cost": 1.5e-07, + "input_cost_per_token": 1.5e-06, + "litellm_provider": "mistral", + "max_input_tokens": 262144, + "max_output_tokens": 262144, + "max_tokens": 262144, + "mode": "chat", + "output_cost_per_token": 7.5e-06, + "source": "https://docs.mistral.ai/models/model-cards/mistral-medium-3-5-26-04", + "supports_assistant_prefill": true, + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true, + "supports_vision": true + }, + "mistral/mistral-vibe-cli-with-tools": { + "cache_read_input_token_cost": 1.5e-07, + "input_cost_per_token": 1.5e-06, + "litellm_provider": "mistral", + "max_input_tokens": 262144, + "max_output_tokens": 262144, + "max_tokens": 262144, + "mode": "chat", + "output_cost_per_token": 7.5e-06, + "source": "https://docs.mistral.ai/models/model-cards/mistral-medium-3-5-26-04", + "supports_assistant_prefill": true, + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true, + "supports_vision": true + }, + "mistral/mistral-vibe-cli-fast": { + "cache_read_input_token_cost": 1.5e-08, + "input_cost_per_token": 1.5e-07, + "litellm_provider": "mistral", + "max_input_tokens": 262144, + "max_output_tokens": 262144, + "max_tokens": 262144, + "mode": "chat", + "output_cost_per_token": 6e-07, + "source": "https://docs.mistral.ai/models/model-cards/mistral-small-4-0-26-03", + "supports_assistant_prefill": true, + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true, + "supports_vision": true + }, + "mistral/mistral-code-latest": { + "cache_read_input_token_cost": 3e-08, + "input_cost_per_token": 3e-07, + "litellm_provider": "mistral", + "max_input_tokens": 128000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 9e-07, + "source": "https://docs.mistral.ai/models/model-cards/codestral-25-08", + "supports_assistant_prefill": true, + "supports_function_calling": true, + "supports_response_schema": true, + "supports_tool_choice": true + }, + "mistral/mistral-code-fim-latest": { + "cache_read_input_token_cost": 3e-08, + "input_cost_per_token": 3e-07, + "litellm_provider": "mistral", + "max_input_tokens": 128000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 9e-07, + "source": "https://docs.mistral.ai/models/model-cards/codestral-25-08", + "supports_assistant_prefill": true, + "supports_function_calling": true, + "supports_response_schema": true, + "supports_tool_choice": true + }, + "mistral/mistral-code-agent-latest": { + "input_cost_per_token": 4e-07, + "litellm_provider": "mistral", + "max_input_tokens": 256000, + "max_output_tokens": 256000, + "max_tokens": 256000, + "mode": "chat", + "output_cost_per_token": 2e-06, + "source": "https://mistral.ai/news/devstral-2-vibe-cli", + "supports_assistant_prefill": true, + "supports_function_calling": true, + "supports_response_schema": true, + "supports_tool_choice": true + }, + "mistral/mistral-ocr-3": { + "litellm_provider": "mistral", + "ocr_cost_per_page": 0.002, + "annotation_cost_per_page": 0.003, + "mode": "ocr", + "supported_endpoints": [ + "/v1/ocr" + ], + "source": "https://mistral.ai/pricing#api-pricing" + }, + "mistral/mistral-ocr-3-0": { + "litellm_provider": "mistral", + "ocr_cost_per_page": 0.002, + "annotation_cost_per_page": 0.003, + "mode": "ocr", + "supported_endpoints": [ + "/v1/ocr" + ], + "source": "https://mistral.ai/pricing#api-pricing" + }, + "mistral/mistral-ocr-4": { + "annotation_cost_per_page": 0.005, + "litellm_provider": "mistral", + "mode": "ocr", + "ocr_cost_per_page": 0.004, + "source": "https://docs.mistral.ai/models/model-cards/ocr-4-1", + "supported_endpoints": [ + "/v1/ocr" + ] + }, + "mistral/voxtral-mini-latest": { + "input_cost_per_second": 5e-05, + "litellm_provider": "mistral", + "mode": "audio_transcription", + "source": "https://docs.mistral.ai/models/model-cards/voxtral-mini-transcribe-26-02", + "supported_endpoints": [ + "/v1/audio/transcriptions" + ], + "supported_modalities": [ + "audio" + ], + "supported_output_modalities": [ + "text" + ], + "supports_audio_input": true + }, + "mistral/voxtral-mini-realtime-2602": { + "input_cost_per_second": 0.0001, + "litellm_provider": "mistral", + "mode": "audio_transcription", + "source": "https://docs.mistral.ai/models/model-cards/voxtral-mini-transcribe-realtime-26-02", + "supported_endpoints": [ + "/v1/audio/transcriptions" + ], + "supported_modalities": [ + "audio" + ], + "supported_output_modalities": [ + "text" + ], + "supports_audio_input": true + }, + "mistral/voxtral-mini-realtime-latest": { + "input_cost_per_second": 0.0001, + "litellm_provider": "mistral", + "mode": "audio_transcription", + "source": "https://docs.mistral.ai/models/model-cards/voxtral-mini-transcribe-realtime-26-02", + "supported_endpoints": [ + "/v1/audio/transcriptions" + ], + "supported_modalities": [ + "audio" + ], + "supported_output_modalities": [ + "text" + ], + "supports_audio_input": true + }, + "mistral/labs-leanstral-1-5-1": { + "input_cost_per_token": 0.0, + "litellm_provider": "mistral", + "max_input_tokens": 262144, + "max_output_tokens": 131072, + "max_tokens": 131072, + "mode": "chat", + "output_cost_per_token": 0.0, + "source": "https://docs.mistral.ai/models/model-cards/leanstral-1-5", + "supports_function_calling": true, + "supports_response_schema": true, + "supports_tool_choice": true + }, + "fireworks_ai/accounts/fireworks/models/glm-5p3": { + "cache_read_input_token_cost": 2.6e-07, + "input_cost_per_token": 1.4e-06, + "litellm_provider": "fireworks_ai", + "max_input_tokens": 1048576, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 4.4e-06, + "source": "https://docs.fireworks.ai/serverless/pricing", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true, + "supports_vision": false + }, + "fireworks_ai/accounts/fireworks/models/qwen3-embedding-8b": { + "input_cost_per_token": 1e-07, + "output_cost_per_token": 0.0, + "litellm_provider": "fireworks_ai", + "max_input_tokens": 40960, + "max_output_tokens": 40960, + "max_tokens": 40960, + "mode": "embedding", + "source": "https://docs.fireworks.ai/serverless/pricing" } } diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index bebbcc321814..7373ffd85979 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -12595,7 +12595,8 @@ "us": 1.1 }, "supports_output_config": true, - "prompt_cache_min_tokens": 1024 + "prompt_cache_min_tokens": 1024, + "source": "https://docs.anthropic.com/en/docs/about-claude/models/overview" }, "claude-sonnet-4-6": { "deprecation_date": "2027-02-17", @@ -12997,7 +12998,8 @@ }, "supports_output_config": true, "prompt_cache_min_tokens": 512, - "supports_native_structured_output": true + "supports_native_structured_output": true, + "source": "https://docs.anthropic.com/en/docs/about-claude/models/overview" }, "claude-opus-5": { "deprecation_date": "2027-07-24", @@ -13037,7 +13039,8 @@ }, "supports_output_config": true, "supports_speed": true, - "prompt_cache_min_tokens": 512 + "prompt_cache_min_tokens": 512, + "source": "https://docs.anthropic.com/en/docs/about-claude/models/overview" }, "claude-opus-4-8": { "deprecation_date": "2027-05-28", @@ -20562,7 +20565,8 @@ "output_cost_per_token": 2e-06, "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", "supported_endpoints": [ - "/vertex_ai/live" + "/vertex_ai/live", + "/v1/realtime" ], "supported_modalities": [ "text", @@ -22015,6 +22019,49 @@ }, "web_search_billing_unit": "per_query" }, + "gemini/nano-banana-pro-preview": { + "input_cost_per_image": 0.0011, + "input_cost_per_token": 2e-06, + "input_cost_per_token_batches": 1e-06, + "litellm_provider": "gemini", + "max_input_tokens": 131072, + "max_output_tokens": 32768, + "max_tokens": 32768, + "mode": "image_generation", + "output_cost_per_image": 0.134, + "output_cost_per_image_token": 0.00012, + "output_cost_per_token": 1.2e-05, + "rpm": 1000, + "tpm": 4000000, + "output_cost_per_token_batches": 6e-06, + "source": "https://ai.google.dev/gemini-api/docs/pricing", + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/completions", + "/v1/batch" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text", + "image" + ], + "supports_function_calling": false, + "supports_prompt_caching": true, + "supports_reasoning": false, + "supports_response_schema": true, + "supports_system_messages": true, + "supports_vision": true, + "supports_web_search": true, + "search_context_cost_per_query": { + "search_context_size_low": 0.014, + "search_context_size_medium": 0.014, + "search_context_size_high": 0.014 + }, + "web_search_billing_unit": "per_query" + }, "gemini/gemini-3.1-flash-image": { "input_cost_per_token": 5e-07, "input_cost_per_token_batches": 2.5e-07, @@ -23047,7 +23094,8 @@ "supports_system_messages": true, "supports_video_input": true, "supports_vision": true, - "tpm": 800000 + "tpm": 800000, + "deprecation_date": "2026-09-30" }, "gemini/gemini-3.1-pro-preview": { "prompt_cache_min_tokens": 4096, @@ -23558,6 +23606,38 @@ "supports_tool_choice": true, "supports_vision": true }, + "gemini/gemma-4-26b-a4b-it": { + "input_cost_per_token": 0.0, + "output_cost_per_token": 0.0, + "litellm_provider": "gemini", + "max_input_tokens": 262144, + "max_output_tokens": 32768, + "max_tokens": 32768, + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_system_messages": true, + "supports_tool_choice": true, + "supports_vision": true, + "source": "https://ai.google.dev/gemini-api/docs/pricing" + }, + "gemini/gemma-4-31b-it": { + "input_cost_per_token": 0.0, + "output_cost_per_token": 0.0, + "litellm_provider": "gemini", + "max_input_tokens": 262144, + "max_output_tokens": 32768, + "max_tokens": 32768, + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_system_messages": true, + "supports_tool_choice": true, + "supports_vision": true, + "source": "https://ai.google.dev/gemini-api/docs/pricing" + }, "gemini/imagen-3.0-fast-generate-001": { "litellm_provider": "gemini", "mode": "image_generation", @@ -26097,7 +26177,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "low/1024-x-1536/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.013, @@ -26108,7 +26189,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "low/1536-x-1024/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.013, @@ -26119,7 +26201,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "medium/1024-x-1024/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.034, @@ -26130,7 +26213,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "medium/1024-x-1536/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.05, @@ -26141,7 +26225,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "medium/1536-x-1024/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.05, @@ -26152,7 +26237,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "high/1024-x-1024/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.133, @@ -26163,7 +26249,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "high/1024-x-1536/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.2, @@ -26174,7 +26261,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "high/1536-x-1024/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.2, @@ -26185,7 +26273,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "standard/1024-x-1024/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.009, @@ -26196,7 +26285,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "standard/1024-x-1536/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.013, @@ -26207,7 +26297,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "standard/1536-x-1024/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.013, @@ -26218,7 +26309,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "1024-x-1024/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.009, @@ -26229,7 +26321,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "1024-x-1536/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.013, @@ -26240,7 +26333,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "1536-x-1024/gpt-image-1.5-2025-12-16": { "input_cost_per_image": 0.013, @@ -26251,7 +26345,8 @@ "/v1/images/edits" ], "supports_vision": true, - "supports_pdf_input": true + "supports_pdf_input": true, + "deprecation_date": "2026-12-01" }, "gpt-5": { "cache_read_input_token_cost": 1.25e-07, @@ -38941,14 +39036,14 @@ "source": "https://docs.together.ai/docs/serverless-models" }, "together_ai/Qwen/Qwen3.8-2.4T-A95B": { - "cache_read_input_token_cost": 2.5e-07, - "input_cost_per_token": 2e-06, + "cache_read_input_token_cost": 5e-07, + "input_cost_per_token": 2.5e-06, "litellm_provider": "together_ai", "max_input_tokens": 1010000, "max_output_tokens": 1010000, "max_tokens": 1010000, "mode": "chat", - "output_cost_per_token": 6e-06, + "output_cost_per_token": 6.25e-06, "source": "https://docs.together.ai/docs/serverless-models", "supports_prompt_caching": true }, @@ -39186,6 +39281,23 @@ "supports_response_schema": true, "supports_tool_choice": true }, + "together_ai/zai-org/GLM-5.3": { + "cache_read_input_token_cost": 2.6e-07, + "input_cost_per_token": 1.4e-06, + "litellm_provider": "together_ai", + "max_input_tokens": 1048575, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 4.4e-06, + "source": "https://docs.together.ai/docs/serverless-models", + "supports_function_calling": true, + "supports_parallel_function_calling": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true + }, "together_ai/zai-org/GLM-5.3-Flash": { "cache_read_input_token_cost": 3e-08, "input_cost_per_token": 1.5e-07, @@ -44001,287 +44113,335 @@ ] }, "xai/grok-3": { - "cache_read_input_token_cost": 7.5e-07, - "input_cost_per_token": 3e-06, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 1.5e-05, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_response_schema": false, "supports_tool_choice": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-beta": { - "cache_read_input_token_cost": 7.5e-07, - "input_cost_per_token": 3e-06, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 1.5e-05, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_response_schema": false, "supports_tool_choice": true, - "supports_web_search": true + "supports_web_search": true, + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-fast-beta": { - "cache_read_input_token_cost": 1.25e-06, - "input_cost_per_token": 5e-06, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 2.5e-05, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_response_schema": false, "supports_tool_choice": true, - "supports_web_search": true + "supports_web_search": true, + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-fast-latest": { - "cache_read_input_token_cost": 1.25e-06, - "input_cost_per_token": 5e-06, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 2.5e-05, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_response_schema": false, "supports_tool_choice": true, - "supports_web_search": true + "supports_web_search": true, + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-latest": { - "cache_read_input_token_cost": 7.5e-07, - "input_cost_per_token": 3e-06, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 1.5e-05, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_response_schema": false, "supports_tool_choice": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-mini": { - "cache_read_input_token_cost": 7.5e-08, + "cache_read_input_token_cost": 2e-07, "deprecation_date": "2026-02-28", - "input_cost_per_token": 3e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 5e-07, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_reasoning": true, "supports_response_schema": false, "supports_tool_choice": true, - "supports_web_search": true + "supports_web_search": true, + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-mini-beta": { - "cache_read_input_token_cost": 7.5e-08, + "cache_read_input_token_cost": 2e-07, "deprecation_date": "2026-02-28", - "input_cost_per_token": 3e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 5e-07, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_reasoning": true, "supports_response_schema": false, "supports_tool_choice": true, - "supports_web_search": true + "supports_web_search": true, + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-mini-fast": { - "cache_read_input_token_cost": 1.5e-07, - "input_cost_per_token": 6e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 4e-06, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_reasoning": true, "supports_response_schema": false, "supports_tool_choice": true, - "supports_web_search": true + "supports_web_search": true, + "deprecation_date": "2026-02-28", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-mini-fast-beta": { - "cache_read_input_token_cost": 1.5e-07, - "input_cost_per_token": 6e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 4e-06, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_reasoning": true, "supports_response_schema": false, "supports_tool_choice": true, - "supports_web_search": true + "supports_web_search": true, + "deprecation_date": "2026-02-28", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-mini-fast-latest": { - "cache_read_input_token_cost": 1.5e-07, - "input_cost_per_token": 6e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 4e-06, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_reasoning": true, "supports_response_schema": false, "supports_tool_choice": true, - "supports_web_search": true + "supports_web_search": true, + "deprecation_date": "2026-02-28", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-3-mini-latest": { - "cache_read_input_token_cost": 7.5e-08, - "input_cost_per_token": 3e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 131072, "max_output_tokens": 131072, "max_tokens": 131072, "mode": "chat", - "output_cost_per_token": 5e-07, + "output_cost_per_token": 2.5e-06, "source": "https://x.ai/api#pricing", "supports_function_calling": true, "supports_prompt_caching": true, "supports_reasoning": true, "supports_response_schema": false, "supports_tool_choice": true, - "supports_web_search": true + "supports_web_search": true, + "deprecation_date": "2026-02-28", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4": { - "input_cost_per_token": 3e-06, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 256000, "max_output_tokens": 256000, "max_tokens": 256000, "mode": "chat", - "output_cost_per_token": 1.5e-05, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models", "supports_function_calling": true, "supports_prompt_caching": true, "supports_tool_choice": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4-fast-reasoning": { - "cache_read_input_token_cost": 5e-08, - "input_cost_per_token": 2e-07, - "input_cost_per_token_above_128k_tokens": 4e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 2000000.0, "max_output_tokens": 2000000.0, "max_tokens": 2000000.0, "mode": "chat", - "output_cost_per_token": 5e-07, - "output_cost_per_token_above_128k_tokens": 1e-06, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models", "supports_function_calling": true, "supports_prompt_caching": true, "supports_tool_choice": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4-fast-non-reasoning": { - "cache_read_input_token_cost": 5e-08, - "input_cost_per_token": 2e-07, - "input_cost_per_token_above_128k_tokens": 4e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 2000000.0, "max_output_tokens": 2000000.0, "max_tokens": 2000000.0, "mode": "chat", - "output_cost_per_token": 5e-07, - "output_cost_per_token_above_128k_tokens": 1e-06, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models", "supports_function_calling": true, "supports_prompt_caching": true, "supports_tool_choice": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4-0709": { - "input_cost_per_token": 3e-06, - "input_cost_per_token_above_128k_tokens": 6e-06, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 256000, "max_output_tokens": 256000, "max_tokens": 256000, "mode": "chat", - "output_cost_per_token": 1.5e-05, - "output_cost_per_token_above_128k_tokens": 3e-05, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models", "supports_function_calling": true, "supports_prompt_caching": true, "supports_tool_choice": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4-latest": { - "input_cost_per_token": 3e-06, - "input_cost_per_token_above_128k_tokens": 6e-06, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 256000, "max_output_tokens": 256000, "max_tokens": 256000, "mode": "chat", - "output_cost_per_token": 1.5e-05, - "output_cost_per_token_above_128k_tokens": 3e-05, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models", "supports_function_calling": true, "supports_prompt_caching": true, "supports_tool_choice": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4-1-fast": { - "cache_read_input_token_cost": 5e-08, - "input_cost_per_token": 2e-07, - "input_cost_per_token_above_128k_tokens": 4e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 2000000.0, "max_output_tokens": 2000000.0, "max_tokens": 2000000.0, "mode": "chat", - "output_cost_per_token": 5e-07, - "output_cost_per_token_above_128k_tokens": 1e-06, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models/grok-4-1-fast-reasoning", "supports_audio_input": true, "supports_function_calling": true, @@ -44290,19 +44450,21 @@ "supports_response_schema": true, "supports_tool_choice": true, "supports_vision": true, - "supports_web_search": true + "supports_web_search": true, + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4-1-fast-reasoning": { - "cache_read_input_token_cost": 5e-08, - "input_cost_per_token": 2e-07, - "input_cost_per_token_above_128k_tokens": 4e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 2000000.0, "max_output_tokens": 2000000.0, "max_tokens": 2000000.0, "mode": "chat", - "output_cost_per_token": 5e-07, - "output_cost_per_token_above_128k_tokens": 1e-06, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models/grok-4-1-fast-reasoning", "supports_audio_input": true, "supports_function_calling": true, @@ -44312,19 +44474,20 @@ "supports_tool_choice": true, "supports_vision": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4-1-fast-reasoning-latest": { - "cache_read_input_token_cost": 5e-08, - "input_cost_per_token": 2e-07, - "input_cost_per_token_above_128k_tokens": 4e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 2000000.0, "max_output_tokens": 2000000.0, "max_tokens": 2000000.0, "mode": "chat", - "output_cost_per_token": 5e-07, - "output_cost_per_token_above_128k_tokens": 1e-06, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models/grok-4-1-fast-reasoning", "supports_audio_input": true, "supports_function_calling": true, @@ -44334,19 +44497,20 @@ "supports_tool_choice": true, "supports_vision": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4-1-fast-non-reasoning": { - "cache_read_input_token_cost": 5e-08, - "input_cost_per_token": 2e-07, - "input_cost_per_token_above_128k_tokens": 4e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 2000000.0, "max_output_tokens": 2000000.0, "max_tokens": 2000000.0, "mode": "chat", - "output_cost_per_token": 5e-07, - "output_cost_per_token_above_128k_tokens": 1e-06, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models/grok-4-1-fast-non-reasoning", "supports_audio_input": true, "supports_function_calling": true, @@ -44355,19 +44519,20 @@ "supports_tool_choice": true, "supports_vision": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4-1-fast-non-reasoning-latest": { - "cache_read_input_token_cost": 5e-08, - "input_cost_per_token": 2e-07, - "input_cost_per_token_above_128k_tokens": 4e-07, + "cache_read_input_token_cost": 2e-07, + "input_cost_per_token": 1.25e-06, "litellm_provider": "xai", "max_input_tokens": 2000000.0, "max_output_tokens": 2000000.0, "max_tokens": 2000000.0, "mode": "chat", - "output_cost_per_token": 5e-07, - "output_cost_per_token_above_128k_tokens": 1e-06, + "output_cost_per_token": 2.5e-06, "source": "https://docs.x.ai/docs/models/grok-4-1-fast-non-reasoning", "supports_audio_input": true, "supports_function_calling": true, @@ -44376,7 +44541,10 @@ "supports_tool_choice": true, "supports_vision": true, "supports_web_search": true, - "deprecation_date": "2026-05-15" + "deprecation_date": "2026-05-15", + "input_cost_per_token_above_200k_tokens": 2.5e-06, + "output_cost_per_token_above_200k_tokens": 5e-06, + "cache_read_input_token_cost_above_200k_tokens": 4e-07 }, "xai/grok-4.20-multi-agent-beta-0309": { "cache_read_input_token_cost": 2e-07, @@ -50390,7 +50558,7 @@ "max_tokens": 500000, "mode": "chat", "supports_function_calling": true, - "supports_prompt_caching": true, + "supports_prompt_caching": false, "supports_reasoning": true, "supports_tool_choice": true, "supports_vision": true @@ -50405,7 +50573,7 @@ "max_tokens": 500000, "mode": "chat", "supports_function_calling": true, - "supports_prompt_caching": true, + "supports_prompt_caching": false, "supports_reasoning": true, "supports_tool_choice": true, "supports_vision": true @@ -54596,5 +54764,249 @@ "output_cost_per_token_above_200k_tokens": 5e-06, "cache_read_input_token_cost_above_200k_tokens": 4e-07, "supports_response_schema": true + }, + "groq/qwen/qwen3.8-27b": { + "input_cost_per_token": 8e-07, + "litellm_provider": "groq", + "max_input_tokens": 131042, + "max_output_tokens": 16384, + "max_tokens": 16384, + "mode": "chat", + "output_cost_per_token": 4e-06, + "source": "https://console.groq.com/docs/model/qwen/qwen3.8-27b", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true, + "supports_vision": true + }, + "mistral/mistral-medium-3.5": { + "cache_read_input_token_cost": 1.5e-07, + "input_cost_per_token": 1.5e-06, + "litellm_provider": "mistral", + "max_input_tokens": 262144, + "max_output_tokens": 262144, + "max_tokens": 262144, + "mode": "chat", + "output_cost_per_token": 7.5e-06, + "source": "https://docs.mistral.ai/models/model-cards/mistral-medium-3-5-26-04", + "supports_assistant_prefill": true, + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true, + "supports_vision": true + }, + "mistral/mistral-vibe-cli-latest": { + "cache_read_input_token_cost": 1.5e-07, + "input_cost_per_token": 1.5e-06, + "litellm_provider": "mistral", + "max_input_tokens": 262144, + "max_output_tokens": 262144, + "max_tokens": 262144, + "mode": "chat", + "output_cost_per_token": 7.5e-06, + "source": "https://docs.mistral.ai/models/model-cards/mistral-medium-3-5-26-04", + "supports_assistant_prefill": true, + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true, + "supports_vision": true + }, + "mistral/mistral-vibe-cli-with-tools": { + "cache_read_input_token_cost": 1.5e-07, + "input_cost_per_token": 1.5e-06, + "litellm_provider": "mistral", + "max_input_tokens": 262144, + "max_output_tokens": 262144, + "max_tokens": 262144, + "mode": "chat", + "output_cost_per_token": 7.5e-06, + "source": "https://docs.mistral.ai/models/model-cards/mistral-medium-3-5-26-04", + "supports_assistant_prefill": true, + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true, + "supports_vision": true + }, + "mistral/mistral-vibe-cli-fast": { + "cache_read_input_token_cost": 1.5e-08, + "input_cost_per_token": 1.5e-07, + "litellm_provider": "mistral", + "max_input_tokens": 262144, + "max_output_tokens": 262144, + "max_tokens": 262144, + "mode": "chat", + "output_cost_per_token": 6e-07, + "source": "https://docs.mistral.ai/models/model-cards/mistral-small-4-0-26-03", + "supports_assistant_prefill": true, + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true, + "supports_vision": true + }, + "mistral/mistral-code-latest": { + "cache_read_input_token_cost": 3e-08, + "input_cost_per_token": 3e-07, + "litellm_provider": "mistral", + "max_input_tokens": 128000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 9e-07, + "source": "https://docs.mistral.ai/models/model-cards/codestral-25-08", + "supports_assistant_prefill": true, + "supports_function_calling": true, + "supports_response_schema": true, + "supports_tool_choice": true + }, + "mistral/mistral-code-fim-latest": { + "cache_read_input_token_cost": 3e-08, + "input_cost_per_token": 3e-07, + "litellm_provider": "mistral", + "max_input_tokens": 128000, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 9e-07, + "source": "https://docs.mistral.ai/models/model-cards/codestral-25-08", + "supports_assistant_prefill": true, + "supports_function_calling": true, + "supports_response_schema": true, + "supports_tool_choice": true + }, + "mistral/mistral-code-agent-latest": { + "input_cost_per_token": 4e-07, + "litellm_provider": "mistral", + "max_input_tokens": 256000, + "max_output_tokens": 256000, + "max_tokens": 256000, + "mode": "chat", + "output_cost_per_token": 2e-06, + "source": "https://mistral.ai/news/devstral-2-vibe-cli", + "supports_assistant_prefill": true, + "supports_function_calling": true, + "supports_response_schema": true, + "supports_tool_choice": true + }, + "mistral/mistral-ocr-3": { + "litellm_provider": "mistral", + "ocr_cost_per_page": 0.002, + "annotation_cost_per_page": 0.003, + "mode": "ocr", + "supported_endpoints": [ + "/v1/ocr" + ], + "source": "https://mistral.ai/pricing#api-pricing" + }, + "mistral/mistral-ocr-3-0": { + "litellm_provider": "mistral", + "ocr_cost_per_page": 0.002, + "annotation_cost_per_page": 0.003, + "mode": "ocr", + "supported_endpoints": [ + "/v1/ocr" + ], + "source": "https://mistral.ai/pricing#api-pricing" + }, + "mistral/mistral-ocr-4": { + "annotation_cost_per_page": 0.005, + "litellm_provider": "mistral", + "mode": "ocr", + "ocr_cost_per_page": 0.004, + "source": "https://docs.mistral.ai/models/model-cards/ocr-4-1", + "supported_endpoints": [ + "/v1/ocr" + ] + }, + "mistral/voxtral-mini-latest": { + "input_cost_per_second": 5e-05, + "litellm_provider": "mistral", + "mode": "audio_transcription", + "source": "https://docs.mistral.ai/models/model-cards/voxtral-mini-transcribe-26-02", + "supported_endpoints": [ + "/v1/audio/transcriptions" + ], + "supported_modalities": [ + "audio" + ], + "supported_output_modalities": [ + "text" + ], + "supports_audio_input": true + }, + "mistral/voxtral-mini-realtime-2602": { + "input_cost_per_second": 0.0001, + "litellm_provider": "mistral", + "mode": "audio_transcription", + "source": "https://docs.mistral.ai/models/model-cards/voxtral-mini-transcribe-realtime-26-02", + "supported_endpoints": [ + "/v1/audio/transcriptions" + ], + "supported_modalities": [ + "audio" + ], + "supported_output_modalities": [ + "text" + ], + "supports_audio_input": true + }, + "mistral/voxtral-mini-realtime-latest": { + "input_cost_per_second": 0.0001, + "litellm_provider": "mistral", + "mode": "audio_transcription", + "source": "https://docs.mistral.ai/models/model-cards/voxtral-mini-transcribe-realtime-26-02", + "supported_endpoints": [ + "/v1/audio/transcriptions" + ], + "supported_modalities": [ + "audio" + ], + "supported_output_modalities": [ + "text" + ], + "supports_audio_input": true + }, + "mistral/labs-leanstral-1-5-1": { + "input_cost_per_token": 0.0, + "litellm_provider": "mistral", + "max_input_tokens": 262144, + "max_output_tokens": 131072, + "max_tokens": 131072, + "mode": "chat", + "output_cost_per_token": 0.0, + "source": "https://docs.mistral.ai/models/model-cards/leanstral-1-5", + "supports_function_calling": true, + "supports_response_schema": true, + "supports_tool_choice": true + }, + "fireworks_ai/accounts/fireworks/models/glm-5p3": { + "cache_read_input_token_cost": 2.6e-07, + "input_cost_per_token": 1.4e-06, + "litellm_provider": "fireworks_ai", + "max_input_tokens": 1048576, + "max_output_tokens": 128000, + "max_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 4.4e-06, + "source": "https://docs.fireworks.ai/serverless/pricing", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_choice": true, + "supports_vision": false + }, + "fireworks_ai/accounts/fireworks/models/qwen3-embedding-8b": { + "input_cost_per_token": 1e-07, + "output_cost_per_token": 0.0, + "litellm_provider": "fireworks_ai", + "max_input_tokens": 40960, + "max_output_tokens": 40960, + "max_tokens": 40960, + "mode": "embedding", + "source": "https://docs.fireworks.ai/serverless/pricing" } } diff --git a/tests/test_litellm/integrations/test_anthropic_cache_control_hook.py b/tests/test_litellm/integrations/test_anthropic_cache_control_hook.py index 3a736e2a8899..e995cbae782b 100644 --- a/tests/test_litellm/integrations/test_anthropic_cache_control_hook.py +++ b/tests/test_litellm/integrations/test_anthropic_cache_control_hook.py @@ -1611,6 +1611,20 @@ def test_model_without_caching_support_not_injected(self, monkeypatch): monkeypatch.setattr(litellm, "enable_anthropic_prompt_caching", True) assert self._points(model="anthropic.claude-3-5-sonnet-20240620-v1:0", provider="bedrock") == [] + @pytest.mark.parametrize("model", ["us.xai.grok-4.6", "global.xai.grok-4.6"]) + def test_bedrock_grok_not_injected(self, monkeypatch, local_model_cost_map, model): + """Bedrock supports only implicit prompt caching for Grok: explicit cachePoint + breakpoints make it reject the whole request ("You invoked an unsupported model + or your request did not allow prompt caching"), so supports_prompt_caching stays + false, while implicit cache hits still bill at the cache-read rate.""" + from litellm.utils import supports_prompt_caching + + monkeypatch.setattr(litellm, "enable_anthropic_prompt_caching", True) + assert supports_prompt_caching(model=model, custom_llm_provider="bedrock") is False + assert self._points(model=model, provider="bedrock") == [] + entry = litellm.model_cost[model] + assert 0 < entry["cache_read_input_token_cost"] < entry["input_cost_per_token"] + def test_stands_down_when_client_sent_cache_control(self, monkeypatch): monkeypatch.setattr(litellm, "enable_anthropic_prompt_caching", True) messages = [ diff --git a/tests/test_litellm/llms/gemini/realtime/test_gemini_realtime_transformation.py b/tests/test_litellm/llms/gemini/realtime/test_gemini_realtime_transformation.py index d0613403e674..3d8200bc474b 100644 --- a/tests/test_litellm/llms/gemini/realtime/test_gemini_realtime_transformation.py +++ b/tests/test_litellm/llms/gemini/realtime/test_gemini_realtime_transformation.py @@ -1812,6 +1812,7 @@ def patch_gemini_audio_cost_map_entries(monkeypatch): "gemini-2.5-flash-native-audio", "gemini-2.5-flash-native-audio-latest", "gemini/gemini-2.5-flash-native-audio-latest", + "gemini-live-2.5-flash-native-audio", ] flash_live_models = [ "gemini-3.1-flash-live-preview", @@ -1834,6 +1835,8 @@ def patch_gemini_audio_cost_map_entries(monkeypatch): ("gemini/gemini-3.1-flash-live-preview", True), ("gemini-2.5-flash-native-audio-latest", True), ("gemini/gemini-2.5-flash-native-audio-latest", True), + ("gemini-live-2.5-flash-native-audio", True), + ("vertex_ai/gemini-live-2.5-flash-native-audio", True), ("gemini-2.0-flash", False), ("gemini-2.5-flash", False), ], @@ -1842,6 +1845,19 @@ def test_is_audio_only_live_model_uses_cost_map(model, expected, patch_gemini_au assert GeminiRealtimeConfig._is_audio_only_live_model(model) == expected +def test_gemini_live_native_audio_entry_is_vertex_only(): + import json + from pathlib import Path + from typing import Final + + catalog_path: Final = Path(__file__).parents[5] / "model_prices_and_context_window.json" + catalog: Final = json.loads(catalog_path.read_text()) + vertex_key: Final = "gemini-live-2.5-flash-native-audio" + assert catalog[vertex_key]["litellm_provider"] == "vertex_ai-language-models" + assert catalog[vertex_key].get("gemini_native_audio") is True + assert "gemini/gemini-live-2.5-flash-native-audio" not in catalog, "the Gemini API does not serve this model" + + def test_is_setup_message_and_is_content_message(): config = GeminiRealtimeConfig() assert config.is_setup_message({"setup": {}}) is True diff --git a/tests/test_litellm/llms/xai/test_xai_cost_calculator.py b/tests/test_litellm/llms/xai/test_xai_cost_calculator.py index 55e28dff81d5..92e76fd18ab7 100644 --- a/tests/test_litellm/llms/xai/test_xai_cost_calculator.py +++ b/tests/test_litellm/llms/xai/test_xai_cost_calculator.py @@ -51,8 +51,8 @@ def test_basic_cost_calculation(self): # Expected costs for grok-3-mini: # Input: 12 tokens * $3e-7 = $0.0000036 # Output: 125 tokens * $5e-7 = $0.0000625 - expected_prompt_cost = 12 * 3e-7 - expected_completion_cost = 125 * 5e-7 + expected_prompt_cost = 12 * 1.25e-6 + expected_completion_cost = 125 * 2.5e-6 assert math.isclose(prompt_cost, expected_prompt_cost, rel_tol=1e-10) assert math.isclose(completion_cost, expected_completion_cost, rel_tol=1e-10) @@ -77,8 +77,8 @@ def test_reasoning_tokens_cost_calculation(self): # Expected costs for grok-3-mini: # Input: 12 tokens * $3e-7 = $0.0000036 # Completion: (125 + 949) tokens * $5e-7 = $0.000537 - expected_prompt_cost = 12 * 3e-7 - expected_completion_cost = (125 + 949) * 5e-7 + expected_prompt_cost = 12 * 1.25e-6 + expected_completion_cost = (125 + 949) * 2.5e-6 assert math.isclose(prompt_cost, expected_prompt_cost, rel_tol=1e-10) assert math.isclose(completion_cost, expected_completion_cost, rel_tol=1e-10) @@ -104,8 +104,8 @@ def test_reasoning_and_text_tokens_cost_calculation(self): # Input: 12 tokens * $3e-7 = $0.0000036 # Completion: (125 + 949) tokens * $5e-7 = $0.000537 # Note: text_tokens field is ignored, only completion_tokens + reasoning_tokens matters - expected_prompt_cost = 12 * 3e-7 - expected_completion_cost = (125 + 949) * 5e-7 + expected_prompt_cost = 12 * 1.25e-6 + expected_completion_cost = (125 + 949) * 2.5e-6 assert math.isclose(prompt_cost, expected_prompt_cost, rel_tol=1e-10) assert math.isclose(completion_cost, expected_completion_cost, rel_tol=1e-10) @@ -127,11 +127,12 @@ def test_grok_4_cost_calculation(self): prompt_cost, completion_cost = cost_per_token(model="grok-4", usage=usage) - # Expected costs for grok-4: - # Input: 10 tokens * $3e-6 = $0.00003 - # Completion: (200 + 150) tokens * $1.5e-5 = $0.00525 - expected_prompt_cost = 10 * 3e-6 - expected_completion_cost = (200 + 150) * 1.5e-5 + # grok-4 was retired on 2026-05-15 and now redirects to grok-4.3, so it bills + # at grok-4.3's rates: + # Input: 10 tokens * $1.25e-6 + # Completion: (200 + 150) tokens * $2.5e-6 + expected_prompt_cost = 10 * 1.25e-6 + expected_completion_cost = (200 + 150) * 2.5e-6 assert math.isclose(prompt_cost, expected_prompt_cost, rel_tol=1e-10) assert math.isclose(completion_cost, expected_completion_cost, rel_tol=1e-10) @@ -158,8 +159,8 @@ def test_grok_3_fast_beta_cost_calculation(self): # Expected costs for grok-3-fast-beta: # Input: 20 tokens * $5e-6 = $0.0001 # Completion: (300 + 200) tokens * $2.5e-5 = $0.0125 - expected_prompt_cost = 20 * 5e-6 - expected_completion_cost = (300 + 200) * 2.5e-5 + expected_prompt_cost = 20 * 1.25e-6 + expected_completion_cost = (300 + 200) * 2.5e-6 assert math.isclose(prompt_cost, expected_prompt_cost, rel_tol=1e-10) assert math.isclose(completion_cost, expected_completion_cost, rel_tol=1e-10) @@ -185,46 +186,34 @@ def test_edge_case_large_reasoning_tokens(self): # Expected costs: # Input: 12 tokens * $3e-7 = $0.0000036 # Completion: (50 + 100) tokens * $5e-7 = $0.000075 - expected_prompt_cost = 12 * 3e-7 - expected_completion_cost = (50 + 100) * 5e-7 + expected_prompt_cost = 12 * 1.25e-6 + expected_completion_cost = (50 + 100) * 2.5e-6 assert math.isclose(prompt_cost, expected_prompt_cost, rel_tol=1e-10) assert math.isclose(completion_cost, expected_completion_cost, rel_tol=1e-10) - def test_tiered_pricing_above_128k_tokens(self): - """Test tiered pricing for tokens above 128k.""" - # Test with grok-4-fast-reasoning which has tiered pricing + def test_tiered_pricing_above_200k_tokens(self): usage = Usage( - prompt_tokens=150000, # Above 128k threshold - completion_tokens=100000, # Above 128k threshold - total_tokens=300000, + prompt_tokens=250000, + completion_tokens=100000, + total_tokens=400000, completion_tokens_details=CompletionTokensDetailsWrapper( accepted_prediction_tokens=0, audio_tokens=0, - reasoning_tokens=50000, # Total completion tokens = 100000 + 50000 = 150000 > 128k + reasoning_tokens=50000, rejected_prediction_tokens=0, text_tokens=None, ), ) - - prompt_cost, completion_cost = cost_per_token( - model="xai/grok-4-fast-reasoning", usage=usage - ) - - # Expected costs for grok-4-fast-reasoning with tiered pricing: - # Input: 150000 tokens * $0.4e-6 (ALL tokens at tiered rate since input > 128k) = $0.06 - # Completion: (100000 + 50000) tokens * $1e-6 (tiered rate since input > 128k) = $0.15 - expected_prompt_cost = 150000 * 0.4e-6 - expected_completion_cost = (100000 + 50000) * 1e-6 - + prompt_cost, completion_cost = cost_per_token(model="xai/grok-4.3", usage=usage) + expected_prompt_cost = 250000 * 2.5e-6 + expected_completion_cost = (100000 + 50000) * 5e-6 assert math.isclose(prompt_cost, expected_prompt_cost, rel_tol=1e-10) assert math.isclose(completion_cost, expected_completion_cost, rel_tol=1e-10) - def test_tiered_pricing_below_128k_tokens(self): - """Test that regular pricing is used for tokens below 128k threshold.""" - # Test with grok-4-fast-reasoning which has tiered pricing + def test_tiered_pricing_below_200k_tokens(self): usage = Usage( - prompt_tokens=100000, # Below 128k threshold + prompt_tokens=100000, completion_tokens=50000, total_tokens=160000, completion_tokens_details=CompletionTokensDetailsWrapper( @@ -235,26 +224,18 @@ def test_tiered_pricing_below_128k_tokens(self): text_tokens=None, ), ) - - prompt_cost, completion_cost = cost_per_token( - model="xai/grok-4-fast-reasoning", usage=usage - ) - - # Expected costs for grok-4-fast-reasoning with regular pricing: - # Input: 100000 tokens * $0.2e-6 (regular rate) = $0.02 - # Completion: (50000 + 10000) tokens * $0.5e-6 (regular rate) = $0.03 - expected_prompt_cost = 100000 * 0.2e-6 - expected_completion_cost = (50000 + 10000) * 0.5e-6 - + prompt_cost, completion_cost = cost_per_token(model="xai/grok-4.3", usage=usage) + expected_prompt_cost = 100000 * 1.25e-6 + expected_completion_cost = (50000 + 10000) * 2.5e-6 assert math.isclose(prompt_cost, expected_prompt_cost, rel_tol=1e-10) assert math.isclose(completion_cost, expected_completion_cost, rel_tol=1e-10) def test_tiered_pricing_grok_4_latest(self): """Test tiered pricing for grok-4-latest model.""" usage = Usage( - prompt_tokens=200000, # Above 128k threshold + prompt_tokens=250000, # Above the 200k threshold completion_tokens=100000, - total_tokens=350000, + total_tokens=400000, completion_tokens_details=CompletionTokensDetailsWrapper( accepted_prediction_tokens=0, audio_tokens=0, @@ -268,59 +249,45 @@ def test_tiered_pricing_grok_4_latest(self): model="xai/grok-4-latest", usage=usage ) - # Expected costs for grok-4-latest with tiered pricing: - # Input: 200000 tokens * $6e-6 (ALL tokens at tiered rate since input > 128k) = $1.2 - # Completion: (100000 + 50000) tokens * $30e-6 (tiered rate since input > 128k) = $4.5 - expected_prompt_cost = 200000 * 6e-6 - expected_completion_cost = (100000 + 50000) * 30e-6 + # grok-4-latest redirects to grok-4.3, which tiers at 200k rather than 128k: + # Input: 250000 tokens * $2.5e-6 (ALL tokens at tiered rate since input > 200k) + # Completion: (100000 + 50000) tokens * $5e-6 (tiered rate since input > 200k) + expected_prompt_cost = 250000 * 2.5e-6 + expected_completion_cost = (100000 + 50000) * 5e-6 assert math.isclose(prompt_cost, expected_prompt_cost, rel_tol=1e-10) assert math.isclose(completion_cost, expected_completion_cost, rel_tol=1e-10) - def test_tiered_pricing_output_tokens_below_128k(self): - """Test that output tokens get tiered rate when input tokens > 128k, even if output tokens < 128k.""" + def test_tiered_pricing_output_tokens_below_200k(self): usage = Usage( - prompt_tokens=150000, # Above 128k threshold - completion_tokens=50000, # Below 128k threshold - total_tokens=210000, + prompt_tokens=250000, + completion_tokens=50000, + total_tokens=310000, completion_tokens_details=CompletionTokensDetailsWrapper( accepted_prediction_tokens=0, audio_tokens=0, - reasoning_tokens=10000, # Total completion tokens = 50000 + 10000 = 60000 < 128k + reasoning_tokens=10000, rejected_prediction_tokens=0, text_tokens=None, ), ) - - prompt_cost, completion_cost = cost_per_token( - model="xai/grok-4-fast-reasoning", usage=usage - ) - - # Expected costs for grok-4-fast-reasoning: - # Input: 150000 tokens * $0.4e-6 (ALL tokens at tiered rate since input > 128k) = $0.06 - # Completion: (50000 + 10000) tokens * $1e-6 (tiered rate since input > 128k) = $0.06 - expected_prompt_cost = 150000 * 0.4e-6 - expected_completion_cost = (50000 + 10000) * 1e-6 - + prompt_cost, completion_cost = cost_per_token(model="xai/grok-4.3", usage=usage) + expected_prompt_cost = 250000 * 2.5e-6 + expected_completion_cost = (50000 + 10000) * 5e-6 assert math.isclose(prompt_cost, expected_prompt_cost, rel_tol=1e-10) assert math.isclose(completion_cost, expected_completion_cost, rel_tol=1e-10) def test_tiered_pricing_model_without_tiered_pricing(self): - """Test that models without tiered pricing use regular pricing even above 128k.""" - usage = Usage( - prompt_tokens=150000, # Above 128k threshold - completion_tokens=50000, - total_tokens=200000, - ) - - prompt_cost, completion_cost = cost_per_token(model="grok-3-mini", usage=usage) - - # grok-3-mini doesn't have tiered pricing, so should use regular rates: - # Input: 150000 tokens * $3e-7 (regular rate) = $0.045 - # Completion: 50000 tokens * $5e-7 (regular rate) = $0.025 - expected_prompt_cost = 150000 * 3e-7 + litellm.model_cost["xai/flat-rate-fixture"] = { + "input_cost_per_token": 3e-7, + "output_cost_per_token": 5e-7, + "litellm_provider": "xai", + "mode": "chat", + } + usage = Usage(prompt_tokens=250000, completion_tokens=50000, total_tokens=300000) + prompt_cost, completion_cost = cost_per_token(model="xai/flat-rate-fixture", usage=usage) + expected_prompt_cost = 250000 * 3e-7 expected_completion_cost = 50000 * 5e-7 - assert math.isclose(prompt_cost, expected_prompt_cost, rel_tol=1e-10) assert math.isclose(completion_cost, expected_completion_cost, rel_tol=1e-10) @@ -341,8 +308,8 @@ def test_already_normalised_usage_does_not_double_count_reasoning(self): prompt_cost, completion_cost = cost_per_token(model="grok-3-mini", usage=usage) - expected_prompt_cost = 12 * 3e-7 - expected_completion_cost = 200 * 5e-7 + expected_prompt_cost = 12 * 1.25e-6 + expected_completion_cost = 200 * 2.5e-6 assert math.isclose(prompt_cost, expected_prompt_cost, rel_tol=1e-10) assert math.isclose(completion_cost, expected_completion_cost, rel_tol=1e-10) diff --git a/tests/test_litellm/llms/xai/test_xai_redirected_slug_pricing.py b/tests/test_litellm/llms/xai/test_xai_redirected_slug_pricing.py new file mode 100644 index 000000000000..83c3bf1eceff --- /dev/null +++ b/tests/test_litellm/llms/xai/test_xai_redirected_slug_pricing.py @@ -0,0 +1,144 @@ +""" +xAI retired eight slugs on 2026-05-15 but kept them resolvable: chat slugs redirect to +grok-4.3 and bill at grok-4.3's rates, while the grok-code-fast slugs are aliases of +grok-build-0.1 and bill at its rates, so the registry must price them that way or spend +tracking is wrong. The grok-3-beta, grok-3-fast, grok-3-mini, and grok-4-1-fast slugs +are absent from /v1/language-models and resolve to grok-4.3 the same way (the chat +response names grok-4.3 as the served model), so they carry grok-4.3's rates too. +https://docs.x.ai/developers/migration/may-15-retirement +https://docs.x.ai/developers/models/grok-build-0.1 +""" + +from __future__ import annotations + +import json +from pathlib import Path + +import pytest + +REPO_ROOT = Path(__file__).parents[4] +PRICES_PATH = REPO_ROOT / "model_prices_and_context_window.json" +BACKUP_PRICES_PATH = REPO_ROOT / "litellm" / "model_prices_and_context_window_backup.json" +MAP_PATHS = (PRICES_PATH, BACKUP_PRICES_PATH) + +REDIRECT_TARGET = "xai/grok-4.3" +GROK_3_MINI_SLUGS = ( + "xai/grok-3-mini", + "xai/grok-3-mini-beta", + "xai/grok-3-mini-fast", + "xai/grok-3-mini-fast-beta", + "xai/grok-3-mini-fast-latest", + "xai/grok-3-mini-latest", +) +REDIRECTED_SLUGS = ( + "xai/grok-3", + "xai/grok-3-beta", + "xai/grok-3-fast-beta", + "xai/grok-3-fast-latest", + "xai/grok-3-latest", + *GROK_3_MINI_SLUGS, + "xai/grok-4", + "xai/grok-4-0709", + "xai/grok-4-1-fast", + "xai/grok-4-1-fast-non-reasoning", + "xai/grok-4-1-fast-non-reasoning-latest", + "xai/grok-4-1-fast-reasoning", + "xai/grok-4-1-fast-reasoning-latest", + "xai/grok-4-fast-non-reasoning", + "xai/grok-4-fast-reasoning", + "xai/grok-4-latest", +) +CODE_REDIRECT_TARGET = "xai/grok-build-0.1" +CODE_SLUGS = ( + "xai/grok-code-fast", + "xai/grok-code-fast-1", + "xai/grok-code-fast-1-0825", +) +RETIREMENT_DATE = "2026-05-15" +GROK_3_MINI_RETIREMENT_DATE = "2026-02-28" + +BASE_COST_FIELDS = ("input_cost_per_token", "output_cost_per_token", "cache_read_input_token_cost") +TIER_COST_FIELDS = ( + "input_cost_per_token_above_200k_tokens", + "output_cost_per_token_above_200k_tokens", + "cache_read_input_token_cost_above_200k_tokens", +) +STALE_TIER_FIELDS = ( + "input_cost_per_token_above_128k_tokens", + "output_cost_per_token_above_128k_tokens", + "cache_read_input_token_cost_above_128k_tokens", +) + + +def expected_retirement_date(slug: str) -> str: + return GROK_3_MINI_RETIREMENT_DATE if slug in GROK_3_MINI_SLUGS else RETIREMENT_DATE + + +@pytest.fixture(scope="module", params=[p.name for p in MAP_PATHS]) +def cost_map(request: pytest.FixtureRequest) -> dict: + path = next(p for p in MAP_PATHS if p.name == request.param) + return json.loads(path.read_text(encoding="utf-8")) + + +@pytest.mark.parametrize("slug", REDIRECTED_SLUGS) +def test_redirected_slug_bills_at_the_target_rate(cost_map: dict, slug: str): + target = cost_map[REDIRECT_TARGET] + entry = cost_map[slug] + for field in BASE_COST_FIELDS: + assert entry[field] == target[field], field + + +@pytest.mark.parametrize("slug", CODE_SLUGS) +def test_code_slug_bills_at_grok_build_rate(cost_map: dict, slug: str): + """grok-code-fast* are aliases of grok-build-0.1, not grok-4.3 redirects.""" + target = cost_map[CODE_REDIRECT_TARGET] + entry = cost_map[slug] + for field in (*BASE_COST_FIELDS, *TIER_COST_FIELDS): + assert entry[field] == target[field], field + + +@pytest.mark.parametrize("slug", (*REDIRECTED_SLUGS, *CODE_SLUGS)) +def test_redirected_slug_keeps_its_retirement_date(cost_map: dict, slug: str): + assert cost_map[slug]["deprecation_date"] == expected_retirement_date(slug) + + +@pytest.mark.parametrize("slug", REDIRECTED_SLUGS) +def test_no_slug_keeps_the_superseded_128k_tier(cost_map: dict, slug: str): + """The 128k tier belonged to the retired model; grok-4.3 tiers at 200k.""" + for field in STALE_TIER_FIELDS: + assert field not in cost_map[slug], field + + +@pytest.mark.parametrize("slug", REDIRECTED_SLUGS) +def test_redirected_slug_carries_the_target_tier_rates(cost_map: dict, slug: str): + """The request executes as grok-4.3, so it is tiered at grok-4.3's 200k boundary.""" + target = cost_map[REDIRECT_TARGET] + entry = cost_map[slug] + for field in TIER_COST_FIELDS: + assert entry[field] == target[field], field + + +def test_a_live_xai_model_is_untouched(cost_map: dict): + """Guard against the repricing leaking onto models xAI still serves directly.""" + assert cost_map["xai/grok-4.6"]["input_cost_per_token"] != cost_map[REDIRECT_TARGET]["input_cost_per_token"] + assert "deprecation_date" not in cost_map["xai/grok-4.6"] + + +def test_both_cost_maps_agree_on_the_redirected_slugs(): + prices = json.loads(PRICES_PATH.read_text(encoding="utf-8")) + backup = json.loads(BACKUP_PRICES_PATH.read_text(encoding="utf-8")) + for slug in (*REDIRECTED_SLUGS, *CODE_SLUGS, REDIRECT_TARGET, CODE_REDIRECT_TARGET): + assert prices[slug] == backup[slug], slug + + +def test_every_retired_chat_slug_is_covered(cost_map: dict): + """The lists above must stay in step with what the registry marks retired.""" + marked = { + key + for key, entry in cost_map.items() + if isinstance(entry, dict) + and entry.get("litellm_provider") == "xai" + and "deprecation_date" in entry + and entry.get("mode") == "chat" + } + assert marked == {*REDIRECTED_SLUGS, *CODE_SLUGS} diff --git a/tests/test_litellm/test_together_ai_model_metadata.py b/tests/test_litellm/test_together_ai_model_metadata.py index 45f0370386bc..76f3d7f3f9f6 100644 --- a/tests/test_litellm/test_together_ai_model_metadata.py +++ b/tests/test_litellm/test_together_ai_model_metadata.py @@ -15,6 +15,7 @@ SERVERLESS_CHAT_MODELS: Final = ( "together_ai/moonshotai/Kimi-K3", "together_ai/zai-org/GLM-5.2", + "together_ai/zai-org/GLM-5.3", "together_ai/zai-org/GLM-5.3-Flash", "together_ai/deepseek-ai/DeepSeek-V4-Pro-0813", "together_ai/deepseek-ai/DeepSeek-V4-Flash-0731",