Errors
Error envelope, public error codes, field errors, and retry guidance
Error response structure
OpenAPI endpoints return a structured error object when the request cannot be accepted:
{
"error": {
"code": "not_found",
"type": "resource_error",
"message": "Generation not found",
"retryable": false,
"details": {}
}
}If the error happens after a generation has been created, the same error object is embedded in the generation resource returned by polling or webhook delivery:
{
"id": "gen_abc123",
"status": "failed",
"model": "bytedance/seedance/v2/image-to-video",
"output": [],
"error": {
"code": "generation_failed",
"type": "provider_error",
"message": "Generation failed due to a temporary issue. Please try again later.",
"retryable": true,
"details": {
"trace_ref": "1DEC",
"request_id": "454556e0e86cd4ee60a7cf9825571dec",
"category": "temporary",
"field_errors": [
{
"field": ["reference_assets", 0, "url"],
"type": "reference_image_upload_failed",
"message": "Reference image 1 could not be uploaded for media validation.",
"constraint": {
"stage": "upload",
"index": 0
}
}
]
}
}
}For asynchronous jobs, GET /open/v1/generations/{id} and generation.failed webhooks use the same generation projection. The lightweight GET /open/v1/generations/{id}/status endpoint only returns status progress fields and does not include full error details.
Error object
Prop
Type
Message levels
error.message is a short, stable summary for alerts, logs, and default UI copy. It should explain the overall failure without embedding long provider output, raw payloads, or per-field diagnostics.
Use error.details.field_errors[].message for scoped diagnostics tied to a specific field, asset, or output. These messages can include the concrete provider-safe reason, such as a raw text output when an image model returned text instead of an image.
{
"error": {
"code": "no_output",
"message": "The model did not produce an image for this prompt. Try rephrasing the prompt.",
"details": {
"field_errors": [
{
"field": ["output"],
"type": "model_text_output_without_image",
"message": "Raw model output: \"I cannot generate that image.\"",
"constraint": {
"rawOutput": "I cannot generate that image."
}
}
]
}
}
}Details object
When the underlying generation queue returns a public error, OpenAPI preserves its public information under error.details:
Prop
Type
Field errors
field_errors are a structured projection of queue public_error.details[]. The stable fields are:
Prop
Type
field_errors may include additional keys as the queue adds more public context. Treat unknown keys as informational and preserve them in logs.
Public error codes
Generation failures use public error codes from the queue. The table below is synchronized from the queue public error contract.
| HTTP | Code | Category | Suggested wait | Meaning |
|---|---|---|---|---|
| 422 | validation_error | validation | - | Input validation failed. |
| 400 | model_not_found | validation | - | The specified model does not exist. |
| 422 | content_policy_violation | validation | - | The request or input media was rejected by content moderation. |
| 422 | no_output | validation | - | The model did not produce an image for this prompt. Try rephrasing the prompt. |
| 422 | image_too_large | validation | - | The image exceeds the maximum allowed resolution or file size. |
| 422 | image_too_small | validation | - | The image is below the minimum required resolution. |
| 422 | unsupported_media_format | validation | - | The provided media format is not supported. |
| 422 | media_duration_exceeded | validation | - | The media duration exceeds the maximum allowed length. |
| 422 | media_constraint_violation | validation | - | Input media failed a provider constraint such as duration, dimensions, aspect ratio, size, pixel count, frame rate, or count. |
| 422 | media_load_error | validation | - | Failed to download or process the provided media URL. |
| 422 | reference_aspect_ratio_invalid | validation | - | Reference assets have incompatible aspect ratios. |
| 422 | invalid_parameters | validation | - | The parameter combination is not supported by the selected model/provider. |
| 403 | rejected_by_policy | validation | - | The request was rejected by account or routing policy. |
| 422 | routing_no_candidates | validation | - | The request could not be routed to an available provider. |
| 400 | bad_request | validation | - | The request body is malformed. |
| 503 | service_unavailable | temporary | 60s | The service or upstream provider is temporarily unavailable. |
| 429 | capacity_exceeded | temporary | 10s | Capacity or rate limit was exceeded. |
| 500 | generation_failed | temporary | 20s | Generation failed due to a temporary issue. |
| 504 | timeout | temporary | 45s | The task timed out. |
| 401 | unauthorized | permanent | - | Authentication failed. |
| 403 | forbidden | permanent | - | The caller does not have permission to perform this action. |
| 404 | task_not_found | permanent | - | The specified task does not exist. |
| 500 | task_cancelled | permanent | - | The task was cancelled by request. |
| 409 | duplicate_task_id | permanent | - | A task with this id already exists. |
| 500 | service_configuration_error | permanent | - | The service is not configured correctly. Contact support if this persists. |
| 500 | internal_error | permanent | - | An internal error occurred. Contact support if this persists. |
| 409 | task_already_completed | permanent | - | The task has already reached a terminal state. |
The HTTP column describes the queue public error contract. For already-created async generations, polling usually returns HTTP 200 with status: "failed" and the error object embedded in the generation resource.
Common field error types
Field error type values are more granular than top-level code. They may vary by provider and model. Common values include:
| Type | Field | Meaning |
|---|---|---|
unsupported_parameter_for_model | input or a specific parameter | The selected model does not support this field or value. |
duration_allowed_values | duration | Duration must be one of the supported values. |
mutually_exclusive_parameters | input | Two or more parameters cannot be enabled together. |
prompt_required | prompt | A prompt is required for this request shape. |
image_dimension_out_of_range | reference_assets | Input image width or height is outside the supported range. |
reference_image_upload_failed | reference_assets.*.url | A reference image could not be uploaded for provider media validation. |
reference_video_upload_failed | reference_assets.*.url | A reference video could not be uploaded for provider media validation. |
reference_audio_upload_failed | reference_assets.*.url | A reference audio file could not be uploaded for provider media validation. |
reference_image_mime_unsupported | reference_assets.*.url | A reference image uses an unsupported format. |
reference_video_duration_exceeded | reference_assets.*.url | A reference video is longer than the provider limit. |
reference_video_duration_too_short | reference_assets.*.url | A reference video is shorter than the provider minimum. |
reference_audio_duration_too_short | reference_assets.*.url | A reference audio file is shorter than the provider minimum. |
reference_image_aspect_ratio_too_small | reference_assets.*.url | A reference image aspect ratio is below the supported range. |
reference_image_aspect_ratio_too_large | reference_assets.*.url | A reference image aspect ratio is above the supported range. |
reference_video_fps_too_large | reference_assets.*.url | A reference video frame rate is above the supported range. |
input_image_privacy_detected | reference_assets | A reference image may contain a real person and was rejected by moderation. |
risk_control_rejected | input | The provider risk control system rejected the request. |
provider_prompt_payload_mismatch | prompt | The selected video provider rejected an internal prompt payload format. |
Retry strategy
- Do not retry validation or permanent errors without changing the request.
- Retry
capacity_exceeded,service_unavailable,generation_failed, andtimeoutwhenretryableistrue. - Use the suggested wait in the table as a minimum backoff when the response does not include a more specific delay.
- Use
POST /open/v1/generations/{id}/retryfor failed generations when retrying the same input.
retryable is set on every OpenAPI error so clients can automate retry policy without hard-coding every code.