Generate music
generate_musicMake game music with AI from a text prompt, free. One take per call. Waits for it (loops ~15-30s, full tracks can take longer) and returns a url (WAV) and preview_url (MP3) that need no header, with a ready curl command. Links work for 120 days. Two engines, set by model:
"stable" (default): a seamless LOOP for background game music that repeats under a scene. Set looping true. Returns a loop with bpm, bars and seamless:true (and an intro_url when the loop has a lead-in). This is the one that actually loops. Loop the WAV url: the MP3 preview is for listening and has a short gap when repeated.
"lyria": a higher-quality FULL-LENGTH track, not a loop. Returns a track. Looping isn't available on lyria. So: looping, repeating background music -> model "stable", looping true. A one-off full piece or higher audio quality -> model "lyria". Describe the music plainly ("warm fantasy village theme, acoustic guitar and flute"). Whenever you know them, pass game (what game it's for), scene (the moment it plays under, e.g. "tense boss fight") and mood (the feel): they make the result fit the game far better, so prefer sending them to leaving them blank. Optional bpm. Takes are AI-generated (ai_content "ai"); tell the person. Separate weekly budgets per model (15 Stable, 8 Lyria). Search the catalog first when an existing track would do.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bpm | No | Tempo to aim for, in beats per minute. | |
| game | No | What game this is for. Improves the result; also tells Soundza what games people want music for. | |
| mood | No | The feel, e.g. "calm and wistful". | |
| model | No | "stable" (default): a seamless loop. "lyria": a full-length, higher-quality track, no looping. | |
| scene | No | The moment or scene the music plays under, e.g. "tense boss fight". | |
| looping | No | Return a seamless loop. Stable only (looping with model "lyria" is an error). Default false. | |
| description | Yes | The music, in plain words. Up to 200 characters. | |
| duration_seconds | No | Full tracks only (not loops): length in seconds, 10 to 180. |