Справочник ошибок
При успешном ответе HTTP-статус равен 200, а поле code в теле — нулю. При ошибке возвращается соответствующий HTTP-статус, а машиночитаемый код передаётся в поле code.
Формат ответа
{ "code": 5, "message": "Insufficient balance, check account balance.", "trace_id": "662f1a9c4b1e2d0012a3b4c5"}| Поле | Тип | Обяз. | Описание |
|---|---|---|---|
code | number | да | Код ошибки (0 при успехе, см. таблицу ниже). |
message | string | да | Человекочитаемое описание ошибки. |
details | array | нет | Детали валидации входных данных (присутствует при code: 3). |
trace_id | string | нет | Идентификатор запроса для обращения в поддержку (при внутренних ошибках, code: 1). |
Авторизация
Если API-ключ отсутствует или недействителен, возвращается HTTP 401 с телом вида { "error": { "message": "Unauthorized" } }. Проверьте заголовок Authorization.
Доступные ошибки
| Code | HTTP | Message |
|---|---|---|
| 1 | 500 | Internal server error. |
| 3 | 400 | Invalid input, check schema issues. |
| 5 | 402 | Insufficient balance, check account balance. |
| 6 | 429 | API key limit exceeded. Check your daily or monthly limits. |
| 7 | 403 | Model is not available for this account (banned or restricted). |
| 20 | 404 | Model not found or is not available via the LAB API. |
| 21 | 410 | Model is deprecated or not available for this organization. |
| 22 | 404 | Task not found. |
| 23 | 409 | Task with this idempotency_key already exists with different input. |
| 24 | 404 | Model is not available for this API key. Request GET /api/v2/media/models to see the models available to you. |
| 25 | 400 | Input file was rejected by the model. Check its size, format, resolution and aspect ratio. |
| 26 | 400 | Prompt was rejected by the model. Check its length and content. |
| 27 | 400 | Requested combination of parameters is not supported by this model. |
| 28 | 503 | Generation failed for a reason we could not attribute. Repeat the same request later; if it keeps failing, check the input files and their URLs. |
| 99 | 404 | API method not found, check the URL. |
| 1001 | 400 | Sensitive content has been detected in your request or uploaded files. Please check the text and media and try again. |
| 1002 | 400 | Request was blocked by moderation. |