Integration and Usage of Grok Tasks API
The main function of the Grok Tasks API is to query the execution status of a task by inputting the task ID generated by the Grok Videos Generation API.
This document provides a detailed guide on integrating the Grok Tasks API to help you easily integrate and query the execution status of tasks from the Grok Videos Generation API.
¶ Application Process
To use Grok 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: Grok Videos Generation API →
¶ Request Example
The Grok Tasks API can be used to query the results of the Grok Videos Generation API.
¶ Setting Request Headers and Body
Request Headers include:
accept: Specifies that the response should be in JSON format, set toapplication/json.authorization: The API key for calling the API, which can be selected from a dropdown after application.
Request Body includes:
id: The task ID to query.action: The operation on the task, set toretrievefor a single query.
¶ CURL Code Example
curl -X POST 'https://api.acedata.cloud/grok/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 detailed information about the task. The request field contains the request body when the task was initiated, and the response field contains the response body 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": "grok-imagine-video-1.5-fast",
"resolution": "480p",
"duration": 8
},
"type": "videos",
"response": {
"success": true,
"task_id": "b8976e18-32dc-4718-9ed8-1ea090fcb6ea",
"trace_id": "fb751e1e-4705-49ea-9fd4-5024b7865ea2",
"data": [
{
"id": "grok-imagine-video-1.5-fast:41eb9a5f-3b2d-4d1e-9f5a-6c2f1a0b9e77",
"video_url": "https://cdn.acedata.cloud/c8cbf53aa0.mp4",
"state": "succeeded"
}
]
}
}
Field descriptions are as follows:
id: The ID of the generated task, uniquely identifying this generation task.request: The request information of the queried task.response: The response information of the queried task.
¶ Batch Query Operation
To query details for multiple task IDs, set action to retrieve_batch and pass the array of task IDs via ids:
Request Body includes:
ids: The array of task IDs to query.action: The operation on the tasks, set toretrieve_batchfor batch query.
curl -X POST 'https://api.acedata.cloud/grok/tasks' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
"ids": ["b8976e18-32dc-4718-9ed8-1ea090fcb6ea"],
"action": "retrieve_batch"
}'
