Skip to main content
Glama

Generate Music or Audio with Replicate

replicate_generate_audio

Create 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

TableJSON Schema
NameRequiredDescriptionDefault
modelNoEither a curated key (musicgen, ace-step, riffusion, minimax-music, lyria-3-pro, lyria-3, lyria-2) or a Replicate identifier.musicgen
promptYesDescription of the music/audio. For songs with lyrics (ace-step), include the lyrics here.
downloadNoWhether to download the generated files locally. Default true. When false, only Replicate URLs are returned (URLs expire after ~24h).
timeout_msNoMax ms to wait for the prediction. If exceeded, returns the prediction ID so you can poll via replicate_get_prediction. Default: 300000 (5min).
extra_inputNoAdditional model-specific inputs.
duration_secondsNoDuration in seconds. Model-dependent.
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate non-readOnly (mutating) and non-destructive, but description adds context: download behavior, timeout handling, URL expiry (~24h), and model-specific parameter behavior. No contradictions. Score 4 because while annotations set baseline, description adds significant behavioral detail beyond them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is long but well-structured with headings, bullet points, and examples. Every sentence adds value. Slightly verbose for some details (e.g., model list repeated), but still efficient. Front-loads core purpose and display requirement.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, description explains return format (PredictionResult with local_paths and URLs), covers edge cases (timeout returns prediction ID for polling), and model-specific constraints. Complete for a complex audio generation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, and the description enriches each parameter with model-specific meaning: prompt becomes 'tags' for ace-step, duration_seconds ignored for some models, extra_input includes lyrics example. This adds major value beyond schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it generates music or audio from text prompts, using verbs like 'generate' and specifying resource (music/audio). It distinguishes between models (musicgen, ace-step, etc.) and their capabilities, differentiating it from sibling tools like replicate_generate_speech or replicate_generate_video.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly provides when to use each model (e.g., 'musicgen for instrumental up to 30s', 'ace-step for songs with lyrics'), what parameters to set (e.g., prompt mapping, duration support), and what not to do (e.g., 'do NOT pass duration_seconds for lyria'). Includes display requirement and URL expiry warning.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sena-labs/replicate-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server