- Version 1 (Classic Mode): Supports
duration(10/15/25 seconds),orientation(landscape/portrait),size(small/large resolution), reference imageimage_urls, character ###character_url, and other parameters. - Version 2 (Partner Mode): Supports
seconds(4/8/12 seconds), pixel-level resolutionsize(e.g., 1280x720), reference imageinput_reference, and other parameters.
Application Process
To use the Sora Videos Generation API, first go to the Ace Data Cloud Console to obtain your API Token for future use.
If you are not logged in or registered, you will be automatically redirected to the login page to invite you to register and log in. After completing this, you will be automatically returned to the current page.
One API Token can call all services on the platform without needing to apply separately for each service. The first application will grant a free quota for a trial experience; when the quota is insufficient, you can recharge the general balance in the console.
📘 Complete Documentation: Sora Videos Generation API →
Basic Usage (Version 1)
First, understand the basic usage of Version 1, which involves inputting the promptprompt, an array of reference image links image_urls, and the model model to obtain the processed result. The specific content is as follows:

accept: The format of the response result you want to receive, filled in asapplication/json, which means JSON format.authorization: The key to call the API, which can be selected directly after application.
model: The model for generating the video, supportingsora-2(standard mode) andsora-2-pro(high-definition mode). Thesora-2-prosupports videos with adurationof 25 seconds, whilesora-2only supports 10 and 15 seconds.size: Video resolution,smallfor standard resolution,largefor HD resolution (only Version 1).duration: Video length, supporting 10, 15, and 25 seconds, with 25 seconds only supported bysora-2-pro(only Version 1).orientation: Aspect ratio direction, supportinglandscape(horizontal) andportrait(vertical) (only Version 1).image_urls: An array of reference image links used for image-to-video generation (only Version 1).character_url: Character ### link, real people cannot appear in the video (only Version 1).character_start/character_end: The start and end seconds for the character’s appearance, with a range difference of 1-3 seconds (only Version 1).prompt: Prompt word (required).callback_url: URL for asynchronous callback results.async: Optional, set totruefor the interface to immediately returntask_id, without needing to providecallback_url, and then poll the corresponding task query interface to obtain results.version: API version,"1.0"(default) or"2.0".

success: The status of the video generation task at this time.task_id: The ID of the video generation task at this time.trace_id: The tracking ID of the video generation at this time.data: The result list of the video generation task at this time.id: The video ID of the video generation task at this time.video_url: The video link of the video generation task at this time.state: The status of the video generation task at this time.
data.
Additionally, if you want to generate the corresponding integration code, you can directly copy the generated code, for example, the CURL code is as follows:
Image-to-Video Task (Version 1)
If you want to perform an image-to-video task, the parameterimage_urls must be passed with reference image links, allowing you to specify the following content:
image_urls: An array of reference image links used for this image-to-video task. Note that you cannot pass real images of people with faces, as this may lead to task failure.


Character Generation Video Task (Version 1)
If you want to perform a character generation video task, the parametercharacter_url must first be passed in the video link needed to create the character. Note that there must be no real people appearing in the video, otherwise it will fail. You can specify the following content:
- character_url: The video link needed to create the character. Note that there must be no real people appearing in the video, otherwise it 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 mode supports shorter video durations and pixel-level resolution control.
Version 2.0 Parameter Description
Basic Example
Use Reference Image (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, whensizeis1280x720, the reference image size should be 1280×720.
Comparison of Parameters Between Version 1.0 and Version 2.0
Asynchronous Callback
Due to the relatively long generation time of the Sora Videos Generation API, which takes about 1-2 minutes, if the API does not respond for a long time, the HTTP request will keep the connection open, leading to additional system resource consumption. Therefore, this API also provides support for asynchronous callbacks. The overall process is: when the client initiates a request, an additionalcallback_url field is specified. After the client initiates the API request, the API will immediately return a result containing a task_id field, representing the current task ID. When the task is completed, the result of the generated video will be sent to the client-specified callback_url in the form of a POST JSON, which also includes the task_id field, allowing the task result to be associated by ID.
Let’s understand how to operate specifically through an example.
First, the Webhook callback is a service that can receive HTTP requests, and developers should replace it with the URL of their own HTTP server. For demonstration purposes, we use a public Webhook sample site https://webhook.site/, where you can open the site to get a Webhook URL, as shown in the image:
Copy this URL, and it can be used as a Webhook. The sample here is https://webhook.site/eb238c4f-da3b-47a5-a922-a93aa5405daa.
Next, we can set the callback_url field to the above Webhook URL, while filling in the corresponding parameters, as shown in the image:

https://webhook.site/eb238c4f-da3b-47a5-a922-a93aa5405daa, as shown in the image:
The content is as follows:
task_id field, and other fields are similar to the above text, allowing the task to be associated through this field.
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, you have exceeded the rate limit.500 api_error: Internal server error, something went wrong on the server.

