BerriAI/litellm · error · ValueError
api_key is required
Error message
api_key is required
What it means
Error "api_key is required" thrown in BerriAI/litellm.
Source
Thrown at litellm/integrations/arize/arize_phoenix_client.py:42
Supports:
- Authentication with Bearer tokens
- Fetching prompt versions
- Direct API base URL configuration
"""
def __init__(self, api_key: str | None = None, api_base: str | None = None):
"""
Initialize the Arize Phoenix client.
Args:
api_key: Arize Phoenix API token
api_base: Base URL for the Arize Phoenix API (e.g., 'https://app.phoenix.arize.com/s/workspace/v1')
"""
self.api_key = api_key
self.api_base = api_base
if not self.api_key:
raise ValueError("api_key is required")
if not self.api_base:
raise ValueError("api_base is required")
# Set up authentication headers
self.headers = {
"Authorization": f"Bearer {self.api_key}",
"Accept": "application/json",
}
# Initialize HTTPHandler
self.http_handler = HTTPHandler(disable_default_headers=True)
def get_prompt_version(self, prompt_version_id: str) -> dict[str, Any] | None:
"""
Fetch a prompt version from Arize Phoenix.
Args:View on GitHub (pinned to 6c2dcb801b)
Solutions
- Pass api_key to the Arize Phoenix client.
When it happens
Trigger: Thrown at litellm/integrations/arize/arize_phoenix_client.py:42 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15).
Data as JSON: /api/errors/5a54d4a2092ead66.
Report an issue: GitHub.