You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/generative-apis/api-cli/understanding-errors.mdx
+33-10Lines changed: 33 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,24 +3,47 @@ title: Understanding common errors with Generative APIs
3
3
description: This page explains how to understand errors with Generative APIs
4
4
tags: generative-apis ai-data understanding-data
5
5
dates:
6
-
validation: 2025-05-12
6
+
validation: 2025-10-07
7
7
posted: 2024-09-02
8
8
---
9
9
10
10
Scaleway uses conventional HTTP response codes to indicate the success or failure of an API request.
11
11
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.
12
12
13
-
If the response code is not within the 2xx range, the response will contain an error object structured as follows:
13
+
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:
14
14
15
-
```
16
-
{
17
-
"error": string,
18
-
"status": number,
19
-
"message": string
20
-
}
21
-
```
15
+
<Tabsid="error-message">
22
16
23
-
Below are usual HTTP error codes:
17
+
<TabsTablabel="Recent models">
18
+
Recent models, such as Mistral Small 3.2, GPT-OSS 120b and Qwen3 235b, use the following error format:
19
+
```
20
+
{
21
+
"error": {
22
+
"message": string,
23
+
"type": string,
24
+
"param": null,
25
+
"code": number
26
+
}
27
+
}
28
+
```
29
+
</TabsTab>
30
+
31
+
<TabsTablabel="Legacy models">
32
+
Legacy models, such as Llama 3.3 and Gemma 3, use the following error format:
33
+
```
34
+
{
35
+
"object": "error",
36
+
"message": string
37
+
"type": string,
38
+
"param": null,
39
+
"code": number
40
+
}
41
+
```
42
+
We are gradually upgrading the error message format for legacy models, to bring them in line with the format for recent models.
43
+
</TabsTab>
44
+
</Tabs>
45
+
46
+
Below are common HTTP error codes:
24
47
25
48
- 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.
26
49
- 401 - **Unauthorized**: The `authorization` header is missing. Find required headers in [this page](/generative-apis/api-cli/using-generative-apis/)
0 commit comments