music.v1

docs/capabilities/music.v1.md · wiki index

music.v1

Status: v1. A published shape is frozen by spec.md section 20.1. Capability key: music Route: POST /music

Parts in

kindrolerequiredmeaning
textpromptyes, one or morea description of the music to make.
audioconditioningnoaudio whose style or mood the job follows.

Parameters

The plugin validates these. A parameter that is not in this table is ignored, not an error (R26). A default of catalogue means the model entry in the catalogue gives the value. A default of none means the plugin chooses.

nametypedefaultmeaning
duration_suintcataloguethe length of the audio to make, in seconds
seeduintnonea fixed seed for a repeatable job

Channels out

channelmimepayload
pcmaudio/pcm; enc=<s16le|f32le>; rate=<hz>; channels=<n>one run of audio bytes
progressapplication/json{stage, pct} during generation

Terminal metadata

done.meta is vocabulary-defined. The core stores it and never reads it. done without meta means {}.

keytypemeaning
modelstringthe served name that ran the job
rateuintthe sample rate in hertz, measured by the plugin
channelsuintthe channel count, measured by the plugin
formatstringthe sample format that the plugin used
duration_msuintthe length of the audio that the job made

These keys are present when outcome is completed. They are absent when the outcome is cancelled or expired.

Request

POST /music
{
  "model": "<served-name>",
  "input": [
    {"kind": "text", "role": "prompt", "text": "slow electric piano, low light"},
    {"kind": "audio", "role": "conditioning", "mime": "audio/wav", "inline": "<audio bytes>"}
  ],
  "params": {"duration_s": 30, "seed": 7},
  "stream": true
}

Response, no stream

{"job": "019...", "outcome": "completed",
 "pcm": {"mime": "audio/pcm; enc=f32le; rate=44100; channels=2", "inline": "<audio bytes>"},
 "usage": {"tokens_in": 6, "audio_ms": 30000},
 "meta": {"model": "<served-name>", "rate": 44100, "channels": 2, "format": "f32le",
          "duration_ms": 30000}}

Stream

event  ch=progress {"stage": "denoise", "pct": 0.4}
event  ch=pcm  audio/pcm; enc=f32le; rate=44100; channels=2  <audio bytes>
event  ch=pcm  audio/pcm; enc=f32le; rate=44100; channels=2  <audio bytes>
done   outcome=completed usage={"tokens_in":6,"audio_ms":30000}
       meta={"model":"<served-name>","rate":44100,"channels":2,"format":"f32le","duration_ms":30000}

Rules

  1. At least one text part with role prompt is required. A request with no such part is invalid_part.
  2. A text part with a role other than prompt is invalid_part.
  3. An audio part must carry role conditioning. An audio part with another role is invalid_part.
  4. An image, video, tokens, or json part is invalid_part.
  5. The mime of a pcm event names the sample format, the rate, and the channel count.
  6. enc is s16le or f32le. No other value appears in a pcm mime.
  7. Every pcm event of one job carries the same mime.
  8. meta.format, meta.rate, and meta.channels equal the values named in the pcm mime.
  9. meta.duration_ms is the length of the audio that the job made. duration_s is the target only.
  10. usage.audio_ms equals meta.duration_ms.
  11. usage.tokens_in counts the prompt tokens. It is absent when the plugin cannot count them.
  12. A progress event carries {stage, pct}. pct stays between 0 and 1 and never decreases.
  13. Two jobs with the same seed and the same input make the same audio bytes.
  14. seed is absent from the terminal metadata. The plugin never reports it.
  15. No event follows a cancel. The terminal frame is done with outcome = cancelled.
  16. The plugin emits pcm and progress. It emits no other channel for this job.