Skip to content

Commit 12e3a43

Browse files
authored
fix(genapi): errors (#5620)
* fix(genapi): errors * Apply suggestions from code review
1 parent f95c091 commit 12e3a43

File tree

1 file changed

+33
-10
lines changed

1 file changed

+33
-10
lines changed

pages/generative-apis/api-cli/understanding-errors.mdx

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,47 @@ title: Understanding common errors with Generative APIs
33
description: This page explains how to understand errors with Generative APIs
44
tags: generative-apis ai-data understanding-data
55
dates:
6-
validation: 2025-05-12
6+
validation: 2025-10-07
77
posted: 2024-09-02
88
---
99

1010
Scaleway uses conventional HTTP response codes to indicate the success or failure of an API request.
1111
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.
1212

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:
1414

15-
```
16-
{
17-
"error": string,
18-
"status": number,
19-
"message": string
20-
}
21-
```
15+
<Tabs id="error-message">
2216

23-
Below are usual HTTP error codes:
17+
<TabsTab label="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+
<TabsTab label="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:
2447

2548
- 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.
2649
- 401 - **Unauthorized**: The `authorization` header is missing. Find required headers in [this page](/generative-apis/api-cli/using-generative-apis/)

0 commit comments

Comments
 (0)