The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Fix: Nonetype object has no method .get() for call tool
Sameer Kankutecc4542329402
diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.jsonindex c7a2f60856d..90b73e4709c 100644--- a/litellm/model_prices_and_context_window_backup.json+++ b/litellm/model_prices_and_context_window_backup.json@@ -405,7 +405,23 @@"supports_video_input": true,"supports_vision": true},-+ "amazon.nova-2-multimodal-embeddings-v1:0": {+ "litellm_provider": "bedrock",+ "max_input_tokens": 8172,+ "max_tokens": 8172,+ "mode": "embedding",+ "input_cost_per_token": 1.35e-7,+ "input_cost_per_image": 6e-5,+ "input_cost_per_video_per_second": 0.0007,+ "input_cost_per_audio_per_second": 0.00014,+ "output_cost_per_token": 0.0,+ "output_vector_size": 3072,+ "source": "https://us-east-1.console.aws.amazon.com/bedrock/home?region=us-east-1#/model-catalog/serverless/amazon.nova-2-multimodal-embeddings-v1:0",+ "supports_embedding_image_input": true,+ "supports_image_input": true,+ "supports_video_input": true,+ "supports_audio_input": true+ },"amazon.nova-micro-v1:0": {"input_cost_per_token": 3.5e-08,"litellm_provider": "bedrock_converse",@@ -32152,6 +32168,181 @@"output_cost_per_token": 2e-07,"litellm_provider": "fireworks_ai","mode": "chat"+ },+ "llamagate/llama-3.1-8b": {+ "max_tokens": 8192,+ "max_input_tokens": 131072,+ "max_output_tokens": 8192,+ "input_cost_per_token": 3e-08,+ "output_cost_per_token": 5e-08,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true+ },+ "llamagate/llama-3.2-3b": {+ "max_tokens": 8192,+ "max_input_tokens": 131072,+ "max_output_tokens": 8192,+ "input_cost_per_token": 4e-08,+ "output_cost_per_token": 8e-08,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true+ },+ "llamagate/mistral-7b-v0.3": {+ "max_tokens": 8192,+ "max_input_tokens": 32768,+ "max_output_tokens": 8192,+ "input_cost_per_token": 1e-07,+ "output_cost_per_token": 1.5e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true+ },+ "llamagate/qwen3-8b": {+ "max_tokens": 8192,+ "max_input_tokens": 32768,+ "max_output_tokens": 8192,+ "input_cost_per_token": 4e-08,+ "output_cost_per_token": 1.4e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true+ },+ "llamagate/dolphin3-8b": {+ "max_tokens": 8192,+ "max_input_tokens": 128000,+ "max_output_tokens": 8192,+ "input_cost_per_token": 8e-08,+ "output_cost_per_token": 1.5e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true+ },+ "llamagate/deepseek-r1-8b": {+ "max_tokens": 16384,+ "max_input_tokens": 65536,+ "max_output_tokens": 16384,+ "input_cost_per_token": 1e-07,+ "output_cost_per_token": 2e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true,+ "supports_reasoning": true+ },+ "llamagate/deepseek-r1-7b-qwen": {+ "max_tokens": 16384,+ "max_input_tokens": 131072,+ "max_output_tokens": 16384,+ "input_cost_per_token": 8e-08,+ "output_cost_per_token": 1.5e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true,+ "supports_reasoning": true+ },+ "llamagate/openthinker-7b": {+ "max_tokens": 8192,+ "max_input_tokens": 32768,+ "max_output_tokens": 8192,+ "input_cost_per_token": 8e-08,+ "output_cost_per_token": 1.5e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true,+ "supports_reasoning": true+ },+ "llamagate/qwen2.5-coder-7b": {+ "max_tokens": 8192,+ "max_input_tokens": 32768,+ "max_output_tokens": 8192,+ "input_cost_per_token": 6e-08,+ "output_cost_per_token": 1.2e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true+ },+ "llamagate/deepseek-coder-6.7b": {+ "max_tokens": 4096,+ "max_input_tokens": 16384,+ "max_output_tokens": 4096,+ "input_cost_per_token": 6e-08,+ "output_cost_per_token": 1.2e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true+ },+ "llamagate/codellama-7b": {+ "max_tokens": 4096,+ "max_input_tokens": 16384,+ "max_output_tokens": 4096,+ "input_cost_per_token": 6e-08,+ "output_cost_per_token": 1.2e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true+ },+ "llamagate/qwen3-vl-8b": {+ "max_tokens": 8192,+ "max_input_tokens": 32768,+ "max_output_tokens": 8192,+ "input_cost_per_token": 1.5e-07,+ "output_cost_per_token": 5.5e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true,+ "supports_vision": true+ },+ "llamagate/llava-7b": {+ "max_tokens": 2048,+ "max_input_tokens": 4096,+ "max_output_tokens": 2048,+ "input_cost_per_token": 1e-07,+ "output_cost_per_token": 2e-07,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_response_schema": true,+ "supports_vision": true+ },+ "llamagate/gemma3-4b": {+ "max_tokens": 8192,+ "max_input_tokens": 128000,+ "max_output_tokens": 8192,+ "input_cost_per_token": 3e-08,+ "output_cost_per_token": 8e-08,+ "litellm_provider": "llamagate",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true,+ "supports_vision": true+ },+ "llamagate/nomic-embed-text": {+ "max_tokens": 8192,+ "max_input_tokens": 8192,+ "input_cost_per_token": 2e-08,+ "output_cost_per_token": 0,+ "litellm_provider": "llamagate",+ "mode": "embedding"+ },+ "llamagate/qwen3-embedding-8b": {+ "max_tokens": 40960,+ "max_input_tokens": 40960,+ "input_cost_per_token": 2e-08,+ "output_cost_per_token": 0,+ "litellm_provider": "llamagate",+ "mode": "embedding"}}diff --git a/litellm/proxy/_experimental/mcp_server/rest_endpoints.py b/litellm/proxy/_experimental/mcp_server/rest_endpoints.pyindex 4c947b99ba3..642cb0cec2d 100644--- a/litellm/proxy/_experimental/mcp_server/rest_endpoints.py+++ b/litellm/proxy/_experimental/mcp_server/rest_endpoints.py@@ -218,10 +218,10 @@ if MCP_AVAILABLE:from fastapi import HTTPExceptionfrom litellm.exceptions import BlockedPiiEntityError, GuardrailRaisedException- from litellm.proxy.proxy_server import add_litellm_data_to_request, proxy_configfrom litellm.proxy._experimental.mcp_server.auth.user_api_key_auth_mcp import (MCPRequestHandler,)+ from litellm.proxy.proxy_server import add_litellm_data_to_request, proxy_configtry:data = await request.json()@@ -252,7 +252,12 @@ if MCP_AVAILABLE:if mcp_server_auth_headers:data["mcp_server_auth_headers"] = mcp_server_auth_headersdata["raw_headers"] = raw_headers_from_request-++ # Extract user_api_key_auth from metadata and add to top level+ # call_mcp_tool expects user_api_key_auth as a top-level parameter+ if "metadata" in data and "user_api_key_auth" in data["metadata"]:+ data["user_api_key_auth"] = data["metadata"]["user_api_key_auth"]+result = await call_mcp_tool(**data)return resultexcept BlockedPiiEntityError as e:diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.pyindex d1a78534dae..f16c115fed3 100644--- a/litellm/proxy/utils.py+++ b/litellm/proxy/utils.py@@ -1195,7 +1195,7 @@ class ProxyLogging:and _callback.__class__.async_pre_call_hook!= CustomLogger.async_pre_call_hook):- if call_type == "mcp_call" and user_api_key_dict is None:+ if call_type == "call_mcp_tool" and user_api_key_dict is None:continueresponse = await _callback.async_pre_call_hook(