Audio Music
curl --request POST \
--url https://kymaapi.com/v1/audio/music \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"lyrics": "<string>",
"response_format": "<string>"
}
'import requests
url = "https://kymaapi.com/v1/audio/music"
payload = {
"model": "<string>",
"prompt": "<string>",
"lyrics": "<string>",
"response_format": "<string>"
}
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: '<string>',
prompt: '<string>',
lyrics: '<string>',
response_format: '<string>'
})
};
fetch('https://kymaapi.com/v1/audio/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://kymaapi.com/v1/audio/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([
'model' => '<string>',
'prompt' => '<string>',
'lyrics' => '<string>',
'response_format' => '<string>'
]),
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://kymaapi.com/v1/audio/music"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"lyrics\": \"<string>\",\n \"response_format\": \"<string>\"\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://kymaapi.com/v1/audio/music")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"lyrics\": \"<string>\",\n \"response_format\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://kymaapi.com/v1/audio/music")
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\": \"<string>\",\n \"prompt\": \"<string>\",\n \"lyrics\": \"<string>\",\n \"response_format\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyEndpoints
Audio Music
Generate a full song with vocals from a prompt and your own lyrics. Synchronous, returns MP3 bytes, flat price per song.
POST
/
v1
/
audio
/
music
Audio Music
curl --request POST \
--url https://kymaapi.com/v1/audio/music \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"lyrics": "<string>",
"response_format": "<string>"
}
'import requests
url = "https://kymaapi.com/v1/audio/music"
payload = {
"model": "<string>",
"prompt": "<string>",
"lyrics": "<string>",
"response_format": "<string>"
}
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: '<string>',
prompt: '<string>',
lyrics: '<string>',
response_format: '<string>'
})
};
fetch('https://kymaapi.com/v1/audio/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://kymaapi.com/v1/audio/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([
'model' => '<string>',
'prompt' => '<string>',
'lyrics' => '<string>',
'response_format' => '<string>'
]),
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://kymaapi.com/v1/audio/music"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"lyrics\": \"<string>\",\n \"response_format\": \"<string>\"\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://kymaapi.com/v1/audio/music")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"lyrics\": \"<string>\",\n \"response_format\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://kymaapi.com/v1/audio/music")
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\": \"<string>\",\n \"prompt\": \"<string>\",\n \"lyrics\": \"<string>\",\n \"response_format\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodylyria-3.5, Google’s music model, is the music model served today. Send a style prompt and, optionally, lyrics in any language (Vietnamese is sung in order); you get back one MP3 song with vocals. The request is synchronous: the song comes back in the response body, usually within a few seconds to a minute.
curl -X POST https://kymaapi.com/v1/audio/music \
-H "Authorization: Bearer $KYMA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "lyria-3.5",
"prompt": "A 30-second Vietnamese V-pop ballad, warm female vocal, soft piano, 80 BPM",
"lyrics": "[Chorus]\nMây ơi bay đi, mang theo giấc mơ xanh\nĐêm nay phố vắng, em hát cho riêng anh"
}' \
--output song.mp3
elevenlabs-music has been paused since 2026-09-12, and minimax-music and minimax-music-pro were retired on 2026-10-08 because their upstream no longer serves new accounts. A request naming any of them returns 404 model_not_found.Request
application/json body. Only the fields below are read; anything else in the body is ignored.
string
required
lyria-3.5.string
Style, mood, instruments, tempo, and the length you want (“a 30-second jingle”). Max 2000 characters.
prompt or lyrics is required.string
The words to sing, with optional section tags such as
[Verse] and [Chorus]. Max 3000 characters. Sent after the prompt.string
default:"mp3"
mp3 only. Any other value is refused with 400.Response
200 OK with MP3 bytes. Headers:
| Header | What |
|---|---|
X-Kyma-Model | resolved model id |
X-Kyma-Cost-USD | actual cost charged |
X-Kyma-Balance-USD | remaining balance |
Pricing
| SKU | Price | Pricing mode |
|---|---|---|
lyria-3.5 | $0.108 / song | Flat per song, whatever its length |
Errors
Every error body carrieserror.code, error.type, retryable and doc_url (Errors). Nothing is charged on any of them.
| Status | error.code | When |
|---|---|---|
400 | not_a_music_model | model is not a music SKU |
400 | missing_parameter | neither prompt nor lyrics was sent |
400 | prompt_too_long / invalid_parameter | prompt over 2000 / lyrics over 3000 characters |
400 | invalid_parameter | response_format is not mp3 |
400 | content_refused | the model’s safety filter refused the prompt, for example one naming a specific artist’s voice or quoting copyrighted lyrics |
401 | auth_error | missing or invalid API key |
402 | insufficient_credits / model_requires_paid | balance below one song, or an account still on the free tier |
404 | model_not_found | a paused music SKU |
429 | audio_concurrent_limit | too many songs in flight for your tier (2 at Tier 1, up to 5 at Tier 4); retry after Retry-After |
429 | upstream_rate_limited | the music model is busy; retry after Retry-After |
502 | upstream_invalid_response | the model failed or returned no readable song |
503 | provider_unavailable / model_unavailable | music is unavailable right now; retry shortly |
504 | upstream_timeout | the song did not arrive in time |
See also
POST /v1/audio/speech— narration to layer over the musicPOST /v1/audio/transcriptions— check the sung lyrics