curl --request POST \
--url https://api.dreamto.ai/api/v1/jobs/createTask \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "magi-2/reference-to-video",
"input": {
"prompt": "Use the woman in the reference image as the lead. She stands on a rooftop after the rain, turns to the camera and says: \"We finally made it.\" Her voice follows the reference audio",
"reference_image_urls": [
"https://cdn.example.com/lead.jpg"
],
"reference_audio_urls": [
"https://cdn.example.com/voice.wav"
],
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "1080p",
"generate_audio": true
}
}
'{
"code": 200,
"msg": "success",
"data": {
"taskId": "4b9e2d7a0c1f48e6a3d5b7c9e1f20a84"
}
}MAGI-2 Reference to Video
Create task
Creates a MAGI-2 video generation task: model picks the model, the generation parameters go in input, and the optional callBackUrl receives a completion callback. On success data.taskId is returned and the task runs asynchronously; poll the query endpoint for the result. Every response has HTTP status 200; check code.
POST
/
api
/
v1
/
jobs
/
createTask
curl --request POST \
--url https://api.dreamto.ai/api/v1/jobs/createTask \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "magi-2/reference-to-video",
"input": {
"prompt": "Use the woman in the reference image as the lead. She stands on a rooftop after the rain, turns to the camera and says: \"We finally made it.\" Her voice follows the reference audio",
"reference_image_urls": [
"https://cdn.example.com/lead.jpg"
],
"reference_audio_urls": [
"https://cdn.example.com/voice.wav"
],
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "1080p",
"generate_audio": true
}
}
'{
"code": 200,
"msg": "success",
"data": {
"taskId": "4b9e2d7a0c1f48e6a3d5b7c9e1f20a84"
}
}Authorizations
Body
application/json
Request body of createTask.
Response
200 - application/json
Always HTTP 200. With code 200 the task was created and data.taskId is its ID; any other code is an error with the reason in msg and data null.
Response of createTask; always HTTP 200.
Result code:
200: success401: missing or invalid API Key402: insufficient balance404: the model does not exist or is not enabled405: wrong HTTP method422: invalid request, with the reason inmsg; no task is created or charged429: too many requests; retry later455: service under maintenance500: server error; retry later501: generation failed505: feature disabled

