Skip to main content
GET
Get task status

Get Task Status

Query the execution status of image and video generation tasks and retrieve results when complete.

Endpoint

Authentication

All requests require Bearer token authentication:

Get API Key

Generate your API key from the console

Parameters

Path Parameters

Response

Success Response (200)

Response Fields

Status Values

Response Examples by Status

Not Started

Running (Image)

Finished (Image)

Finished (Video)

Failed

Code Examples

cURL

Python

JavaScript / Node.js

Go

Java

PHP

Ruby

Polling Best Practices

When polling for task completion, follow these recommendations:
Poll Interval: Check status every 2-5 seconds. Avoid polling more frequently to prevent rate limiting.
Timeout: Implement timeouts to avoid infinite loops. Typical generation times:
  • Images: 15-60 seconds
  • Videos: 90-300 seconds
Exponential Backoff: On rate limit (429) or server errors (5xx), implement exponential backoff (wait 1s, 2s, 4s, 8s…).

Complete Polling Example

Error Responses

HTTP Error Codes

Error Response Format

Important Notes

Content Validity: Generated images and videos are accessible for 24 hours after creation. Download and save your content promptly.
Credits: Credits are only deducted when the task status becomes finished. Failed tasks do not consume credits.
Webhooks: Instead of polling, you can provide a callback_url when submitting tasks to receive automatic notifications. See the Quick Start guide.

Next Steps

Submit Task

Learn how to submit generation tasks

Image Generation

Generate images with GPT-4o

Video Generation

Create videos with Sora 2

Quick Start

Complete integration guide

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

task_id
string
required

Unique task identifier

Response

Task status retrieved successfully

code
integer
required

HTTP status code

Example:

200

data
object
required