{"record":{"id":"2dbda7fea394c108","repo":"BerriAI/litellm","slug":"authenticationerror-exception-provider-messa","errorCode":null,"errorMessage":"AuthenticationError: {exception_provider} - {message}","messagePattern":"AuthenticationError: (.+?) - (.+?)","errorType":"exception","errorClass":"AuthenticationError","httpStatus":401,"severity":"error","filePath":"litellm/litellm_core_utils/exception_mapping_utils.py","lineNumber":382,"sourceCode":"    ):\n        raise litellm.InternalServerError(\n            message=f\"{exception_provider} - {message}\",\n            model=model,\n            llm_provider=custom_llm_provider,\n        )\n    elif \"Request too large\" in error_str:\n        raise RateLimitError(\n            message=f\"RateLimitError: {exception_provider} - {message}\",\n            model=model,\n            llm_provider=custom_llm_provider,\n            response=getattr(original_exception, \"response\", None),\n            litellm_debug_info=extra_information,\n        )\n    elif (\n        \"The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable\"\n        in error_str\n    ):\n        raise AuthenticationError(\n            message=f\"AuthenticationError: {exception_provider} - {message}\",\n            llm_provider=custom_llm_provider,\n            model=model,\n            response=getattr(original_exception, \"response\", None),\n            litellm_debug_info=extra_information,\n        )\n    elif \"Mistral API raised a streaming error\" in error_str:\n        _request: Final = httpx.Request(method=\"POST\", url=\"https://api.openai.com/v1\")\n        raise APIError(\n            status_code=500,\n            message=f\"{exception_provider} - {message}\",\n            llm_provider=custom_llm_provider,\n            model=model,\n            request=_request,\n            litellm_debug_info=extra_information,\n        )\n    elif hasattr(original_exception, \"status_code\"):\n        if original_exception.status_code == 400:","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/litellm_core_utils/exception_mapping_utils.py#L364-L400","documentation":"Error \"AuthenticationError: {exception_provider} - {message}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:382 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the API key/credentials for the provider and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}