Generate Music
generate_musicUse this to create an AI music track (full songs with vocals, or instrumentals). Three models: music-3.0 (default, 200 credits — songs from a prompt and/or lyrics, lyrics optimizer on by default so a prompt alone works), mureka-v9 (60 credits — sings the user's EXACT lyrics verbatim, or instrumental/BGM), and lyria-3 (100 credits — high-fidelity from a rich prompt, can condition on up to 10 reference images), and sonilo-music (instrumental/background music of an EXACT length via duration, 5–360 s — priced PER SECOND at 4 credits/s with a 10-second minimum, no vocals). VIDEO-TO-MUSIC: pass a video URL (upload_media first for local files) and sonilo-video-music composes a licensed soundtrack for the clip's content, pacing and mood — priced per second of the video's measured length (15 credits/s, 10 s minimum, ≤360 s). Flat price per track (per second for the Sonilo models), charged on success only; the user's plan discounts apply automatically. Submits an async job and returns a numeric job_id — music takes a minute or three: poll check_generation_status with the job_id AND type "music" every 15–30 seconds, then share the finished track's listen/download link with the user (chat can't embed audio players).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Music model id. Omit for the default (music-3.0 — latest MiniMax, all-purpose songs, 200 credits; passing a video auto-selects sonilo-video-music). Alternatives: music-2.6 (previous generation, same price), mureka-v9 (sings exact lyrics, cheapest at 60), lyria-3 (high-fidelity, image conditioning, 100), sonilo-music (instrumental/background music of an exact length, priced per second — pass duration). Call list_models for details. | |
| video | No | Video-to-music: URL of a video (≤360 s, ≤30 MB for public URLs) to compose a licensed soundtrack FOR — the music follows the clip's content, pacing and mood, and matches its length. Must be a URL — upload local files with upload_media first. Uses sonilo-video-music: 15 credits per second of the video's measured duration (10-second minimum). prompt becomes optional direction (genre/mood/instrumentation); no lyrics or duration. | |
| format | No | music-2.6/music-3.0 only: output audio format, wav (default) or mp3. | |
| images | No | lyria-3 only: up to 10 reference images to condition the mood — each a URL, data URI, or raw base64 (upload local files with upload_media). | |
| lyrics | No | Lyrics to sing. mureka-v9 sings them VERBATIM ([verse]/[chorus] tags supported); music-2.6/music-3.0 polish them unless lyrics_optimizer is false; lyria-3 treats them as optional guidance. | |
| prompt | No | Style/mood description of the track. Required for lyria-3 (10–2000 chars) and for instrumental tracks; optional on music-2.6/music-3.0 when lyrics are given. | |
| duration | No | sonilo-music only: track length in seconds (5–360, default 30). Billed per second with a 10-second minimum (4 credits/s → 30 s = 120 credits). Other music models ignore length (sonilo-video-music sizes the music to the video). | |
| instrumental | No | Generate an instrumental track (no vocals). music-2.6/music-3.0 and mureka-v9 (mureka requires a prompt in this mode). | |
| vocal_gender | No | mureka-v9 only: preferred vocal gender for songs (default auto). | |
| lyrics_optimizer | No | music-2.6/music-3.0 only. Write/polish lyrics from the prompt — DEFAULT TRUE (matches web/API). Set false to sing the provided lyrics as-is. |