curl --request POST \
--url https://api.dreamto.ai/api/v1/jobs/createTask \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "ai-music-api/generate-persona",
"input": {
"task_id": "c2a81e5f09d34b7e8f61a2d4c9b03e75",
"audio_id": "f924248f-e765-48fd-9ea9-c64290225e4e",
"name": "Electronic Pop Singer",
"description": "A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones",
"vocal_start": 0,
"vocal_end": 30,
"style": "Electronic Pop"
}
}
'{
"code": 200,
"data": {
"description": "A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones",
"name": "Electronic Pop Singer",
"persona_id": "6096c3d052013da4a31071479000ff16"
},
"msg": "success"
}Generate Persona
Generate Persona: Create task
Synchronous endpoint: model picks the endpoint and the parameters go in input; the result comes back in data of the response, with nothing to poll. 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": "ai-music-api/generate-persona",
"input": {
"task_id": "c2a81e5f09d34b7e8f61a2d4c9b03e75",
"audio_id": "f924248f-e765-48fd-9ea9-c64290225e4e",
"name": "Electronic Pop Singer",
"description": "A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones",
"vocal_start": 0,
"vocal_end": 30,
"style": "Electronic Pop"
}
}
'{
"code": 200,
"data": {
"description": "A modern electronic music style pop singer, skilled in dynamic rhythms and synthesizer tones",
"name": "Electronic Pop Singer",
"persona_id": "6096c3d052013da4a31071479000ff16"
},
"msg": "success"
}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 for a synchronous endpoint; data is the result. 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

