(language, vertical, optimizeFor) and fails over automatically.
Signature
Parameters
audio: Uint8Array
Raw audio bytes. Default MIME is audio/wav; set options.contentType if you send something else. Providers handle resampling and format conversion downstream — you don’t have to match a specific sample rate.
options: TranscribeOptions
Extends RoutingIntent:
| Field | Type | Description |
|---|---|---|
language | string (BCP-47) | e.g. "en", "es-MX", "ja-JP". |
vertical | 'general' | 'healthcare' | 'finance' | 'legal' | Vertical label used by the router. |
optimizeFor | 'balanced' | 'accuracy' | 'latency' | 'cost'? | Bias the weighted score. Defaults to the server-side default (currently balanced). |
contentType | string? | MIME type for the body. Defaults to audio/wav. |
constraints | PipelineConstraints? | Allow-list constraints (see Types). |
abortSignal?: AbortSignal
Cancel an in-flight request. Composed with the client-level timeout.
Returns
TranscribeResult
| Field | Type | Description |
|---|---|---|
text | string | Transcribed text. |
provider | string | Upstream provider that ran the request (e.g. deepgram, openai). |
model | string | Provider-specific model identifier. |
confidence | number | null | Model-reported confidence when available, else null. |
failoverCount | number | How many providers were tried before this one succeeded. |
scoresRunId | string | null | ID of the scoring run that selected this provider — useful for joining to benchmark data. |
Wire format
The SDK sends the audio as the raw HTTP body with:Content-Type: fromoptions.contentType(defaultaudio/wav).X-Speko-Intent: JSON-serialized{ language, vertical, optimizeFor? }.X-Speko-Constraints: JSON-serializedoptions.constraints(only if set).
TranscribeResult.