Get task
curl --request GET \
--url https://api.dreamto.ai/api/v1/jobs/recordInfo \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.dreamto.ai/api/v1/jobs/recordInfo"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.dreamto.ai/api/v1/jobs/recordInfo', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.dreamto.ai/api/v1/jobs/recordInfo';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.dreamto.ai/api/v1/jobs/recordInfo"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.dreamto.ai/api/v1/jobs/recordInfo")
.header("Authorization", "Bearer <token>")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dreamto.ai/api/v1/jobs/recordInfo",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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/recordInfo")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://api.dreamto.ai/api/v1/jobs/recordInfo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
import Foundation
let url = URL(string: "https://api.dreamto.ai/api/v1/jobs/recordInfo")!
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.timeoutInterval = 10
request.allHTTPHeaderFields = ["Authorization": "Bearer <token>"]
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.dreamto.ai/api/v1/jobs/recordInfo")
.get()
.addHeader("Authorization", "Bearer <token>")
.build()
val response = client.newCall(request).execute()false{
"code": 200,
"msg": "success",
"data": {
"taskId": "7d3f0a9c41e85b2f6a1c9e04b8d27f53",
"model": "ai-music-api/mashup",
"state": "waiting",
"param": "{\"input\":\"{\\\"upload_url_list\\\":[\\\"https://example.com/audio1.mp3\\\",\\\"https://example.com/audio2.mp3\\\"],\\\"style\\\":\\\"Acoustic folk-pop\\\",\\\"title\\\":\\\"Morning Mashup\\\",\\\"model\\\":\\\"V6\\\"}\",\"model\":\"ai-music-api/mashup\"}",
"resultJson": null,
"failCode": null,
"failMsg": null,
"costTime": null,
"completeTime": null,
"createTime": 1795014897000,
"updateTime": 1795014907000
}
}Generate mashup
Generate mashup: Get task
Returns the state and result of a task by taskId. When data.state is success, read the result from data.response (the same as data.resultJson); when it is fail, data.failCode / data.failMsg give the reason. Poll about every 10 seconds.
GET
/
api
/
v1
/
jobs
/
recordInfo
Get task
curl --request GET \
--url https://api.dreamto.ai/api/v1/jobs/recordInfo \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.dreamto.ai/api/v1/jobs/recordInfo"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.dreamto.ai/api/v1/jobs/recordInfo', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.dreamto.ai/api/v1/jobs/recordInfo';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.dreamto.ai/api/v1/jobs/recordInfo"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.dreamto.ai/api/v1/jobs/recordInfo")
.header("Authorization", "Bearer <token>")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dreamto.ai/api/v1/jobs/recordInfo",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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/recordInfo")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://api.dreamto.ai/api/v1/jobs/recordInfo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
import Foundation
let url = URL(string: "https://api.dreamto.ai/api/v1/jobs/recordInfo")!
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.timeoutInterval = 10
request.allHTTPHeaderFields = ["Authorization": "Bearer <token>"]
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.dreamto.ai/api/v1/jobs/recordInfo")
.get()
.addHeader("Authorization", "Bearer <token>")
.build()
val response = client.newCall(request).execute()false{
"code": 200,
"msg": "success",
"data": {
"taskId": "7d3f0a9c41e85b2f6a1c9e04b8d27f53",
"model": "ai-music-api/mashup",
"state": "waiting",
"param": "{\"input\":\"{\\\"upload_url_list\\\":[\\\"https://example.com/audio1.mp3\\\",\\\"https://example.com/audio2.mp3\\\"],\\\"style\\\":\\\"Acoustic folk-pop\\\",\\\"title\\\":\\\"Morning Mashup\\\",\\\"model\\\":\\\"V6\\\"}\",\"model\":\"ai-music-api/mashup\"}",
"resultJson": null,
"failCode": null,
"failMsg": null,
"costTime": null,
"completeTime": null,
"createTime": 1795014897000,
"updateTime": 1795014907000
}
}Authorizations
Query Parameters
Response
200 - application/json
Always HTTP 200. With code 200, data is the task (whether the task succeeded is data.state); any other code is an error with data null.
Response of recordInfo; always HTTP 200.
Result code:
200: found (whether the task succeeded isdata.state)401: missing or invalid API Key405: wrong HTTP method422:taskIdis missing, unknown, belongs to another account or has expired (msgisrecordInfo is null)429: too many requests500: server error; retry later

