Understanding common errors with Generative APIs
Scaleway uses conventional HTTP response codes to indicate the success or failure of an API request. In general:
- codes in the
2xxrange indicate success - codes in the
4xxrange indicate an error caused by the information provided - codes in the
5xxrange show an error from Scaleway servers
If the response code is not within the 2xx range, the API returns an error object. The structure of the error object depends on how recent the model being used is:
Below are common HTTP error codes:
- 400 - Bad Request: The format or content of your payload is incorrect. The body may be too large, or fails to parse, or the
content-typeis mismatched. - 401 - Unauthorized: The
authorizationheader is missing. For information about the required headers, see the Using Generative APIs page. - 403 - Forbidden: Your API key does not exist or does not have the necessary permissions to access the requested resource. For information about the required permission sets, see the Using Generative APIs page.
- 404 - Route Not Found: The requested resource could not be found. Check if your request is being made to the correct endpoint.
- 422 - Model Not Found: The
modelkey is present in the request payload, but the corresponding model is not found. - 422 - Missing Model: The
modelkey is missing from the request payload. - 429 - Too Many Requests: You are exceeding your current quota for the requested model, calculated in requests per minute. For information about rate limits, see the Rate limits page.
- 429 - Too Many Tokens: You are exceeding your current quota for the requested model, calculated in tokens per minute. For information about rate limits, see the Rate limits page.
- 500 - API error: An unexpected internal error has occurred within Scaleway's systems. If the issue persists, open a Support ticket.
For streaming responses via SSE, 5xx errors may occur after a 200 response has been returned.
Still need help?Create a support ticket