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
build(model_prices_and_context_window.json): add gpt-4.1 pricing (#9990)
Krish Dholakiabbb7541c2245
diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.jsonindex 4795c6d862b..09217ee04ac 100644--- a/litellm/model_prices_and_context_window_backup.json+++ b/litellm/model_prices_and_context_window_backup.json@@ -64,6 +64,144 @@"supports_system_messages": true,"supports_tool_choice": true},+ "gpt-4.1": {+ "max_tokens": 32768,+ "max_input_tokens": 1047576,+ "max_output_tokens": 32768,+ "input_cost_per_token": 2e-6,+ "output_cost_per_token": 8e-6,+ "input_cost_per_token_batches": 1e-6,+ "output_cost_per_token_batches": 4e-6,+ "cache_read_input_token_cost": 1e-6,+ "litellm_provider": "openai",+ "mode": "chat",+ "supported_endpoints": ["/v1/chat/completions", "/v1/batch", "/v1/responses"],+ "supported_modalities": ["text", "image"],+ "supported_output_modalities": ["text"],+ "supports_function_calling": true,+ "supports_parallel_function_calling": true,+ "supports_response_schema": true,+ "supports_vision": true,+ "supports_prompt_caching": true,+ "supports_system_messages": true,+ "supports_tool_choice": true,+ "supports_native_streaming": true+ },+ "gpt-4.1-2025-04-14": {+ "max_tokens": 32768,+ "max_input_tokens": 1047576,+ "max_output_tokens": 32768,+ "input_cost_per_token": 2e-6,+ "output_cost_per_token": 8e-6,+ "input_cost_per_token_batches": 1e-6,+ "output_cost_per_token_batches": 4e-6,+ "cache_read_input_token_cost": 1e-6,+ "litellm_provider": "openai",+ "mode": "chat",+ "supported_endpoints": ["/v1/chat/completions", "/v1/batch", "/v1/responses"],+ "supported_modalities": ["text", "image"],+ "supported_output_modalities": ["text"],+ "supports_function_calling": true,+ "supports_parallel_function_calling": true,+ "supports_response_schema": true,+ "supports_vision": true,+ "supports_prompt_caching": true,+ "supports_system_messages": true,+ "supports_tool_choice": true,+ "supports_native_streaming": true+ },+ "gpt-4.1-mini": {+ "max_tokens": 32768,+ "max_input_tokens": 1047576,+ "max_output_tokens": 32768,+ "input_cost_per_token": 0.4e-6,+ "output_cost_per_token": 1.6e-6,+ "input_cost_per_token_batches": 0.2e-6,+ "output_cost_per_token_batches": 0.8e-6,+ "cache_read_input_token_cost": 0.1e-6,+ "litellm_provider": "openai",+ "mode": "chat",+ "supported_endpoints": ["/v1/chat/completions", "/v1/batch", "/v1/responses"],+ "supported_modalities": ["text", "image"],+ "supported_output_modalities": ["text"],+ "supports_function_calling": true,+ "supports_parallel_function_calling": true,+ "supports_response_schema": true,+ "supports_vision": true,+ "supports_prompt_caching": true,+ "supports_system_messages": true,+ "supports_tool_choice": true,+ "supports_native_streaming": true+ },+ "gpt-4.1-mini-2025-04-14": {+ "max_tokens": 32768,+ "max_input_tokens": 1047576,+ "max_output_tokens": 32768,+ "input_cost_per_token": 0.4e-6,+ "output_cost_per_token": 1.6e-6,+ "input_cost_per_token_batches": 0.2e-6,+ "output_cost_per_token_batches": 0.8e-6,+ "cache_read_input_token_cost": 0.1e-6,+ "litellm_provider": "openai",+ "mode": "chat",+ "supported_endpoints": ["/v1/chat/completions", "/v1/batch", "/v1/responses"],+ "supported_modalities": ["text", "image"],+ "supported_output_modalities": ["text"],+ "supports_function_calling": true,+ "supports_parallel_function_calling": true,+ "supports_response_schema": true,+ "supports_vision": true,+ "supports_prompt_caching": true,+ "supports_system_messages": true,+ "supports_tool_choice": true,+ "supports_native_streaming": true+ },+ "gpt-4.1-nano": {+ "max_tokens": 32768,+ "max_input_tokens": 1047576,+ "max_output_tokens": 32768,+ "input_cost_per_token": 0.1e-6,+ "output_cost_per_token": 0.4e-6,+ "input_cost_per_token_batches": 0.05e-6,+ "output_cost_per_token_batches": 0.2e-6,+ "cache_read_input_token_cost": 0.025e-6,+ "litellm_provider": "openai",+ "mode": "chat",+ "supported_endpoints": ["/v1/chat/completions", "/v1/batch", "/v1/responses"],+ "supported_modalities": ["text", "image"],+ "supported_output_modalities": ["text"],+ "supports_function_calling": true,+ "supports_parallel_function_calling": true,+ "supports_response_schema": true,+ "supports_vision": true,+ "supports_prompt_caching": true,+ "supports_system_messages": true,+ "supports_tool_choice": true,+ "supports_native_streaming": true+ },+ "gpt-4.1-nano-2025-04-14": {+ "max_tokens": 32768,+ "max_input_tokens": 1047576,+ "max_output_tokens": 32768,+ "input_cost_per_token": 0.1e-6,+ "output_cost_per_token": 0.4e-6,+ "input_cost_per_token_batches": 0.05e-6,+ "output_cost_per_token_batches": 0.2e-6,+ "cache_read_input_token_cost": 0.025e-6,+ "litellm_provider": "openai",+ "mode": "chat",+ "supported_endpoints": ["/v1/chat/completions", "/v1/batch", "/v1/responses"],+ "supported_modalities": ["text", "image"],+ "supported_output_modalities": ["text"],+ "supports_function_calling": true,+ "supports_parallel_function_calling": true,+ "supports_response_schema": true,+ "supports_vision": true,+ "supports_prompt_caching": true,+ "supports_system_messages": true,+ "supports_tool_choice": true,+ "supports_native_streaming": true+ },"gpt-4o": {"max_tokens": 16384,"max_input_tokens": 128000,diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.jsonindex 4795c6d862b..09217ee04ac 100644--- a/model_prices_and_context_window.json+++ b/model_prices_and_context_window.json@@ -64,6 +64,144 @@"supports_system_messages": true,"supports_tool_choice": true},+ "gpt-4.1": {+ "max_tokens": 32768,+ "max_input_tokens": 1047576,+ "max_output_tokens": 32768,+ "input_cost_per_token": 2e-6,+ "output_cost_per_token": 8e-6,+ "input_cost_per_token_batches": 1e-6,+ "output_cost_per_token_batches": 4e-6,+ "cache_read_input_token_cost": 1e-6,+ "litellm_provider": "openai",+ "mode": "chat",+ "supported_endpoints": ["/v1/chat/completions", "/v1/batch", "/v1/responses"],+ "supported_modalities": ["text", "image"],+ "supported_output_modalities": ["text"],+ "supports_function_calling": true,+ "supports_parallel_function_calling": true,+ "supports_response_schema": true,+ "supports_vision": true,+ "supports_prompt_caching": true,+ "supports_system_messages": true,+ "supports_tool_choice": true,+ "supports_native_streaming": true+ },+ "gpt-4.1-2025-04-14": {+ "max_tokens": 32768,+ "max_input_tokens": 1047576,+ "max_output_tokens": 32768,+ "input_cost_per_token": 2e-6,+ "output_cost_per_token": 8e-6,+ "input_cost_per_token_batches": 1e-6,+ "output_cost_per_token_batches": 4e-6,+ "cache_read_input_token_cost": 1e-6,+ "litellm_provider": "openai",+ "mode": "chat",+ "supported_endpoints": ["/v1/chat/completions", "/v1/batch", "/v1/responses"],+ "supported_modalities": ["text", "image"],+ "supported_output_modalities": ["text"],+ "supports_function_calling": true,+ "supports_parallel_function_calling": true,+ "supports_response_schema": true,+ "supports_vision": true,+ "supports_prompt_caching": true,+ "supports_system_messages": true,+ "supports_tool_choice": true,+ "supports_native_streaming": true+ },+ "gpt-4.1-mini": {+ "max_tokens": 32768,+ "max_input_tokens": 1047576,+ "max_output_tokens": 32768,+ "input_cost_per_token": 0.4e-6,+ "output_cost_per_token": 1.6e-6,+ "input_cost_per_token_batches": 0.2e-6,+ "output_cost_per_token_batches": 0.8e-6,+ "cache_read_input_token_cost": 0.1e-6,+ "litellm_provider": "openai",+ "mode": "chat",+ "supported_endpoints": ["/v1/chat/completions", "/v1/batch", "/v1/responses"],+ "supported_modalities": ["text", "image"],+ "supported_output_modalities": ["text"],+ "supports_function_calling": true,+ "supports_parallel_function_calling": true,+ "supports_response_schema": true,+ "supports_vision": true,+ "supports_prompt_caching": true,+ "supports_system_messages": true,+ "supports_tool_choice": true,+ "supports_native_streaming": true+ },+ "gpt-4.1-mini-2025-04-14": {+ "max_tokens": 32768,+ "max_input_tokens": 1047576,+ "max_output_tokens": 32768,+ "input_cost_per_token": 0.4e-6,+ "output_cost_per_token": 1.6e-6,+ "input_cost_per_token_batches": 0.2e-6,+ "output_cost_per_token_batches": 0.8e-6,+ "cache_read_input_token_cost": 0.1e-6,+ "litellm_provider": "openai",+ "mode": "chat",+ "supported_endpoints": ["/v1/chat/completions", "/v1/batch", "/v1/responses"],+ "supported_modalities": ["text", "image"],+ "supported_output_modalities": ["text"],+ "supports_function_calling": true,+ "supports_parallel_function_calling": true,+ "supports_response_schema": true,+ "supports_vision": true,+ "supports_prompt_caching": true,+ "supports_system_messages": true,+ "supports_tool_choice": true,+ "supports_native_streaming": true+ },+ "gpt-4.1-nano": {+ "max_tokens": 32768,+ "max_input_tokens": 1047576,+ "max_output_tokens": 32768,+ "input_cost_per_token": 0.1e-6,+ "output_cost_per_token": 0.4e-6,+ "input_cost_per_token_batches": 0.05e-6,+ "output_cost_per_token_batches": 0.2e-6,+ "cache_read_input_token_cost": 0.025e-6,+ "litellm_provider": "openai",+ "mode": "chat",+ "supported_endpoints": ["/v1/chat/completions", "/v1/batch", "/v1/responses"],+ "supported_modalities": ["text", "image"],+ "supported_output_modalities": ["text"],+ "supports_function_calling": true,+ "supports_parallel_function_calling": true,+ "supports_response_schema": true,+ "supports_vision": true,+ "supports_prompt_caching": true,+ "supports_system_messages": true,+ "supports_tool_choice": true,+ "supports_native_streaming": true+ },+ "gpt-4.1-nano-2025-04-14": {+ "max_tokens": 32768,+ "max_input_tokens": 1047576,+ "max_output_tokens": 32768,+ "input_cost_per_token": 0.1e-6,+ "output_cost_per_token": 0.4e-6,+ "input_cost_per_token_batches": 0.05e-6,+ "output_cost_per_token_batches": 0.2e-6,+ "cache_read_input_token_cost": 0.025e-6,+ "litellm_provider": "openai",+ "mode": "chat",+ "supported_endpoints": ["/v1/chat/completions", "/v1/batch", "/v1/responses"],+ "supported_modalities": ["text", "image"],+ "supported_output_modalities": ["text"],+ "supports_function_calling": true,+ "supports_parallel_function_calling": true,+ "supports_response_schema": true,+ "supports_vision": true,+ "supports_prompt_caching": true,+ "supports_system_messages": true,+ "supports_tool_choice": true,+ "supports_native_streaming": true+ },"gpt-4o": {"max_tokens": 16384,"max_input_tokens": 128000,