curl --request POST \
--url https://api.recoupable.dev/api/music \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"prompt": "Genre: acoustic pop. BPM: 96. Key: C major. Warm and intimate, building gently into the chorus.",
"lyrics": "[verse]\nMorning light filtering through the pine\n[chorus]\nSoftly the world begins to breathe",
"duration": 60,
"seed": 123,
"num_inference_steps": 30,
"guidance_scale": 1.7,
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.recoupable.dev/api/music"
payload = {
"prompt": "Genre: acoustic pop. BPM: 96. Key: C major. Warm and intimate, building gently into the chorus.",
"lyrics": "[verse]
Morning light filtering through the pine
[chorus]
Softly the world begins to breathe",
"duration": 60,
"seed": 123,
"num_inference_steps": 30,
"guidance_scale": 1.7,
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'Genre: acoustic pop. BPM: 96. Key: C major. Warm and intimate, building gently into the chorus.',
lyrics: '[verse]\nMorning light filtering through the pine\n[chorus]\nSoftly the world begins to breathe',
duration: 60,
seed: 123,
num_inference_steps: 30,
guidance_scale: 1.7,
account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.recoupable.dev/api/music', 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.recoupable.dev/api/music",
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([
'prompt' => 'Genre: acoustic pop. BPM: 96. Key: C major. Warm and intimate, building gently into the chorus.',
'lyrics' => '[verse]
Morning light filtering through the pine
[chorus]
Softly the world begins to breathe',
'duration' => 60,
'seed' => 123,
'num_inference_steps' => 30,
'guidance_scale' => 1.7,
'account_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.recoupable.dev/api/music"
payload := strings.NewReader("{\n \"prompt\": \"Genre: acoustic pop. BPM: 96. Key: C major. Warm and intimate, building gently into the chorus.\",\n \"lyrics\": \"[verse]\\nMorning light filtering through the pine\\n[chorus]\\nSoftly the world begins to breathe\",\n \"duration\": 60,\n \"seed\": 123,\n \"num_inference_steps\": 30,\n \"guidance_scale\": 1.7,\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.recoupable.dev/api/music")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"Genre: acoustic pop. BPM: 96. Key: C major. Warm and intimate, building gently into the chorus.\",\n \"lyrics\": \"[verse]\\nMorning light filtering through the pine\\n[chorus]\\nSoftly the world begins to breathe\",\n \"duration\": 60,\n \"seed\": 123,\n \"num_inference_steps\": 30,\n \"guidance_scale\": 1.7,\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.dev/api/music")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"Genre: acoustic pop. BPM: 96. Key: C major. Warm and intimate, building gently into the chorus.\",\n \"lyrics\": \"[verse]\\nMorning light filtering through the pine\\n[chorus]\\nSoftly the world begins to breathe\",\n \"duration\": 60,\n \"seed\": 123,\n \"num_inference_steps\": 30,\n \"guidance_scale\": 1.7,\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"generation": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"prompt": "<string>",
"lyrics": "<string>",
"model": "minimax/music-3",
"duration_seconds": 123,
"audio_url": "<string>",
"error_message": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"status": "error",
"error": "<string>",
"missing_fields": [
"<string>"
]
}{
"status": "error",
"error": "<string>",
"missing_fields": [
"<string>"
]
}{
"status": "error",
"error": "<string>",
"missing_fields": [
"<string>"
]
}{
"status": "error",
"error": "<string>",
"missing_fields": [
"<string>"
]
}{
"status": "error",
"error": "<string>",
"missing_fields": [
"<string>"
]
}Generate Music
Start a song generation with MiniMax Music 3. Generation runs in the background and takes roughly one to two minutes, so this returns 202 immediately with a pending generation. Poll Get Music Generation until status is completed or failed; audio_url is populated on completion. Credits are checked before the model is called and deducted only when a generation completes, so a failed generation is never charged.
curl --request POST \
--url https://api.recoupable.dev/api/music \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"prompt": "Genre: acoustic pop. BPM: 96. Key: C major. Warm and intimate, building gently into the chorus.",
"lyrics": "[verse]\nMorning light filtering through the pine\n[chorus]\nSoftly the world begins to breathe",
"duration": 60,
"seed": 123,
"num_inference_steps": 30,
"guidance_scale": 1.7,
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.recoupable.dev/api/music"
payload = {
"prompt": "Genre: acoustic pop. BPM: 96. Key: C major. Warm and intimate, building gently into the chorus.",
"lyrics": "[verse]
Morning light filtering through the pine
[chorus]
Softly the world begins to breathe",
"duration": 60,
"seed": 123,
"num_inference_steps": 30,
"guidance_scale": 1.7,
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'Genre: acoustic pop. BPM: 96. Key: C major. Warm and intimate, building gently into the chorus.',
lyrics: '[verse]\nMorning light filtering through the pine\n[chorus]\nSoftly the world begins to breathe',
duration: 60,
seed: 123,
num_inference_steps: 30,
guidance_scale: 1.7,
account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.recoupable.dev/api/music', 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.recoupable.dev/api/music",
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([
'prompt' => 'Genre: acoustic pop. BPM: 96. Key: C major. Warm and intimate, building gently into the chorus.',
'lyrics' => '[verse]
Morning light filtering through the pine
[chorus]
Softly the world begins to breathe',
'duration' => 60,
'seed' => 123,
'num_inference_steps' => 30,
'guidance_scale' => 1.7,
'account_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.recoupable.dev/api/music"
payload := strings.NewReader("{\n \"prompt\": \"Genre: acoustic pop. BPM: 96. Key: C major. Warm and intimate, building gently into the chorus.\",\n \"lyrics\": \"[verse]\\nMorning light filtering through the pine\\n[chorus]\\nSoftly the world begins to breathe\",\n \"duration\": 60,\n \"seed\": 123,\n \"num_inference_steps\": 30,\n \"guidance_scale\": 1.7,\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.recoupable.dev/api/music")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"Genre: acoustic pop. BPM: 96. Key: C major. Warm and intimate, building gently into the chorus.\",\n \"lyrics\": \"[verse]\\nMorning light filtering through the pine\\n[chorus]\\nSoftly the world begins to breathe\",\n \"duration\": 60,\n \"seed\": 123,\n \"num_inference_steps\": 30,\n \"guidance_scale\": 1.7,\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.dev/api/music")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"Genre: acoustic pop. BPM: 96. Key: C major. Warm and intimate, building gently into the chorus.\",\n \"lyrics\": \"[verse]\\nMorning light filtering through the pine\\n[chorus]\\nSoftly the world begins to breathe\",\n \"duration\": 60,\n \"seed\": 123,\n \"num_inference_steps\": 30,\n \"guidance_scale\": 1.7,\n \"account_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"generation": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"prompt": "<string>",
"lyrics": "<string>",
"model": "minimax/music-3",
"duration_seconds": 123,
"audio_url": "<string>",
"error_message": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"status": "error",
"error": "<string>",
"missing_fields": [
"<string>"
]
}{
"status": "error",
"error": "<string>",
"missing_fields": [
"<string>"
]
}{
"status": "error",
"error": "<string>",
"missing_fields": [
"<string>"
]
}{
"status": "error",
"error": "<string>",
"missing_fields": [
"<string>"
]
}{
"status": "error",
"error": "<string>",
"missing_fields": [
"<string>"
]
}Authorizations
Your Recoup API key. Learn more.
Body
Music description: style, mood, vocals, instrumentation and arrangement.
"Genre: acoustic pop. BPM: 96. Key: C major. Warm and intimate, building gently into the chorus."
The lyrics to sing. Structure tags such as [intro], [verse], [chorus] and [outro] must each be on their own line; text on the same line as a leading tag is dropped by the model.
"[verse]\nMorning light filtering through the pine\n[chorus]\nSoftly the world begins to breathe"
Upper bound on the generated audio length in seconds. The model may stop earlier; the actual length comes back as duration_seconds.
10 <= x <= 300Seed for reproducibility. Omit for a random seed.
Flow-matching steps per denoising chunk. More steps improve quality at the cost of speed.
1 <= x <= 100Classifier-free guidance scale of the flow-matching stage.
0 <= x <= 20Optional. Generate on behalf of another account you can access (self, shared organization, or admin). Defaults to the calling account. Organizations are accounts, so this is also how an organization generation is scoped: send the organization's account id.
Was this page helpful?
