custom-stt
API compatibility: websocket_v1 or http_v1
Custom STT is an end-user configuration feature. You do not need to write a new Rapida transformer when your provider can be described with the DSL below.
Setup flow
1
Create the Custom STT credential
Open Credentials or Integrations > Models, choose Custom STT, and create a credential with your provider connection details.
2
Select Custom STT in Voice Input
Open your assistant deployment, go to Voice Input, and select Custom STT as the speech-to-text provider.
3
Choose API compatibility
Select WebSocket v1 for streaming providers or HTTP v1 for providers that transcribe one completed speech segment per request.
4
Set audio arguments
Choose the audio encoding and sample rate your provider expects.
5
Write DSL rules
Define query parameters, request rules, and response rules so Rapida knows how to talk to your provider.
6
Test with conversation logs
Run a test call or web session. Check transcripts, latency, errors, and whether interim/final transcripts are emitted correctly.
Credential fields
The runtime also accepts snake case keys:
api_compatibility and base_url.
STT arguments
DSL sections
Custom STT has three DSL sections:
The DSL is intentionally small. It does not run JavaScript, call functions, read environment variables, use regex, concatenate strings, or perform compound conditions.
Query parameters
Uselisten.query_params when your provider expects configuration in the URL.
Supported variables:
- Query params must be a flat JSON object.
- Values must resolve to a primitive: string, number, boolean, or null.
- Existing query params in
baseUrlare preserved unless the rendered DSL uses the same key.
Request rules
Request rules are evaluated for normalized packets produced by Rapida.
Supported outbound frames:
Binary audio stream
Use this when the provider expects raw audio WebSocket frames.JSON audio payload
Use this when the provider expects base64 audio inside JSON.HTTP transcription request
Usehttp_v1 when your provider accepts one JSON POST for a completed speech segment. Rapida buffers speech audio until the STT end packet, evaluates the first matching audio rule, and sends the rendered JSON body to baseUrl.
For
http_v1, the audio request rule must render a json frame. Binary and text request frames are valid for WebSocket STT, but HTTP STT posts a JSON body.Start, audio, and interrupt
Use this pattern when the provider expects a session-start message, binary audio frames, and a flush message on interruption.Response rules
Response rules parse provider WebSocket frames or HTTP response bodies into Rapida transcript packets. The first matching rule is evaluated and later rules are skipped for that response. Supported inbound frames:
Supported emit keys:
JSON partial and final transcripts
Plain text transcript response
Operators
Every operator object must contain only that operator and its required fields.
Unsupported for Custom STT:
$decode- Binary response handling
$frame: "binary"$frame: "json"
Cast behavior
Path behavior
$path uses dot-separated paths.
- Keys containing a literal dot are not addressable.
- Request rules can only read from
configandpacket. - Response rules can use
$pathonly with JSON response frames. - A missing path in
when.pathmeans the rule does not match. - A missing path in
emitorsend.bodyis an error.
Runtime behavior
- The URL is built from
baseUrlandlisten.query_params. - Audio is resampled to
listen.audio.encodingandlisten.audio.sample_ratebefore request rules run. - For
websocket_v1,turn_changeandaudiopackets open the WebSocket connection if needed. - For
http_v1, Rapida buffers audio for a speech segment and sends one HTTP POST when speech ends. interruptrules are sent only by the WebSocket transport when a connection is already active.- If no response rule matches an inbound frame, the frame is ignored.
- If a response emits
error, Rapida emits an STT error packet. - If a response emits non-empty
script, Rapida emits a transcript packet and conversation event.
Current limits
- No regex, contains, starts-with, greater-than, or compound match conditions.
- No string interpolation or concatenation.
- No fallback values inside expressions.
- No dynamic headers or dynamic URL path segments.
- No binary response handling for STT.
- No
$decode.
Troubleshooting
Related
Speech-to-Text
Configure standard STT providers and transcription tuning.
Custom TTS
Configure a custom WebSocket TTS provider.
Listen
See how STT fits into speech input configuration.
Open-source runtime reference
Review the assistant-api implementation reference.