BerriAI/litellm · error · AuthenticationError
AnthropicException - {error_str}
Error message
AnthropicException - {error_str} What it means
Error "AnthropicException - {error_str}" thrown in BerriAI/litellm.
Source
Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:548
model=model,
llm_provider="anthropic",
)
if "content filtering policy" in error_str:
raise ContentPolicyViolationError(
message=f"AnthropicError - {error_str}",
model=model,
llm_provider="anthropic",
)
if "Client error '400 Bad Request'" in error_str:
raise BadRequestError(
message=f"AnthropicError - {error_str}",
model=model,
llm_provider="anthropic",
)
if hasattr(original_exception, "status_code"):
verbose_logger.debug("status_code: %s", original_exception.status_code)
if original_exception.status_code == 401:
raise AuthenticationError(
message=f"AnthropicException - {error_str}",
llm_provider="anthropic",
model=model,
)
elif original_exception.status_code == 400 or original_exception.status_code == 413:
raise BadRequestError(
message=f"AnthropicException - {error_str}",
model=model,
llm_provider="anthropic",
)
elif original_exception.status_code == 404:
raise NotFoundError(
message=f"AnthropicException - {error_str}",
model=model,
llm_provider="anthropic",
)
elif original_exception.status_code == 408:
raise Timeout(View on GitHub (pinned to 6c2dcb801b)
Solutions
- Inspect the Anthropic exception message; adjust the request or credentials accordingly.
When it happens
Trigger: Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:548 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/a437e00c5ab6b924.
Report an issue: GitHub.