Skip to main content

What you will build

You will submit a Sora 2 video job, store the returned video ID, poll until the job completes, and download the finished video content.

Prerequisites

  • A CometAPI API key stored in COMETAPI_KEY
  • Python 3.10+ with requests, or Node.js 18+
  • A server-side worker or job queue for polling

API key, base URL, authentication

Create Sora jobs with:
Poll status with:
Download completed content with:
Authenticate with a Bearer token:

Code examples

Use the tabs below for copyable examples in cURL, Python, and Node.js.

Flow explanation

Sora generation is asynchronous. The create endpoint returns a video ID and an initial status. Poll GET /v1/videos/<video_id> until status is completed or failed. When the job is complete, download the file with GET /v1/videos/<video_id>/content. Use exact WxH sizes. The Sora API reference documents standard landscape and portrait sizes, with larger Pro sizes for Pro model workflows.

Common parameters

Troubleshooting / FAQ

Use multipart form data. Sora create requests in the reference use form fields, not a JSON body.
Download content only after the status endpoint reports completed. Store the finished file in your own storage.
Use larger Pro sizes only with a Pro model workflow. Start with 1280x720 for a first request.

Next steps

Last modified on June 30, 2026