generate_music
Generate instrumental background music from a text description. Describe mood, genre, tempo, and instruments to create a custom soundtrack for narration or video.
Instructions
Generate background music / a soundtrack from a text description: instrumental (no vocals) by default — ideal to play under narration. Returns request_id and cost in credits immediately; music takes ~1–3 min, so poll with wait_generation until COMPLETED, then output.audio.url is the mp3. Pass the resulting request_id as audio_request_id in compose_video to score a multi-scene video, or use the mp3 on its own. Describe mood/genre/tempo/instruments in the prompt (English works best).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | No | Advanced model-specific parameters (see get_model input_schema). Merged with the fields above. | |
| model | No | Model slug from list_models (a text-to-music model). Omit to use the default music model. | |
| prompt | Yes | Description of the music: mood, genre, tempo, instruments, e.g. "warm lo-fi hip-hop, mellow Rhodes piano, soft vinyl crackle, 80 bpm". English works best. Keep it within the model limit (typically ≤500 characters). | |
| instrumental | No | true (default) = instrumental, no vocals — best as a soundtrack under narration. false = allow vocals / a full song. | |
| wait_seconds | No | How long to wait inline for completion before returning a request_id (music usually needs polling with wait_generation). | |
| idempotency_key | No | Optional stable key to safely retry without creating (and paying for) a duplicate generation. Reuse the same key when retrying the same request. |