Skip to main content

Error Response Format

When a task fails (status: "failed"), the response includes an error object:
{
  "id": "task-unified-1772618027-cmeisy8h",
  "object": "image.generation.task",
  "status": "failed",
  "model": "gemini-3.1-flash-image-preview",
  "progress": 0,
  "error": {
    "code": "content_policy_violation",
    "message": "Content policy violation.\nYour request was blocked by safety filters..."
  }
}
FieldTypeDescription
error.codestringError code identifier. See the full list below
error.messagestringUser-friendly error description with troubleshooting tips

Error Codes Overview

Client Errors (Fixable by User)

Error CodeDescriptionRetryable
content_policy_violationContent violates safety policiesFix content, then retry
invalid_parametersInvalid request parametersFix params, then retry
image_processing_errorImage processing failedUse different image
image_dimension_mismatchImage dimensions don’t match requestResize image, then retry
request_cancelledRequest was cancelledResubmit
Error CodeDescriptionRetryable
generation_failed_no_contentModel failed to generate outputTry different prompt
service_errorInternal service errorAuto-recovers, retry later
generation_timeoutTask processing timed outRetry later
resource_exhaustedUpstream resources temporarily depletedAuto-recovers, retry later
quota_exceededRate limit or quota exceededReduce frequency, retry later
service_unavailableService temporarily unavailableAuto-recovers, retry later
resource_not_foundTask ID invalid or expiredCheck task ID
unknown_errorUnclassified errorContact support

Error Code Details

content_policy_violation

Content Policy Violation

Your request was blocked by safety filters. This is the most common error type, covering the following scenarios:
Common Triggers:
Sub-typeDescriptionExample Message
Photorealistic peopleUploaded image contains real human facesphotorealistic people detected
Celebrity likenessInvolves celebrities or public figurescelebrity detected in image
Copyright/TrademarkInvolves brand logos, trademarks, or copyrighted IPthird-party content violation
Adult/NSFWContains nudity or sexually suggestive contentnudity detected
Violence/Self-harmContains violent, graphic, or self-harm contentviolence content blocked
Minor protectionInvolves sensitive content related to minorsminor content not allowed
General policyOther content policy violationscontent policy violation
How to avoid:
  • Avoid uploading real photos of people — use illustration or cartoon styles instead
  • Remove brand logos, trademarks, and copyrighted IP characters
  • Avoid adult, violent, or self-harm themes
  • Use generic character descriptions (e.g., “a person”) instead of referencing specific celebrities

generation_failed_no_content

Generation Failed

The model was unable to produce output for your request. While the request format was valid, the model could not generate a result during processing.
Common Causes:
  • Poor prompt quality: Description is too vague or contradictory for the model to understand
  • Model capability limits: The prompt exceeds the model’s generation capabilities
  • Upstream service issues: The underlying model service returned an empty result
  • Protected content detection: The prompt or reference image may involve watermark removal or protected content (logos, trademarks, etc.)
How to fix:
  • Adjust your prompt to be more clear and specific
  • Use different reference images — avoid images with watermarks or logos
  • Simplify the request (lower resolution or complexity)
  • Simply retry — some cases succeed on retry

invalid_parameters

Invalid Parameters

Request parameters do not meet model requirements.
Common Sub-types:
Sub-typeDescriptionExample
Prompt too longPrompt exceeds model’s maximum lengthPrompt is too long
Image dimensionImage width/height or aspect ratio out of rangeimage dimensions must be between 240 and 7680
File too largeUploaded file exceeds size limitfile size exceeds 10MB
Unsupported formatUploaded file format is not supportedunsupported file type
Video durationVideo duration outside model’s supported rangeVideo duration must be between 1-30 seconds
How to fix:
  • Check the model-specific API documentation for parameter requirements
  • Supported image formats: JPG, PNG, WebP, GIF (HEIC, AVIF, TIFF are not supported)
  • Image size limits: typically < 10MB, some models < 30MB
  • Shorten your prompt or split long prompts into core descriptions

image_processing_error

Image Processing Failed

The system could not process the input image.
Common Causes:
  • Image URL is inaccessible (authentication required, CDN restrictions, expired link)
  • Image format is not supported (e.g., HEIC, AVIF)
  • Image file is corrupted
  • Network issues prevented image download
How to fix:
  • Ensure the image URL is publicly accessible with no authentication or region restrictions
  • Use standard formats: JPG, PNG, WebP
  • Try using the File Upload API instead of URLs
  • Verify the image opens correctly in a browser

image_dimension_mismatch

Image Dimension Mismatch

The input image dimensions do not match the dimensions specified in the request. Common in image-to-video scenarios.
Example:
  • aspect_ratio=1280x720 (16:9) requires a 1280x720 landscape image
  • aspect_ratio=720x1280 (9:16) requires a 720x1280 portrait image
How to fix: Resize your image to match the requested aspect_ratio parameter, or change the aspect_ratio to match your image.

service_error

Service Error

An internal issue occurred in the upstream service. This is usually temporary — the system automatically switches to other available routes.
Common Causes:
  • Upstream model service temporarily unavailable
  • Server overload / high traffic
  • Maintenance in progress
  • Network connection interrupted
How to fix:
  • Wait 30-60 seconds and retry — the system usually recovers automatically
  • If persistent, contact technical support
  • No need to modify your request — retry the same request

generation_timeout

Generation Timeout

The task did not complete within the allowed time.
Common Causes:
  • High system load causing queue delays
  • High task complexity (high resolution, long video, etc.)
  • Slow upstream service response
How to fix:
  • Retry later, preferably during off-peak hours
  • Reduce task complexity: lower resolution, shorter video duration
  • Simplify prompt descriptions

quota_exceeded

Quota / Rate Limit Exceeded

Request frequency or concurrency limits have been exceeded.
Common Causes:
  • Too many requests sent in a short period (rate limiting)
  • Multiple tasks processing simultaneously (concurrency limit)
  • Account quota depleted
How to fix:
  • Reduce request frequency — recommended 1-2 second interval between requests
  • Wait for in-progress tasks to complete before submitting new ones
  • If quota is depleted, visit the billing page to recharge

resource_exhausted

Resource Exhausted

Upstream service compute resources are temporarily depleted. Usually occurs during peak model usage periods.
How to fix:
  • Wait 1-5 minutes for automatic recovery
  • The system automatically switches between multiple routes — retrying later usually succeeds

resource_not_found

Resource Not Found

The requested task ID does not exist or has expired.
How to fix:
  • Verify the task ID is correctly spelled
  • Task results have an expiration period — expired tasks cannot be queried
  • If the ID is correct, retry after a short wait

request_cancelled

Request Cancelled

The task was cancelled or interrupted during processing.
If you did not intentionally cancel, simply resubmit the same request.

service_unavailable

Service Unavailable

An internal authentication or connection issue occurred. This error has been automatically logged and will typically be resolved quickly.
How to fix:
  • Wait a few minutes and retry
  • If persistent, contact technical support with your task ID

unknown_error

Unknown Error

An unclassified error. The system could not identify the specific error type.
How to fix:
  • Retry after a short wait
  • If the issue persists, contact technical support with the full task ID

Best Practices

Error Handling Example

import requests
import time

def poll_task_with_retry(task_id, api_key, max_retries=3):
    """Poll task status with automatic retry for server errors"""
    headers = {"Authorization": f"Bearer {api_key}"}

    for attempt in range(max_retries):
        resp = requests.get(
            f"https://api.evolink.ai/v1/tasks/{task_id}",
            headers=headers
        )
        data = resp.json()

        if data["status"] == "completed":
            return data["results"]

        if data["status"] == "failed":
            error = data.get("error", {})
            code = error.get("code", "unknown_error")
            message = error.get("message", "")

            # Client errors — not retryable, fix the request
            if code in [
                "content_policy_violation",
                "invalid_parameters",
                "image_processing_error",
                "image_dimension_mismatch",
            ]:
                raise Exception(f"Client error [{code}]: {message}")

            # Server errors — retryable
            if code in [
                "generation_failed_no_content",
                "service_error",
                "generation_timeout",
                "resource_exhausted",
                "quota_exceeded",
            ]:
                if attempt < max_retries - 1:
                    wait = 2 ** attempt * 5  # 5s, 10s, 20s
                    time.sleep(wait)
                    continue
                raise Exception(f"Server error [{code}]: {message}")

            raise Exception(f"Error [{code}]: {message}")

        # Task still processing
        time.sleep(3)

    raise Exception("Max polling attempts exceeded")

Retryable vs Non-Retryable

Fix Request Before Retry

  • content_policy_violation — Modify content
  • invalid_parameters — Fix parameters
  • image_processing_error — Use different image
  • image_dimension_mismatch — Resize image

Safe to Retry Directly

  • generation_failed_no_content — Try different prompt
  • service_error — Wait, then retry
  • generation_timeout — Wait, then retry
  • resource_exhausted — Auto-recovers
  • quota_exceeded — Reduce frequency, then retry