Skip to content

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

fix main lint error

Sameer Kankute18e16f907f9e
diff --git a/litellm/main.py b/litellm/main.py
index 7855ff099be..1936101ef92 100644
--- a/litellm/main.py
+++ b/litellm/main.py
@@ -1693,6 +1693,11 @@ def completion( # type: ignore # noqa: PLR0915
if "claude" in model_lower:
# Use Azure Anthropic handler for Claude models
api_base = AzureFoundryModelInfo.get_api_base(api_base)
+ if api_base is None:
+ raise ValueError(
+ "Azure Anthropic requests require an api_base. "
+ "Set `api_base` or the AZURE_AI_API_BASE env var."
+ )
api_key = AzureFoundryModelInfo.get_api_key(api_key)
# Ensure the URL ends with /v1/messages for Anthropic