curl --request POST \
--url https://api.deepshi.ai/v1/audio/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "minimax-music-v2",
"prompt": "a warm lofi hip hop beat with mellow piano and vinyl crackle",
"lyrics_prompt": "[Verse]\ncity lights fade slow\nin the quiet night we go\n[Chorus]\nhold on to the glow"
}
'import requests
url = "https://api.deepshi.ai/v1/audio/generations"
payload = {
"model": "minimax-music-v2",
"prompt": "a warm lofi hip hop beat with mellow piano and vinyl crackle",
"lyrics_prompt": "[Verse]
city lights fade slow
in the quiet night we go
[Chorus]
hold on to the glow"
}
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: 'minimax-music-v2',
prompt: 'a warm lofi hip hop beat with mellow piano and vinyl crackle',
lyrics_prompt: '[Verse]\ncity lights fade slow\nin the quiet night we go\n[Chorus]\nhold on to the glow'
})
};
fetch('https://api.deepshi.ai/v1/audio/generations', 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",
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' => 'minimax-music-v2',
'prompt' => 'a warm lofi hip hop beat with mellow piano and vinyl crackle',
'lyrics_prompt' => '[Verse]
city lights fade slow
in the quiet night we go
[Chorus]
hold on to the glow'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.deepshi.ai/v1/audio/generations"
payload := strings.NewReader("{\n \"model\": \"minimax-music-v2\",\n \"prompt\": \"a warm lofi hip hop beat with mellow piano and vinyl crackle\",\n \"lyrics_prompt\": \"[Verse]\\ncity lights fade slow\\nin the quiet night we go\\n[Chorus]\\nhold on to the glow\"\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.deepshi.ai/v1/audio/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"minimax-music-v2\",\n \"prompt\": \"a warm lofi hip hop beat with mellow piano and vinyl crackle\",\n \"lyrics_prompt\": \"[Verse]\\ncity lights fade slow\\nin the quiet night we go\\n[Chorus]\\nhold on to the glow\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deepshi.ai/v1/audio/generations")
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\": \"minimax-music-v2\",\n \"prompt\": \"a warm lofi hip hop beat with mellow piano and vinyl crackle\",\n \"lyrics_prompt\": \"[Verse]\\ncity lights fade slow\\nin the quiet night we go\\n[Chorus]\\nhold on to the glow\"\n}"
response = http.request(request)
puts response.read_body{
"id": "aud_a1b2c3",
"object": "audio",
"model": "minimax-music-v2",
"status": "in_progress"
}{
"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": "Incorrect API key provided.",
"type": "invalid_request_error",
"code": "invalid_api_key",
"param": null
}
}{
"error": {
"message": "You have insufficient credits to complete this request.",
"type": "insufficient_quota",
"code": "insufficient_quota",
"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": "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
}
}Create a music job
Create an asynchronous music generation job from a style prompt. Returns a job with status: "in_progress"; poll GET /v1/audio/generations/{audio_id} until it is completed. Some models take lyrics and generate vocal songs, others are instrumental; call GET /v1/models to see the parameters a model supports. Music is billed once, on completion; pricing is shown on deepshi.ai.
curl --request POST \
--url https://api.deepshi.ai/v1/audio/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "minimax-music-v2",
"prompt": "a warm lofi hip hop beat with mellow piano and vinyl crackle",
"lyrics_prompt": "[Verse]\ncity lights fade slow\nin the quiet night we go\n[Chorus]\nhold on to the glow"
}
'import requests
url = "https://api.deepshi.ai/v1/audio/generations"
payload = {
"model": "minimax-music-v2",
"prompt": "a warm lofi hip hop beat with mellow piano and vinyl crackle",
"lyrics_prompt": "[Verse]
city lights fade slow
in the quiet night we go
[Chorus]
hold on to the glow"
}
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: 'minimax-music-v2',
prompt: 'a warm lofi hip hop beat with mellow piano and vinyl crackle',
lyrics_prompt: '[Verse]\ncity lights fade slow\nin the quiet night we go\n[Chorus]\nhold on to the glow'
})
};
fetch('https://api.deepshi.ai/v1/audio/generations', 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",
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' => 'minimax-music-v2',
'prompt' => 'a warm lofi hip hop beat with mellow piano and vinyl crackle',
'lyrics_prompt' => '[Verse]
city lights fade slow
in the quiet night we go
[Chorus]
hold on to the glow'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.deepshi.ai/v1/audio/generations"
payload := strings.NewReader("{\n \"model\": \"minimax-music-v2\",\n \"prompt\": \"a warm lofi hip hop beat with mellow piano and vinyl crackle\",\n \"lyrics_prompt\": \"[Verse]\\ncity lights fade slow\\nin the quiet night we go\\n[Chorus]\\nhold on to the glow\"\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.deepshi.ai/v1/audio/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"minimax-music-v2\",\n \"prompt\": \"a warm lofi hip hop beat with mellow piano and vinyl crackle\",\n \"lyrics_prompt\": \"[Verse]\\ncity lights fade slow\\nin the quiet night we go\\n[Chorus]\\nhold on to the glow\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deepshi.ai/v1/audio/generations")
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\": \"minimax-music-v2\",\n \"prompt\": \"a warm lofi hip hop beat with mellow piano and vinyl crackle\",\n \"lyrics_prompt\": \"[Verse]\\ncity lights fade slow\\nin the quiet night we go\\n[Chorus]\\nhold on to the glow\"\n}"
response = http.request(request)
puts response.read_body{
"id": "aud_a1b2c3",
"object": "audio",
"model": "minimax-music-v2",
"status": "in_progress"
}{
"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": "Incorrect API key provided.",
"type": "invalid_request_error",
"code": "invalid_api_key",
"param": null
}
}{
"error": {
"message": "You have insufficient credits to complete this request.",
"type": "insufficient_quota",
"code": "insufficient_quota",
"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": "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>.
Body
Music generation request. model and prompt are required; lyrics_prompt is required by some models. The remaining fields are optional, model-specific options; call GET /v1/models for the parameters each model accepts. Additional parameters not listed here may also be sent and are forwarded to the model.
The music model id. See GET /v1/models.
"minimax-music-v2"
The music style: genre, mood, instruments, tempo. Up to the model's prompt_max_length.
"a warm lofi hip hop beat with mellow piano and vinyl crackle"
The lyrics to sing, with [Verse] / [Chorus] structure tags on their own lines (separate lines with \n). 10 to 3000 characters. Required by some models.
"[Verse]\ncity lights fade slow\nin the quiet night we go\n[Chorus]\nhold on to the glow"
Generate a vocal-free track, where supported.
Output length in milliseconds, where the model supports duration control.
Output length in seconds, where the model supports duration control.
Output length in seconds, where the model supports duration control.
Output sample rate in Hz; one of the model's allowed values, where supported.
44100
Output bitrate in bits per second; one of the model's allowed values, where supported.
256000
Output container, where supported.
"mp3"
Response
The created 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?