---
title: Understanding common errors with Generative APIs
description: This page explains how to understand errors with Generative APIs
tags: generative-apis ai-data understanding-data
dates:
  validation: 2025-10-07
  posted: 2024-09-02
---

Scaleway uses conventional HTTP response codes to indicate the success or failure of an API request. 
In general:
- codes in the `2xx` range indicate success
- codes in the `4xx` range indicate an error caused by the information provided
- codes in the `5xx` range 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:

<Tabs>

  <TabsTab label="Recent models">
    Recent models, such as Mistral Small 3.2, GPT-OSS 120b and Qwen3 235b, use the following error format:
    ```
    {
      "error": {
        "message": string,
        "type": string,
        "param": null,
        "code": number
      }
    }
    ```
  </TabsTab>

  <TabsTab label="Legacy models">
    Legacy models, such as Llama 3.3 and Gemma 3, use the following error format:
    ```
    {
      "object": "error",
      "message": string
      "type": string,
      "param": null,
      "code": number      
    }
    ```
   We are gradually upgrading the error message format for legacy models, to bring them in line with the format for recent models.
  </TabsTab>
</Tabs>

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-type` is mismatched.
- 401 - **Unauthorized**: The `authorization` header is missing. For information about the required headers, see the [Using Generative APIs](/generative-apis/api-cli/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](/generative-apis/api-cli/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 `model` key is present in the request payload, but the corresponding model is not found.
- 422 - **Missing Model**:  The `model` key 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](/generative-apis/reference-content/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](/generative-apis/reference-content/rate-limits/) page.
- 500 - **API error**: An unexpected internal error has occurred within Scaleway's systems. If the issue persists, [open a Support ticket](https://console.scaleway.com/support/tickets/create).

For streaming responses via SSE, 5xx errors may occur after a 200 response has been returned.