Generate Music or Audio with Replicate
replicate_generate_audioCreate instrumental music, full songs with lyrics, or ambient audio from a text description using various generation models.
Instructions
Generate music, ambient audio, or full songs from a text prompt.
DISPLAY REQUIREMENT — after this tool returns successfully, include the URL(s) printed in the tool's text content as a markdown link [Audio](URL) in your reply so the user can play it. URLs expire in ~24h.
Models:
"musicgen" (default): Meta MusicGen. Instrumental music up to 30s. prompt → "prompt" field.
"ace-step": Full songs with lyrics. prompt → "tags" field (style/genre tags). Pass lyrics separately via extra_input.lyrics. ~3-4 minutes runtime.
"riffusion": Loop-friendly ambient/electronic. prompt → "prompt_a" field. No duration control.
"minimax-music": MiniMax Music 2.6. Full songs up to 6min. prompt=style description; pass lyrics via extra_input.lyrics.
"lyria-3-pro": Google Lyria 3 Pro. Full songs up to 3min WITH sung vocals. Put genre, mood, lyrics, and structure ([Verse]/[Chorus]) directly in the prompt. No duration — do NOT pass duration_seconds. Also "lyria-3" (30s clips) and "lyria-2" (48kHz instrumental).
Args:
prompt (string): Description of the music. For ace-step this maps to the "tags" field (style tags like "rock, guitar, upbeat"). For riffusion this maps to "prompt_a". For lyria put genre/mood/lyrics/structure here.
model (string, default "musicgen"): Curated key (musicgen, ace-step, riffusion, minimax-music, lyria-3-pro, lyria-3, lyria-2) or "owner/name[:version]".
duration_seconds (1-300, optional): Duration in seconds. Supported by musicgen and ace-step. Ignored for riffusion and the lyria models (they have no duration parameter).
extra_input (object, optional): Additional inputs. Examples: {temperature: 1.0, top_k: 250} for MusicGen; {lyrics: "verse lyrics here"} for ace-step.
download (boolean, default true): Download as MP3/WAV.
timeout_ms: Default 300000 (5min).
Returns: PredictionResult. local_paths contain audio files.
Examples:
prompt="upbeat synthwave with driving bassline", duration_seconds=15 → musicgen
prompt="indie folk, acoustic guitar, female vocals", model="ace-step", extra_input={lyrics: "Leaving home on a rainy day..."}
prompt="ambient lo-fi chill", model="riffusion"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Either a curated key (musicgen, ace-step, riffusion, minimax-music, lyria-3-pro, lyria-3, lyria-2) or a Replicate identifier. | musicgen |
| prompt | Yes | Description of the music/audio. For songs with lyrics (ace-step), include the lyrics here. | |
| download | No | Whether to download the generated files locally. Default true. When false, only Replicate URLs are returned (URLs expire after ~24h). | |
| timeout_ms | No | Max ms to wait for the prediction. If exceeded, returns the prediction ID so you can poll via replicate_get_prediction. Default: 300000 (5min). | |
| extra_input | No | Additional model-specific inputs. | |
| duration_seconds | No | Duration in seconds. Model-dependent. |