All Documentation

Music

Generate loops, beds, stings and full cues from a description, and save them to your library

Overview

The Music page turns a description into a finished piece of music: "tense military sci-fi combat loop, driving percussion, low brass stabs, 120 bpm", "calm exploration ambience, warm pads, sparse piano, no drums", "victory fanfare, bright horns, timpani roll". Tracks can be auditioned, downloaded, and saved to Saved Content, where the Sound agent can trim, fade and loop them.

Length is free on Stable Audio

The Stable Audio models are charged per generation, not per second — a fifteen-second sting and a six-minute cue cost exactly the same. Ask for the length your game actually needs; there is nothing to save by generating short and looping it yourself. Sonilo is the exception: it is priced by the second (see Pricing).

Generating a Track

  1. 1Pick a model. They differ in sound, maximum length and how they are priced (see below).
  2. 2Describe the music. Name the genre, the instruments, the mood and the tempo.
  3. 3Set the length with the slider, or use a preset — 15s sting, 30s loop, 1 min bed, 2 min, 4 min.
  4. 4Optionally open advanced for a negative prompt, a seed, or prompt expansion (Stable Audio only).
  5. 5Generate, then audition it in the player. Generation typically takes a few seconds.
  6. 6Download the file, or Save Music to add it to Saved Content — as a new item or a new version of an existing track.

Models

ModelTypeDescription
music-sa3-mediumup to 6m 20sStable Audio 3 Medium. The better checkpoint and the only one that reaches full-length cues.
music-sa3-smallup to 2mStable Audio 3 Small (Music). Cheaper, music-specialised, enough for loops, beds and stings.
music-soniloup to 10mSonilo v1.1. Royalty-free, trained on licensed music; the longest reach. Priced per second, and a track under 10 s is billed as 10 s. Takes no negative prompt, seed or prompt expansion.

The list is operator-editable, so read it from the page's dropdown or GET /api/v1/music/catalog rather than hard-coding a model id.

Generation options

OptionTypeDescription
durationSeconds*numberLength in seconds, up to the model maximum. Does not affect the price except on a model priced per second.
negativePromptstringQualities to avoid — "vocals", "distortion", "applause". Stable Audio only; with Sonilo, say it in the prompt.
seednumberReuse a returned seed with the same prompt to get the same track back. Change one word and keep the seed to get a variation.
expandPromptbooleanLet the model fill out a terse brief before generating. Useful for one-liners; skip it when your prompt is already specific.

Writing good music prompts

  • •Lead with function and genre: "tense combat loop", "ambient exploration bed", "victory sting".
  • •Name the instruments you want to hear: "low brass, taiko percussion, dark synth pulse".
  • •Give a tempo in bpm when the music has to sit against gameplay pacing.
  • •Say what should be absent — "no drums", "no vocals" — either in the prompt or as a negative prompt.
  • •For a bed that will sit under dialogue, ask for something sparse and mid-scooped rather than dense.

Pricing

The Stable Audio models have a flat credit price per generation; Sonilo charges per second of music, with any track under 10 seconds billed as 10. Either way the price comes from the model you chose and is shown on the page before you generate. It is derived from what the generation costs Tonetta, so the number you are quoted is the number you are charged. Credits are reserved before generation and refunded automatically if it fails, so a failed generation never costs anything.

This is deliberately unlike sound effects, which are priced per second. Stable Audio bills per clip, so pricing it per second would have made long tracks expensive for no extra cost; Sonilo bills by length, so its price follows the length.

Saved tracks are made game-ready

Every track you save is handed to the Sound agent as it lands. It levels the track to -20 LUFS with a -3 dBTP ceiling — the room a music bed needs under everything else — trims only true silence (a quiet intro or a long tail is the music, not padding), cleans the edges and delivers 48 kHz 16-bit stereo WAV. That export becomes the item's next active version; the version you saved stays underneath it. A track named or described as a loop is left untouched at its seams.

Pass gameReady: false on the save (or saveGameReady on the MCP tool) to keep a track exactly as generated. The pass is a Sound turn and is billed like one.

Making it loop

Game music usually has to loop seamlessly, and a generated track ends when it ends. Save the track, open it from Saved Content, and use Post-process with the Sound agent: it can find a loop point, crossfade the seam, trim the tail and match the loudness to the rest of your mix. Each step you keep becomes a new version of the same track, and the original stays.

Generating a longer take and asking the Sound agent to cut a loop out of the middle often works better than asking for a short loop directly — and since length is free, it costs the same.

You can also start with the agent rather than the form: Talk to the Sound agent takes a brief, generates with the same music models (a paid call it proposes with its price unless you asked for the track), compares takes, shapes the one you choose to the scene, and exports it game-ready. By API: POST /api/v1/sound/sessions with a message and contentType: "music", or the start_sound_session MCP tool.

Saving to Your Library

Saved tracks live in Saved Content under the Music filter, with the generation prompt as their description and the decoded duration. Saving supports Save as New and Update Existing; updating appends a version and makes it active.

Previews are temporary

A generated track you do not save is a preview and is not kept indefinitely. Save anything you want to come back to, or download it.

API Access

Music generation requires the music:write scope, and the catalog music:read. The API uploads the result to storage and returns a URL (not base64); pass save to also store it in Saved Content.

GET/api/v1/music/catalogmusic:read

The available models, cheapest first: model, name, default, maxDurationSeconds, credits, pricedPer and features (which of the optional settings the model honours). A model with pricedPer: "second" also reports creditsPerSecond and minBilledSeconds, and costs ceil(max(durationSeconds, minBilledSeconds) × creditsPerSecond); its credits is the price of the shortest billed track.

POST/api/v1/music/generatemusic:write
FieldTypeDescription
prompt*stringGenre, instruments, mood and tempo
durationSeconds*numberLength in seconds (model max applies); does not affect the price unless the model is priced per second
modelstringA model id from the catalog. Omit for the default (the cheapest priced per generation).
negativePromptstringQualities to avoid (models with features.negativePrompt)
seednumberReproduce a previous track (models with features.seed)
expandPromptbooleanExpand a terse brief before generating (models with features.expandPrompt)
saveobjectOptional { name, projectId?, tags? } — also save to Saved Content, or { contentId } — save it as the next active version of that track

Generate and save in one call:

curl -s https://<host>/api/v1/music/generate \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Tense military sci-fi combat loop, driving percussion, low brass stabs, dark synth pulse, 120 bpm",
    "durationSeconds": 90,
    "negativePrompt": "vocals",
    "save": { "name": "Combat Loop A", "tags": ["combat", "loop"] }
  }'

Response:

{
  "success": true,
  "result": {
    "audioUrl": "https://<r2-public>/music/<org>/unassigned/<uuid>.mp3",
    "audioKey": "music/<org>/unassigned/<uuid>.mp3",
    "contentType": "audio/mpeg",
    "filename": "music_<uuid>.mp3",
    "model": "music-sa3-medium",
    "seed": 16425460,
    "request": { "prompt": "Tense military sci-fi...", "durationSeconds": 90 },
    "tokensCharged": 8,
    "savedContent": { "id": "...", "name": "Combat Loop A", "contentType": "music", ... }
  }
}

MCP

The same operations are available to AI agents as the get_music_catalog and generate_music MCP tools — see MCP Server.