Audio Music
Endpoints
Audio Music
Prompt-driven music generation. Synchronous, returns audio bytes, billed per second (ElevenLabs) or per song (MiniMax).
POST
Audio Music
Synchronous endpoint across two providers:
With
The
- ElevenLabs Music (
elevenlabs-music) — caller suppliesmusic_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 bymusic-2.6(upgraded frommusic-2.5on 2026-05-17; API contract and pricing unchanged).
Request
application/json body.
One of
elevenlabs-music, minimax-music, minimax-music-pro.Description of the music. Max 2000 characters. Required for
elevenlabs-music. For MiniMax models the prompt drives style/arrangement; lyrics drive vocals.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.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.Audio format. Same options as audio/speech.
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:
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
POST /v1/audio/sfx— pair music beds with sound effectsPOST /v1/audio/speech— narration to layer over the musicGET /v1/audio/voices— voice picker for narration