Skip to main content
The main function of the Sora Tasks API is to query the execution status of tasks by inputting the task ID generated by the Sora Videos Generation API. This document will provide detailed integration instructions for the Sora Tasks API, helping you easily integrate and fully utilize the powerful features of this API. With the Sora Tasks API, you can easily query the execution status of tasks from the Sora Videos Generation API.

Application Process

To use Sora Videos Generation API, first open the Ace Data Cloud Console and copy your API Token. If you are not logged in, you will be redirected to sign in and brought back to this page automatically. A single API Token works across every service on the platform — no need to subscribe per service. New accounts receive free starter credit; when it runs low you can top up your shared balance in the console.
📘 Full documentation: Sora Videos Generation API →

Request Example

The Sora Tasks API can be used to query the results of the Sora Videos Generation API. For information on how to use the Sora Videos Generation API, please refer to the document Sora Videos Generation API. We will take one task ID returned by the Sora Videos Generation API as an example to demonstrate how to use this API. Suppose we have a task ID: b8976e18-32dc-4718-9ed8-1ea090fcb6ea, and we will demonstrate how to pass in a task ID.

Task Example Image

Setting Request Headers and Request Body

Request Headers include:
  • accept: Specifies that the response should be in JSON format, set to application/json.
  • authorization: The key to call the API, which can be selected directly after application.
Request Body includes:
  • id: The uploaded task ID.
  • action: The operation method for the task.
Set as shown in the image below:

Code Example

You can see that various language codes have been automatically generated on the right side of the page, as shown in the image:

Some code examples are as follows:

CURL

Python

Response Example

Upon successful request, the API will return the details of the video task here. For example:
The returned result contains multiple fields, with the request field being the request body when the task was initiated, and the response field being the response body returned after the task is completed. The field descriptions are as follows.
  • id: The ID of the video task generated, used to uniquely identify this video generation task.
  • request: The request information in the video task.
  • response: The return information in the video task.

Batch Query Operation

This is for querying the details of video tasks for multiple task IDs, and unlike the above, the action needs to be selected as retrieve_batch. Request Body includes:
  • ids: An array of uploaded task IDs.
  • action: The operation method for the task.
Set as shown in the image below:

Code Example

It can be found that various language codes have been automatically generated on the right side of the page, as shown in the figure:

Some code examples are as follows:

Response Example

After a successful request, the API will return the specific details of all batch video tasks. For example:
The returned result has multiple fields, among which items contain the specific details of the batch video tasks, and the specific information of each video task is the same as the fields mentioned above. The field information is as follows.
  • items, all specific details of the batch video tasks. It is an array, and each element of the array has the same format as the return result of querying a single task above.
  • count, the number of video tasks in this batch query.

CURL

Python

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.

Error Response Example

Conclusion

Through this document, you have learned how to use the Sora Tasks API to query detailed information about single or batch video tasks. We hope this document helps you better integrate and use the API. If you have any questions, please feel free to contact our technical support team.