- Version 1 (Classic Mode): Supports parameters such as
duration(10/15/25 seconds),orientation(landscape/portrait),size(small/large resolution), reference imagesimage_urls, and character ###character_url. - Version 2 (Partner Mode): Supports
seconds(4/8/12 seconds), pixel-level resolutionsize(e.g., 1280x720), reference imagesinput_reference, and other parameters.
Application Process
To use the API, you need to apply for the corresponding service on the Sora Videos Generation API page. After entering the page, click the “Acquire” button as shown below:
If you are not logged in or registered, you will be automatically redirected to the login page to register and log in. After logging in or registering, you will be automatically redirected back to the current page.
A free quota is provided upon the first application, allowing free use of the API.
Basic Usage (Version 1)
First, understand the basic usage of Version 1, which involves inputting the promptprompt, an array of reference image URLs image_urls, and the model model to get the processed result. The details are as follows:

accept: The desired response format, set toapplication/jsonfor JSON format.authorization: The API key for calling the API, selectable after application.
model: The video generation model, supportingsora-2(standard mode) andsora-2-pro(HD mode).sora-2-prosupports videos with adurationof 25 seconds, whilesora-2only supports 10 and 15 seconds.size: Video resolution,smallfor standard resolution,largefor HD resolution (Version 1 only).duration: Video length, supporting 10, 15, and 25 seconds; 25 seconds is supported only bysora-2-pro(Version 1 only).orientation: Aspect ratio, supportinglandscape(horizontal) andportrait(vertical) (Version 1 only).image_urls: Array of reference image URLs for image-to-video generation (Version 1 only).character_url: Character ### URL; no real persons should appear in the video (Version 1 only).character_start/character_end: Start and end seconds for character appearance, with a range difference of 1-3 seconds (Version 1 only).prompt: Prompt text (required).callback_url: URL for asynchronous callback results.version: API version,"1.0"(default) or"2.0".

success: The status of the video generation task.task_id: The ID of the video generation task.trace_id: The trace ID for the video generation task.data: The list of results for the video generation task.id: The video ID of the task.video_url: The video URL of the task.state: The status of the video generation task.
data field to access the generated Sora video.
If you want to generate integration code, you can directly copy the generated code. For example, the CURL code is as follows:
Image-to-Video Task (Version 1)
To perform an image-to-video task, the parameterimage_urls must be provided with reference image URLs, specifying the following:
image_urls: An array of reference image URLs used for the image-to-video task. Note that real-person images with faces should not be passed, as this may cause the task to fail.


Character-Generated Video Task (Version 1)
To perform a character-generated video task, the parametercharacter_url must be provided with the video URL needed to create the character. Note that no real persons should appear in the video, or the task will fail. The following applies:
character_url: The video URL needed to create the character; no real persons should appear in the video, or the task will fail.


Version 2.0 Mode
In addition to the above Version 1.0 mode, this API also supports Version 2.0 mode, which can be enabled by setting theversion parameter to "2.0". Version 2.0 supports shorter video durations and pixel-level resolution control.
Version 2.0 Parameter Description
| Parameter | Type | Required | Description |
|---|---|---|---|
version | string | Yes | Set to "2.0" |
prompt | string | Yes | Prompt text for video generation |
model | string | No | sora-2 (default) or sora-2-pro |
duration | integer | No | Video duration: 4 (default), 8, 12 seconds |
size | string | No | Resolution: 720x1280 (default), 1280x720, 1024x1792, 1792x1024 |
image_urls | array | No | Reference image URL array, only the first image is used; image size must match size parameter |
callback_url | string | No | Asynchronous callback URL |
Basic Example
Using Reference Images (Version 2.0)
In Version 2.0 mode, you can pass reference images through theimage_urls parameter to guide video generation (only the first image is used):
Note: The size of the reference image should match thesizeparameter. For example, ifsizeis1280x720, the reference image should be 1280×720 pixels.
Parameter Comparison Between Version 1.0 and Version 2.0
| Parameter | Version 1.0 | Version 2.0 |
|---|---|---|
version | 1.0 (default) | 2.0 |
prompt | ✅ | ✅ |
model | ✅ sora-2 / sora-2-pro | ✅ sora-2 / sora-2-pro |
duration | ✅ 10/15/25 seconds | ✅ 4/8/12 seconds |
orientation | ✅ landscape/portrait | ❌ |
size | ✅ small/large | ✅ 720x1280/1280x720/1024x1792/1792x1024 |
image_urls | ✅ multiple reference images | ✅ only the first image |
character_url | ✅ | ❌ |
callback_url | ✅ | ✅ |
Asynchronous Callback
Since the Sora Videos Generation API takes relatively long to generate videos (about 1-2 minutes), if the API does not respond for a long time, the HTTP request will keep the connection open, causing extra system resource consumption. Therefore, this API also supports asynchronous callbacks. The overall process is: when the client initiates a request, it additionally specifies acallback_url field. After the client sends the API request, the API immediately returns a result containing a task_id field representing the current task ID. When the task is completed, the generated video result will be sent to the client’s specified callback_url via POST JSON, including the task_id field, so the task result can be correlated by ID.
Let’s understand the specific operation through an example.
First, the Webhook callback is a service that can receive HTTP requests. Developers should replace it with their own HTTP server URL. For demonstration, a public Webhook sample website https://webhook.site/ is used. Open this site to get a Webhook URL, as shown below:
Copy this URL and use it as the Webhook. The sample here is https://webhook.site/eb238c4f-da3b-47a5-a922-a93aa5405daa.
Next, set the callback_url field to the above Webhook URL and fill in the corresponding parameters, as shown below:

https://webhook.site/eb238c4f-da3b-47a5-a922-a93aa5405daa, as shown below:
Content as follows:
task_id field, and other fields are similar to those above. This field allows task correlation.
Error Handling
When calling the API, if an error occurs, the API will return the corresponding error code and message. For example:400 token_mismatched: Bad request, possibly due to missing or invalid parameters.400 api_not_implemented: Bad request, possibly due to missing or invalid parameters.401 invalid_token: Unauthorized, invalid or missing authorization token.429 too_many_requests: Too many requests; rate limit exceeded.500 api_error: Internal server error; something went wrong on the server.

