Skip to main content
POST
Audio Music
Synchronous endpoint across two providers:
  • ElevenLabs Music (elevenlabs-music) — caller supplies music_length_ms, billed per second.
  • MiniMax Music 2.0 (minimax-music) — provider derives length from lyrics, flat per-song price.
  • MiniMax Music Pro (minimax-music-pro) — same flat-per-song shape, higher fidelity. Currently backed by music-2.6 (upgraded from music-2.5 on 2026-05-17; API contract and pricing unchanged).

Request

application/json body.
model
string
default:"elevenlabs-music"
One of elevenlabs-music, minimax-music, minimax-music-pro.
prompt
string
Description of the music. Max 2000 characters. Required for elevenlabs-music. For MiniMax models the prompt drives style/arrangement; lyrics drive vocals.
lyrics
string
MiniMax music only. Vocal content with optional structural tags: [verse], [chorus], [bridge], [Instrumental]. Pass [Instrumental] alone for a vocal-less track. ElevenLabs ignores this field.
music_length_ms
integer
default:"30000"
Output duration in milliseconds. Range: 1000 (1 second) to 300000 (5 minutes). ElevenLabs honors this; MiniMax derives length from the lyrics. Also accepts duration_ms as an alias.
response_format
string
default:"mp3_44100_128"
Audio format. Same options as audio/speech.
save_to_blob
string
Optional query param. Set to 1 to have Kyma upload the resulting MP3 to Vercel Blob, write a multimodal_jobs row (so the call appears in your gallery + share pages), and return JSON { job_id, kind: "audio", url, duration_sec, cost_usd, balance_usd } instead of streaming bytes. Used by the Canvas and Muse audio kinds — most direct API callers don’t need this.

Response

Default (streaming)

200 OK with audio bytes. Headers:

With ?save_to_blob=1

200 OK with JSON:
The url is a permanent Vercel Blob URL — safe to embed in apps, store in a DB, share publicly.

Pricing

ElevenLabs is duration-proportional, MiniMax is flat per song. Cost comparison for typical lengths: MiniMax is 19–190× cheaper than ElevenLabs for full-length tracks. Pick ElevenLabs only when you need fine-grained length control on a short bed (under ~1.5 seconds is the only crossover); otherwise the flat MiniMax pricing wins. ElevenLabs’s worst-case rate is locked at the Pro tier overage to stay safe across subscription levels.

Char limits

Per upstream provider — the gateway rejects oversized inputs before forwarding so you don’t burn bandwidth + a hold. Counts are NFC-normalized so Vietnamese / accented Latin / other diacritic-heavy scripts measure by visible characters, not UTF-16 code units. Errors include the SKU name and the field that overflowed:

Errors

See also