Gemini Tasks API Integration and Usage
The main function of the Gemini Tasks API is to query the execution status of tasks by inputting the task ID generated by the Gemini Videos Generation API.
This document will provide detailed instructions for integrating the Gemini Tasks API, helping you easily query the execution status of tasks from the Gemini Videos Generation API.
¶ Application Process
To use the Gemini Videos Generation API, first obtain your API Token from the Ace Data Cloud Console for future use.

If you are not logged in or registered, you will be automatically redirected to the login page inviting you to register and log in, and will return to the current page upon completion.
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: Gemini Videos Generation API →
¶ Request Example
The Gemini Tasks API can be used to query the results of the Gemini Videos Generation API.
¶ Setting Request Headers and Request Body
Request Headers include:
accept: Specifies that the response should be in JSON format, set toapplication/json.authorization: The key to call the API, which can be selected directly after application.
Request Body includes:
id: The task ID to query.action: The operation method for the task, set toretrievefor a single query.
¶ CURL Code Example
curl -X POST 'https://api.acedata.cloud/gemini/tasks' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"id": "b8976e18-32dc-4718-9ed8-1ea090fcb6ea",
"action": "retrieve"
}'
¶ Response Example
Upon a successful request, the API will return the details of the task here. The request field contains the request body when the task was initiated, and the response field contains the response body returned after the task is completed, for example:
{
"id": "b8976e18-32dc-4718-9ed8-1ea090fcb6ea",
"request": {
"prompt": "A cinematic shot of a kitten chasing a butterfly in a sunlit garden",
"model": "omni-flash",
"aspect_ratio": "16:9"
},
"type": "videos",
"response": {
"success": true,
"task_id": "b8976e18-32dc-4718-9ed8-1ea090fcb6ea",
"trace_id": "fb751e1e-4705-49ea-9fd4-5024b7865ea2",
"data": [
{
"id": "omni-flash:job_01k777hjrbfrgs2060q5zvf2a5",
"video_url": "https://cdn.acedata.cloud/gemini/example-video.mp4",
"state": "succeeded"
}
]
}
}
Field descriptions are as follows:
id: The ID of the generated task, used to uniquely identify this generation task.request: The request information in the queried task.response: The return information in the queried task.created_at: The task creation time, Unix timestamp (seconds, float).started_at: The time the task started executing, Unix timestamp (seconds, float).finished_at: The time the task was completed, Unix timestamp (seconds, float). This field is not returned if the task is not completed.elapsed: The time taken for task execution, in seconds (float, rounded to 3 decimal places). This field is not returned if the task is not completed.
¶ Batch Query Operation
When querying the details of multiple task IDs, set the action to retrieve_batch, and pass the task ID array through ids:
Request Body includes:
ids: The array of task IDs to query.action: The operation method for the task, set toretrieve_batchfor batch queries.
curl -X POST 'https://api.acedata.cloud/gemini/tasks' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"ids": ["b8976e18-32dc-4718-9ed8-1ea090fcb6ea"],
"action": "retrieve_batch"
}'
