Skip to main content
Use GET /v1/tasks/{task_id} to query an asynchronous task from your account. Save the task ID and the request_id returned when you submit the job.

Status values

  • pending
  • processing
  • completed
  • failed
  • expired
While terminal is false, keep the same task ID and wait the indicated retry_after_ms before polling again. If your client reaches its own polling deadline, save the ID and resume later. To recover a request when you did not receive an ID, see media timeout handling.

Completed task

The shape of result depends on the task type. Image tasks return the OpenAI image format — the image URL is at result.data[0].url:
Video and audio tasks return the primary URL at result.video_url / result.audio_url, and every output is also listed in result.urls[]:

Failed task

The terminal task response includes credits.reserved and credits.charged. The reserved value is the original estimate. Use the charged value to check the final task cost, and see billing for failure handling. See webhooks to receive task notifications.