CommunityJoin our DiscordJoin
API Reference

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.

HTTPCodeCategorySuggested waitMeaning
422validation_errorvalidation-Input validation failed.
400model_not_foundvalidation-The specified model does not exist.
422content_policy_violationvalidation-The request or input media was rejected by content moderation.
422no_outputvalidation-The model did not produce an image for this prompt. Try rephrasing the prompt.
422image_too_largevalidation-The image exceeds the maximum allowed resolution or file size.
422image_too_smallvalidation-The image is below the minimum required resolution.
422unsupported_media_formatvalidation-The provided media format is not supported.
422media_duration_exceededvalidation-The media duration exceeds the maximum allowed length.
422media_constraint_violationvalidation-Input media failed a provider constraint such as duration, dimensions, aspect ratio, size, pixel count, frame rate, or count.
422media_load_errorvalidation-Failed to download or process the provided media URL.
422reference_aspect_ratio_invalidvalidation-Reference assets have incompatible aspect ratios.
422invalid_parametersvalidation-The parameter combination is not supported by the selected model/provider.
403rejected_by_policyvalidation-The request was rejected by account or routing policy.
422routing_no_candidatesvalidation-The request could not be routed to an available provider.
400bad_requestvalidation-The request body is malformed.
503service_unavailabletemporary60sThe service or upstream provider is temporarily unavailable.
429capacity_exceededtemporary10sCapacity or rate limit was exceeded.
500generation_failedtemporary20sGeneration failed due to a temporary issue.
504timeouttemporary45sThe task timed out.
401unauthorizedpermanent-Authentication failed.
403forbiddenpermanent-The caller does not have permission to perform this action.
404task_not_foundpermanent-The specified task does not exist.
500task_cancelledpermanent-The task was cancelled by request.
409duplicate_task_idpermanent-A task with this id already exists.
500service_configuration_errorpermanent-The service is not configured correctly. Contact support if this persists.
500internal_errorpermanent-An internal error occurred. Contact support if this persists.
409task_already_completedpermanent-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:

TypeFieldMeaning
unsupported_parameter_for_modelinput or a specific parameterThe selected model does not support this field or value.
duration_allowed_valuesdurationDuration must be one of the supported values.
mutually_exclusive_parametersinputTwo or more parameters cannot be enabled together.
prompt_requiredpromptA prompt is required for this request shape.
image_dimension_out_of_rangereference_assetsInput image width or height is outside the supported range.
reference_image_upload_failedreference_assets.*.urlA reference image could not be uploaded for provider media validation.
reference_video_upload_failedreference_assets.*.urlA reference video could not be uploaded for provider media validation.
reference_audio_upload_failedreference_assets.*.urlA reference audio file could not be uploaded for provider media validation.
reference_image_mime_unsupportedreference_assets.*.urlA reference image uses an unsupported format.
reference_video_duration_exceededreference_assets.*.urlA reference video is longer than the provider limit.
reference_video_duration_too_shortreference_assets.*.urlA reference video is shorter than the provider minimum.
reference_audio_duration_too_shortreference_assets.*.urlA reference audio file is shorter than the provider minimum.
reference_image_aspect_ratio_too_smallreference_assets.*.urlA reference image aspect ratio is below the supported range.
reference_image_aspect_ratio_too_largereference_assets.*.urlA reference image aspect ratio is above the supported range.
reference_video_fps_too_largereference_assets.*.urlA reference video frame rate is above the supported range.
input_image_privacy_detectedreference_assetsA reference image may contain a real person and was rejected by moderation.
risk_control_rejectedinputThe provider risk control system rejected the request.
provider_prompt_payload_mismatchpromptThe 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, and timeout when retryable is true.
  • 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}/retry for 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.

Troubleshooting