Errors
Error codes and which ones to retry.
Errors use the OpenAI error shape:
{
"error": {
"message": "Human-readable description",
"type": "invalid_request",
"code": "unsupported_service_tier",
"param": "service_tier",
"request_id": "qlo-..."
}
}Use code in your code. Do not use message.
| Status | Code | Cause |
|---|---|---|
| 400 | invalid_request | The request is not correct. For a batch file, the message gives the line number. |
| 400 | context_length_exceeded | The prompt and max_tokens are more than the context window. |
| 400 | unsupported_service_tier | service_tier is not auto, default, realtime, async or flex. |
| 400 | unsupported_completion_window | completion_window is not 24h or 4h. |
| 400 | async_stream_unsupported | An Async request has "stream": true. |
| 401 | authentication_error | The API key is missing, not valid or revoked. |
| 402 | insufficient_credits | Your credit is too low. Add credit in the dashboard. |
| 403 | permission_denied | The key or organization does not have access, for example to Async and Batch. |
| 404 | model_not_found | The model ID is not known. IDs are case-sensitive. |
| 404 | not_found | No request, batch or file has this ID. |
| 413 | payload_too_large | The request is more than 20 MB, or the batch file is more than 200 MB. |
| 429 | rate_limit_exceeded | Too many requests, tokens or running batches, or the daily spend limit. |
| 502 | upstream_error | The model could not be served. |
| 503 | model_unavailable | The model or image and PDF processing is temporarily not available. |
| 504 | timeout | The request took too long. |
Retries
Retry 429, 502, 503 and 504 with exponential backoff. If the response has retry-after, wait that number of seconds. Do not retry other 4xx errors without a change to the request.
Support
Email hello@qloud.sh. Include the x-qlo-request-id, the time, the model ID and the status code. Do not send your API key.