tts.v1
docs/capabilities/tts.v1.md · wiki index
tts.v1
Status: v1. A published shape is frozen by spec.md section 20.1.
Capability key: tts
Route: POST /tts
Parts in
One row for each part kind that this capability accepts. A kind that is not in
this table is invalid_part.
| kind | role | required | meaning |
|---|---|---|---|
| text | any | yes, one or more | the text to speak. The role is not significant. |
Parameters
The plugin validates these. A parameter that is not in this table is ignored,
not an error (spec.md R26). A default of catalogue means the model entry in
the catalogue gives the value.
| name | type | default | meaning |
|---|---|---|---|
voice | string | catalogue | the voice to speak with |
speed | float | 1.0 | the speaking rate multiplier |
format | string | catalogue | the sample format to emit |
Channels out
One row for each channel that this capability can emit.
| channel | mime | payload |
|---|---|---|
| pcm | audio/pcm; enc=s16le; rate=24000; channels=1 | one run of audio bytes. The mime states the sample format, the rate, and the channel count. |
| progress | application/json | {stage, pct} while the plugin synthesises |
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 |
These keys are present when outcome is completed. They are absent when the
outcome is cancelled or expired.
Request
POST /tts
{
"model": "<served-name>",
"input": [
{"kind": "text", "text": "A ledger records reserved bytes."},
{"kind": "text", "text": "Every device has room."}
],
"params": {"voice": "warm", "speed": 1.0, "format": "f32le"},
"stream": true
}
Response, no stream
{"job": "019...", "outcome": "completed",
"pcm": {"mime": "audio/pcm; enc=f32le; rate=24000; channels=1", "inline": "<audio bytes>"},
"usage": {"tokens_in": 6, "audio_ms": 1800},
"meta": {"model": "<served-name>", "rate": 24000, "channels": 1, "format": "f32le"}}
Stream
The mime of each pcm event carries the format. The plugin states the format
that it used.
event ch=pcm audio/pcm; enc=f32le; rate=24000; channels=1 <audio bytes>
event ch=pcm audio/pcm; enc=f32le; rate=24000; channels=1 <audio bytes>
done outcome=completed meta={"model":"<served-name>","rate":24000,"channels":1,"format":"f32le"}
Rules
- At least one
textpart is required. A request with notextpart isinvalid_part. - An
image,audio,video, ortokenspart isinvalid_part. - The plugin speaks several
textparts in input order. Audio for partiprecedes audio for parti + 1. - The mime of a
pcmevent names the sample format, the rate, and the channel count. - Every
pcmevent of one job states the same rate and the same channel count. meta.formatequals the format named in the mime of everypcmevent.meta.rateandmeta.channelsequal the values named in that mime.formatselects a sample format that the plugin declares. An undeclared value gives a refusal that namesformat.voiceselects a voice that the plugin declares. An undeclared voice gives a refusal that namesvoice.speed = 1.0means the natural rate of the voice. A larger value is faster.- A
pcmevent carries whole samples only. A sample never spans two events. - No event follows a
cancel. The terminal frame isdonewithoutcome = cancelled. - The plugin emits audio bytes on the
pcmchannel andprogressevents. It emits nothing else for this job. progress.pctnever decreases within one job.