Dreamina Tasks API Integration and Usage

The Dreamina Tasks API is used to query the execution results of digital human video tasks created by the Dreamina Video Generation API. When you pass callback_url or async: true to the generation API, it immediately returns a task_id. You can use this API to poll the task status and final video URL by task_id or trace_id. This API is free.

Application Process

To use the Dreamina APIs, first go to the Ace Data Cloud Console to obtain your API Token and keep it for later use.

If you have not logged in or registered, you will be automatically redirected to the login page to register and log in. Once completed, you will be automatically returned to the current page.

A general application’s API Key can be used for services enabled for the account; a dedicated application’s Key can be used within that application’s service scope. Please check the Key’s permissions, validity period, and limits, and confirm that the application balance is sufficient to pay for this request. Available trial credits are subject to what is displayed in your account. If the balance is insufficient, click the “Recharge” button.

Request Parameters

Request Headers

  • accept: Specifies that the response should be in JSON format. Set it to application/json.
  • authorization: The key used to call the API, in the format Bearer {token}.
  • content-type: Set it to application/json.

Request Body

Parameter Type Required Description
action string No Operation type: retrieve (default, query a single task) or retrieve_batch (query tasks in batches)
id string No ID of the task to query (the task_id returned when the video was created)
trace_id string No Trace ID of the task to query, which can be used in place of id
ids string[] No List of task IDs for batch queries, used with retrieve_batch

When querying a single task, provide at least one of id and trace_id.

Query a Single Task

CURL

curl -X POST 'https://api.acedata.cloud/dreamina/tasks' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
  "action": "retrieve",
  "id": "362b4fed-67bd-11f1-ad11-00163e57d510"
}'

Python

import requests

url = "https://api.acedata.cloud/dreamina/tasks"

headers = {
    "accept": "application/json",
    "authorization": "Bearer {token}",
    "content-type": "application/json"
}

payload = {
    "action": "retrieve",
    "id": "362b4fed-67bd-11f1-ad11-00163e57d510"
}

response = requests.post(url, json=payload, headers=headers)
print(response.text)

Response Example

After a successful request, the API returns the task details. request is the request body submitted when the task was created, and response is the response body returned after the task is completed, where data.video_url is the URL of the generated digital human video:

{
  "id": "362b4fed-67bd-11f1-ad11-00163e57d510",
  "started_at": 1769262721.823,
  "finished_at": 1769262769.123,
  "elapsed": 47.3,
  "trace_id": "a9063166-26ed-4451-85b5-54e896817c69",
  "request": {
    "model": "omnihuman-1.5",
    "image_url": "https://cdn.acedata.cloud/4hfydw.jpg",
    "audio_url": "https://cdn.acedata.cloud/6f7d62b18b.wav"
  },
  "response": {
    "success": true,
    "data": {
      "task_id": "362b4fed67bd11f1ad1100163e57d510",
      "status": "done",
      "video_url": "https://cdn.acedata.cloud/634d760216.mp4",
      "image_url": "https://cdn.acedata.cloud/4hfydw.jpg",
      "audio_url": "https://cdn.acedata.cloud/6f7d62b18b.wav"
    }
  }
}

Field descriptions:

  • id: The unique ID of this video generation task.
  • trace_id: The trace ID of this request, used for troubleshooting.
  • request: The request content submitted when the task was created.
  • response: The response content returned after the task is completed. When response.data.status is done, response.data.video_url is the final video URL.
  • created_at: The task creation time, as a Unix timestamp (seconds, floating-point).
  • started_at: The time the task started executing, as a Unix timestamp (seconds, floating-point).
  • finished_at: The task completion time, as a Unix timestamp (seconds, floating-point). This field is not returned if the task is incomplete.
  • elapsed: The task execution time in seconds (floating-point, rounded to 3 decimal places). This field is not returned if the task is incomplete.

If the task is not yet complete, status may be a value other than done; if the task does not exist or has not yet produced a result, the API returns an empty object {}. Please try again later.

Query Tasks in Batches

Set action to retrieve_batch and provide an ids array:

curl -X POST 'https://api.acedata.cloud/dreamina/tasks' \
-H 'accept: application/json' \
-H 'authorization: Bearer {token}' \
-H 'content-type: application/json' \
-d '{
  "action": "retrieve_batch",
  "ids": [
    "362b4fed-67bd-11f1-ad11-00163e57d510",
    "0c0b4d3a-2f1e-4a6b-9c2d-2b3c4d5e6f70"
  ]
}'

In the returned result, items is an array of batch task details (each element has the same format as a single query result), and count is the number of tasks returned.

Error Handling

If an error occurs when calling the API, the corresponding error code and message are returned:

  • 400 bad_request: Bad request; required parameters such as id / trace_id may be missing.
  • 401 invalid_token: Unauthorized; the authorization token is invalid or missing.
  • 429 too_many_requests: Too many requests; the rate limit has been exceeded.
  • 500 api_error: Internal server error.

Error Response Example

{
  "error": {
    "code": "bad_request",
    "message": "id or trace_id is required to retrieve a task"
  },
  "trace_id": "2cf86e86-22a4-46e1-ac2f-032c0f2a4e89"
}

Conclusion

Through this document, you have learned how to use the Dreamina Tasks API to query the results of single or batch digital human video tasks. Combined with the generation API’s callback_url / async asynchronous mode, you can implement reliable polling. If you have any questions, please feel free to contact our technical support team.