Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 32 additions & 10 deletions pages/generative-apis/api-cli/understanding-errors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,46 @@ 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-05-12
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, and codes in the 5xx range show an error from Scaleway servers.

If the response code is not within the 2xx range, the response will contain an error object structured as follows:
If the response code is not within the 2xx range, the response will contain an error object. The structure of the error object depends on how recent the model being used is:

```
{
"error": string,
"status": number,
"message": string
}
```
<Tabs id="error-message">

Below are usual HTTP error codes:
<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
}
```
</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 fail to parse, or the content-type is mismatched.
- 401 - **Unauthorized**: The `authorization` header is missing. Find required headers in [this page](/generative-apis/api-cli/using-generative-apis/)
Expand Down