BerriAI/litellm · error · ValueError
ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN is required for…
Error message
ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN is required for Skills API
What it means
Error "ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN is required for Skills API" thrown in BerriAI/litellm.
Solutions
- Set ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN before calling the Skills API.
When it happens
Trigger: Thrown at litellm/llms/anthropic/skills/transformation.py:46 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/b6f56865d4f179bc.
Report an issue: GitHub.
Appendix: source
Thrown at litellm/llms/anthropic/skills/transformation.py:46
@property
def custom_llm_provider(self) -> LlmProviders:
return LlmProviders.ANTHROPIC
def validate_environment(self, headers: dict, litellm_params: GenericLiteLLMParams | None) -> dict:
"""Add Anthropic-specific headers"""
from litellm.llms.anthropic.common_utils import AnthropicModelInfo
# Get API key from litellm_params if available
api_key = None
api_base = None
if litellm_params is not None:
api_key = litellm_params.api_key
api_base = litellm_params.api_base
auth_header: Final = AnthropicModelInfo.get_auth_header(api_key, api_base)
if auth_header is None:
raise ValueError("ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN is required for Skills API")
headers.update(auth_header)
headers["anthropic-version"] = "2023-06-01"
# Add beta header for skills API
from litellm.constants import ANTHROPIC_SKILLS_API_BETA_VERSION
if "anthropic-beta" not in headers:
headers["anthropic-beta"] = ANTHROPIC_SKILLS_API_BETA_VERSION
elif isinstance(headers["anthropic-beta"], list):
if ANTHROPIC_SKILLS_API_BETA_VERSION not in headers["anthropic-beta"]:
headers["anthropic-beta"].append(ANTHROPIC_SKILLS_API_BETA_VERSION)
elif isinstance(headers["anthropic-beta"], str):
if ANTHROPIC_SKILLS_API_BETA_VERSION not in headers["anthropic-beta"]:
headers["anthropic-beta"] = [
headers["anthropic-beta"],
ANTHROPIC_SKILLS_API_BETA_VERSION,
]View on GitHub (pinned to 77b7c6c40c)