curl --request GET \
--url https://api.deepshi.ai/v1/audio/generations/{audio_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.deepshi.ai/v1/audio/generations/{audio_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.deepshi.ai/v1/audio/generations/{audio_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.deepshi.ai/v1/audio/generations/{audio_id}",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.deepshi.ai/v1/audio/generations/{audio_id}"
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.deepshi.ai/v1/audio/generations/{audio_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deepshi.ai/v1/audio/generations/{audio_id}")
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_body{
"id": "aud_a1b2c3",
"object": "audio",
"model": "minimax-music-v2",
"status": "completed",
"seconds": "95",
"created_at": 1783695957,
"completed_at": 1783696052,
"audio": [
{
"type": "url",
"url": "https://media.cdn-deepshi.com/audio/019f4c8f-....mp3",
"content_type": "audio/mpeg"
}
]
}{
"error": {
"message": "Incorrect API key provided.",
"type": "invalid_request_error",
"code": "invalid_api_key",
"param": null
}
}{
"error": {
"message": "The model does not exist or you do not have access to it.",
"type": "invalid_request_error",
"code": "model_not_found",
"param": null
}
}{
"error": {
"message": "Audio not found.",
"type": "invalid_request_error",
"code": "audio_not_found",
"param": "audio_id"
}
}{
"error": {
"message": "Rate limit reached. Please retry after a short delay.",
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"param": null
}
}{
"error": {
"message": "The server had an error while processing your request. Please retry.",
"type": "api_error",
"code": null,
"param": null
}
}Retrieve a music job
Poll a job for its status and result. When status is completed, the finished song is under audio[]. An audio id is scoped to the key that created it.
curl --request GET \
--url https://api.deepshi.ai/v1/audio/generations/{audio_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.deepshi.ai/v1/audio/generations/{audio_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.deepshi.ai/v1/audio/generations/{audio_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.deepshi.ai/v1/audio/generations/{audio_id}",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.deepshi.ai/v1/audio/generations/{audio_id}"
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.deepshi.ai/v1/audio/generations/{audio_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deepshi.ai/v1/audio/generations/{audio_id}")
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_body{
"id": "aud_a1b2c3",
"object": "audio",
"model": "minimax-music-v2",
"status": "completed",
"seconds": "95",
"created_at": 1783695957,
"completed_at": 1783696052,
"audio": [
{
"type": "url",
"url": "https://media.cdn-deepshi.com/audio/019f4c8f-....mp3",
"content_type": "audio/mpeg"
}
]
}{
"error": {
"message": "Incorrect API key provided.",
"type": "invalid_request_error",
"code": "invalid_api_key",
"param": null
}
}{
"error": {
"message": "The model does not exist or you do not have access to it.",
"type": "invalid_request_error",
"code": "model_not_found",
"param": null
}
}{
"error": {
"message": "Audio not found.",
"type": "invalid_request_error",
"code": "audio_not_found",
"param": "audio_id"
}
}{
"error": {
"message": "Rate limit reached. Please retry after a short delay.",
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"param": null
}
}{
"error": {
"message": "The server had an error while processing your request. Please retry.",
"type": "api_error",
"code": null,
"param": null
}
}Authorizations
Your Deepshi API key, sent as Authorization: Bearer <key>.
Path Parameters
The job id returned by POST /v1/audio/generations.
Response
The music job.
A music generation job.
The job id. Pass it to the retrieve and content endpoints.
Object type, always audio.
"audio"
The music model id you requested.
Lifecycle state of the job.
in_progress, completed, failed Length of the generated track in seconds, present when status is completed.
Unix timestamp when the job was created.
Unix timestamp when the job completed.
The generated song, present when status is completed.
Show child attributes
Show child attributes
Present when status is failed. Explains the failure; the job is not charged.
Show child attributes
Show child attributes
Was this page helpful?