Skip to main content

Why does generation return a task?

Image and video generation can take time. Create endpoints return a task_id so your app can poll for status without blocking the initial request.

Which query endpoint should I use?

When should I stop polling?

Stop when status is Success, Failed, or Cancelled.

Where do I find the final output?

For image tasks, successful responses include output_images. For video tasks, successful responses include file_url.

How often should I poll?

For images, wait about 10 seconds before polling, then poll every few seconds. For videos, wait about 30 seconds before polling, then use a slower interval as the task ages. Avoid polling every second in production.

Why do query endpoints use message instead of msg?

The create endpoints use msg, while query endpoints use message at the envelope level. Plan for both field names when parsing responses.