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
| kind | role | required | meaning |
|---|---|---|---|
| text | prompt | yes, one or more | a description of the music to make. |
| audio | conditioning | no | audio 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.
| name | type | default | meaning |
|---|---|---|---|
duration_s | uint | catalogue | the length of the audio to make, in seconds |
seed | uint | none | a fixed seed for a repeatable job |
Channels out
| channel | mime | payload |
|---|---|---|
| pcm | audio/pcm; enc=<s16le|f32le>; rate=<hz>; channels=<n> | one run of audio bytes |
| progress | application/json | {stage, pct} during generation |
Terminal metadata
done.meta is vocabulary-defined. The core stores it and never reads it.
done without meta means {}.
| key | type | meaning |
|---|---|---|
model | string | the served name that ran the job |
rate | uint | the sample rate in hertz, measured by the plugin |
channels | uint | the channel count, measured by the plugin |
format | string | the sample format that the plugin used |
duration_ms | uint | the 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
- At least one
textpart with rolepromptis required. A request with no such part isinvalid_part. - A
textpart with a role other thanpromptisinvalid_part. - An
audiopart must carry roleconditioning. Anaudiopart with another role isinvalid_part. - An
image,video,tokens, orjsonpart isinvalid_part. - The mime of a
pcmevent names the sample format, the rate, and the channel count. enciss16leorf32le. No other value appears in apcmmime.- Every
pcmevent of one job carries the same mime. meta.format,meta.rate, andmeta.channelsequal the values named in thepcmmime.meta.duration_msis the length of the audio that the job made.duration_sis the target only.usage.audio_msequalsmeta.duration_ms.usage.tokens_incounts the prompt tokens. It is absent when the plugin cannot count them.- A
progressevent carries{stage, pct}.pctstays between 0 and 1 and never decreases. - Two jobs with the same
seedand the same input make the same audio bytes. seedis absent from the terminal metadata. The plugin never reports it.- No event follows a
cancel. The terminal frame isdonewithoutcome = cancelled. - The plugin emits
pcmandprogress. It emits no other channel for this job.