xAI API
xAI API errors and fixes
18 xAI API errors from the official error docs, grouped by HTTP status, each with what it means, why it happens, the documented fix and whether to retry. Verified .
- Official error docsdocs.x.ai
- Status pagestatus.x.ai
- xAI API rate limits
HTTP 400 Bad Request
HTTP 401 Unauthorized
HTTP 403 Forbidden
HTTP 404 Not Found
HTTP 405 Method Not Allowed
HTTP 415 Unsupported Media Type
HTTP 422 Unprocessable Content
HTTP 429 Too Many Requests
No HTTP status
gRPC RESOURCE_EXHAUSTEDgRPC status raised by the xAI Python SDK when a resource quota has been exceeded, meaning the user has exceeded their API usage quota or rate limits. Sync clients raise grpc.RpcError and async clients raise grpc.aio.AioRpcError.Retry? YesgRPC UNAVAILABLEThe service is currently unavailable, often a transient error: the model or endpoint invoked is temporarily down or there are connectivity issues. The xAI SDK retries this status automatically by default.Retry? YesgRPC DEADLINE_EXCEEDEDThe deadline for the request expired before the operation completed. Raised if the request exceeds the client timeout, which defaults to 1620 seconds (27 minutes).Retry? Not statedgRPC INVALID_ARGUMENTThe client specified an invalid argument, such as incorrect parameters or malformed input to the model or endpoint.Retry? Not statedgRPC UNAUTHENTICATEDThe request does not have valid authentication credentials: the API key is missing, invalid, or expired.Retry? Not statedgRPC PERMISSION_DENIEDThe caller does not have permission to execute the operation: the API key is disabled, blocked, or lacks permission to access a specific model or feature.Retry? Not statedgRPC NOT_FOUNDA specified resource was not found: the requested model or resource does not exist.Retry? Not statedgRPC INTERNALAn internal server error occurred on the xAI API side.Retry? Not statedgRPC UNKNOWNAn unknown error occurred: an unexpected issue on the server side, not specifically related to the request.Retry? Not statedgRPC DATA_LOSSUnrecoverable data loss or corruption occurred. In the xAI context this happens when you provide an image via URL (for example in a chat conversation) and the server fails to fetch the image from that URL.Retry? Not stated
Newsletter
Know when the APIs change
One email per week. New model releases, API changes, what broke, and how developers are working around it.