stt.v1
docs/capabilities/stt.v1.md · wiki index
stt.v1
Status: v1. A published shape is frozen by spec.md section 20.1.
Capability key: stt
Route: POST /stt
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 |
|---|---|---|---|
| audio | any | yes, one or more | the audio to transcribe. The mime names its format. |
| text | prompt | no | a hint for the transcription. At most one. |
Parameters
The plugin validates these. A parameter that is not in this table is ignored,
not an error (spec.md R26). A default of none means the plugin decides.
| name | type | default | meaning |
|---|---|---|---|
language | string | none | the language to transcribe |
timestamps | bool | false | emit timed segments in the terminal metadata |
Channels out
One row for each channel that this capability can emit.
| channel | mime | payload |
|---|---|---|
| text | text/plain; charset=utf-8 | one UTF-8 fragment of the transcript |
| tokens | application/cbor | the same fragment as token ids: {id, text, t_ms} |
| progress | application/json | {stage, pct} during decode |
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 |
language | string | the language that the plugin transcribed |
duration_ms | uint | the measured length of the audio, in milliseconds |
segments | array | {start_ms, end_ms, text} for each timed segment |
model, language, and duration_ms are present when outcome is
completed. They are absent when the outcome is cancelled or expired.
segments is absent unless timestamps is true.
Request
POST /stt
{
"model": "<served-name>",
"input": [
{"kind": "audio", "mime": "audio/wav", "inline": "<audio bytes>"},
{"kind": "text", "role": "prompt", "text": "talks about device memory"}
],
"params": {"language": "en", "timestamps": true},
"stream": true
}
Response, no stream
{"job": "019...", "outcome": "completed",
"text": "A ledger records reserved bytes for each device.",
"usage": {"audio_ms": 4200, "tokens_out": 9},
"meta": {"model": "<served-name>", "language": "en", "duration_ms": 4200,
"segments": [{"start_ms": 0, "end_ms": 4200,
"text": "A ledger records reserved bytes for each device."}]}}
Stream
event ch=progress {"stage": "decode", "pct": 0.4}
event ch=text "A ledger records"
event ch=text " reserved bytes for each device."
done outcome=completed meta={"model":"<served-name>","language":"en","duration_ms":4200}
Rules
- At least one
audiopart is required. A request with noaudiopart isinvalid_part. - A
textpart must carry roleprompt. Atextpart with another role, or a secondtextpart, isinvalid_part. - An
image,video,tokens, orjsonpart isinvalid_part. - The plugin accepts the audio formats that it declares. An undeclared mime is
invalid_part. - Transcript fragments follow the audio order. Earlier audio produces earlier fragments.
- One
textevent is a whole UTF-8 sequence. A plugin never splits a code point across two events. - A
progressevent carries{stage, pct}.pctnever decreases within one job. timestamps = falsemeansmeta.segmentsis absent.- When
timestampsistrue,meta.segmentsis an array of{start_ms, end_ms, text}. - In every segment,
start_msis not greater thanend_ms. Segments follow the transcript order. - The segment text, joined in order, equals the transcript. Nothing is dropped.
language = noneleaves the choice to the plugin.meta.languagethen names the language that the plugin used.- A
languagevalue that the plugin does not declare gives a refusal that nameslanguage. meta.duration_msis measured by the plugin. The client never sets it.- No event follows a
cancel. The terminal frame isdonewithoutcome = cancelled. - A
tokensevent repeats the same fragment that atextevent carries. The tokens, joined in order, equal the joinedtextevents. A plugin that cannot give tokens omits the channel.