cerebras.cloud.sdk.APIError
. This documentation outlines the error types, how to handle them, and provides examples for effective error management.
cerebras.cloud.sdk.APIError
. The main categories of errors are:
cerebras.cloud.sdk.APIConnectionError
: Raised when the library is unable to connect to the API.cerebras.cloud.sdk.APIStatusError
: Raised when the API returns a non-success status code (4xx or 5xx).Status Code | Error Type |
---|---|
400 | BadRequestError |
401 | AuthenticationError |
403 | PermissionDeniedError |
404 | NotFoundError |
422 | UnprocessableEntityError |
429 | RateLimitError |
>=500 | InternalServerError |
N/A | APIConnectionError |
max_retries
option:
timeout
option:
APITimeoutError
is thrown. Note that requests that time out are retried twice by default.