Skip to main content
Custom Speech-to-Text lets you connect Rapida to a transcription service that is not available as a built-in provider. You configure the provider URL, headers, audio settings, and a small JSON DSL that maps Rapida audio packets and provider responses. Use Custom STT when your provider can accept streaming audio over WebSocket or one HTTP transcription request per speech segment, then return transcripts as JSON or text. Provider identifier: 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.
Headers are copied from the credential as static values. The DSL cannot template headers or change the URL path dynamically.

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

Use listen.query_params when your provider expects configuration in the URL. Supported variables:
Rules:
  • Query params must be a flat JSON object.
  • Values must resolve to a primitive: string, number, boolean, or null.
  • Existing query params in baseUrl are 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

Use http_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.
Objects are traversed by key. Arrays are traversed by numeric index.
Limits:
  • Keys containing a literal dot are not addressable.
  • Request rules can only read from config and packet.
  • Response rules can use $path only with JSON response frames.
  • A missing path in when.path means the rule does not match.
  • A missing path in emit or send.body is an error.

Runtime behavior

  • The URL is built from baseUrl and listen.query_params.
  • Audio is resampled to listen.audio.encoding and listen.audio.sample_rate before request rules run.
  • For websocket_v1, turn_change and audio packets open the WebSocket connection if needed.
  • For http_v1, Rapida buffers audio for a speech segment and sends one HTTP POST when speech ends.
  • interrupt rules 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

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.