Create task
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/cover-generate",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"task_id": "c2a81e5f09d34b7e8f61a2d4c9b03e75"
}
}
'import requests
url = "https://api.dreamto.ai/api/v1/jobs/createTask"
payload = {
"model": "ai-music-api/cover-generate",
"callBackUrl": "https://your-domain.com/api/callback",
"input": { "task_id": "c2a81e5f09d34b7e8f61a2d4c9b03e75" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'ai-music-api/cover-generate',
callBackUrl: 'https://your-domain.com/api/callback',
input: {task_id: 'c2a81e5f09d34b7e8f61a2d4c9b03e75'}
})
};
fetch('https://api.dreamto.ai/api/v1/jobs/createTask', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.dreamto.ai/api/v1/jobs/createTask';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'ai-music-api/cover-generate',
callBackUrl: 'https://your-domain.com/api/callback',
input: {task_id: 'c2a81e5f09d34b7e8f61a2d4c9b03e75'}
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dreamto.ai/api/v1/jobs/createTask"
payload := strings.NewReader("{\n \"model\": \"ai-music-api/cover-generate\",\n \"callBackUrl\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"task_id\": \"c2a81e5f09d34b7e8f61a2d4c9b03e75\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.dreamto.ai/api/v1/jobs/createTask")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"ai-music-api/cover-generate\",\n \"callBackUrl\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"task_id\": \"c2a81e5f09d34b7e8f61a2d4c9b03e75\"\n }\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dreamto.ai/api/v1/jobs/createTask",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'ai-music-api/cover-generate',
'callBackUrl' => 'https://your-domain.com/api/callback',
'input' => [
'task_id' => 'c2a81e5f09d34b7e8f61a2d4c9b03e75'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.dreamto.ai/api/v1/jobs/createTask")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"ai-music-api/cover-generate\",\n \"callBackUrl\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"task_id\": \"c2a81e5f09d34b7e8f61a2d4c9b03e75\"\n }\n}"
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://api.dreamto.ai/api/v1/jobs/createTask");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"model\": \"ai-music-api/cover-generate\",\n \"callBackUrl\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"task_id\": \"c2a81e5f09d34b7e8f61a2d4c9b03e75\"\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
import Foundation
let parameters = [
"model": "ai-music-api/cover-generate",
"callBackUrl": "https://your-domain.com/api/callback",
"input": ["task_id": "c2a81e5f09d34b7e8f61a2d4c9b03e75"]
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.dreamto.ai/api/v1/jobs/createTask")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"model\": \"ai-music-api/cover-generate\",\n \"callBackUrl\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"task_id\": \"c2a81e5f09d34b7e8f61a2d4c9b03e75\"\n }\n}")
val request = Request.Builder()
.url("https://api.dreamto.ai/api/v1/jobs/createTask")
.post(body)
.addHeader("Authorization", "Bearer <token>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()false{
"code": 200,
"msg": "success",
"data": {
"taskId": "7d3f0a9c41e85b2f6a1c9e04b8d27f53"
}
}Generate music cover
Generate music cover: Create task
Creates a Suno task: model picks the endpoint, the 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
Create task
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/cover-generate",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"task_id": "c2a81e5f09d34b7e8f61a2d4c9b03e75"
}
}
'import requests
url = "https://api.dreamto.ai/api/v1/jobs/createTask"
payload = {
"model": "ai-music-api/cover-generate",
"callBackUrl": "https://your-domain.com/api/callback",
"input": { "task_id": "c2a81e5f09d34b7e8f61a2d4c9b03e75" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'ai-music-api/cover-generate',
callBackUrl: 'https://your-domain.com/api/callback',
input: {task_id: 'c2a81e5f09d34b7e8f61a2d4c9b03e75'}
})
};
fetch('https://api.dreamto.ai/api/v1/jobs/createTask', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.dreamto.ai/api/v1/jobs/createTask';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'ai-music-api/cover-generate',
callBackUrl: 'https://your-domain.com/api/callback',
input: {task_id: 'c2a81e5f09d34b7e8f61a2d4c9b03e75'}
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dreamto.ai/api/v1/jobs/createTask"
payload := strings.NewReader("{\n \"model\": \"ai-music-api/cover-generate\",\n \"callBackUrl\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"task_id\": \"c2a81e5f09d34b7e8f61a2d4c9b03e75\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.dreamto.ai/api/v1/jobs/createTask")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"ai-music-api/cover-generate\",\n \"callBackUrl\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"task_id\": \"c2a81e5f09d34b7e8f61a2d4c9b03e75\"\n }\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dreamto.ai/api/v1/jobs/createTask",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'ai-music-api/cover-generate',
'callBackUrl' => 'https://your-domain.com/api/callback',
'input' => [
'task_id' => 'c2a81e5f09d34b7e8f61a2d4c9b03e75'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.dreamto.ai/api/v1/jobs/createTask")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"ai-music-api/cover-generate\",\n \"callBackUrl\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"task_id\": \"c2a81e5f09d34b7e8f61a2d4c9b03e75\"\n }\n}"
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://api.dreamto.ai/api/v1/jobs/createTask");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"model\": \"ai-music-api/cover-generate\",\n \"callBackUrl\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"task_id\": \"c2a81e5f09d34b7e8f61a2d4c9b03e75\"\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
import Foundation
let parameters = [
"model": "ai-music-api/cover-generate",
"callBackUrl": "https://your-domain.com/api/callback",
"input": ["task_id": "c2a81e5f09d34b7e8f61a2d4c9b03e75"]
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.dreamto.ai/api/v1/jobs/createTask")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"model\": \"ai-music-api/cover-generate\",\n \"callBackUrl\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"task_id\": \"c2a81e5f09d34b7e8f61a2d4c9b03e75\"\n }\n}")
val request = Request.Builder()
.url("https://api.dreamto.ai/api/v1/jobs/createTask")
.post(body)
.addHeader("Authorization", "Bearer <token>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()false{
"code": 200,
"msg": "success",
"data": {
"taskId": "7d3f0a9c41e85b2f6a1c9e04b8d27f53"
}
}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

