The Sonnit API is one speech-to-text API in front of many models, from Soniox, ElevenLabs,
xAI, Modulate, Microsoft and NVIDIA: see Tested models. You send audio
and name a model (or let auto choose one), and you get a transcript back. Fallbacks,
provider keys and billing are handled for you.
This guide covers everything needed to integrate: authentication, every endpoint,
errors, limits and real-time streaming. Each operation has examples in curl,
TypeScript, C# and Go. Complete programs that run end to end are in
examples/.
Quickstart
The base URL is https://api.sonnit.ai; you need an API key (sk_live_...) from us.
export SONNIT_API_URL="https://api.sonnit.ai"
export SONNIT_API_KEY="sk_live_..."
# 1. Check your key works and see which models you can use
curl -s "$SONNIT_API_URL/v1/models" -H "X-API-Key: $SONNIT_API_KEY"
# 2. Transcribe a 16 kHz WAV file: what every model takes. Some models also take MP3, M4A
# and more, as a file upload or a link, with no conversion: see "Audio format".
{ printf '{"model":"auto","language":"en","audio":{"encoding":"base64","sampleRate":16000,"data":"'
base64 < sample.wav | tr -d '\n'
printf '"}}'
} | curl -s "$SONNIT_API_URL/v1/transcribe" \
-H "X-API-Key: $SONNIT_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @-
{
"requestId": "req_3b0f6c1e-8d2a-4a8e-9a43-2f1a7c5d9e10",
"model": "elevenlabs/scribe_v2",
"provider": "elevenlabs",
"routedFrom": "auto",
"text": "Hello, this is the voice router.",
"audioDurationMs": 6600,
"transcript": { "segments": [{ "text": "Hello, this is the voice router." }] },
"providerResponse": { "text": "Hello, this is the voice router." }
}
Basics
Base URL and versioning
All endpoints live under /v1 on the base URL, https://api.sonnit.ai, for example
https://api.sonnit.ai/v1/transcribe. Requests and responses are JSON
(Content-Type: application/json), except the streaming endpoint, which is a WebSocket.
New fields may be added to responses within v1, so ignore fields you don't recognize.
Authentication
Send your API key in the X-API-Key header on every request (all endpoints except
/v1/health):
X-API-Key: sk_live_9f3c...
- Keys look like
sk_live_<secret>(production) orsk_test_<secret>. A key works only with the prefix it was issued with. - A key identifies your account (tenant). Your requests, history and usage are visible only to keys for your account. Nothing in a request body or URL can change which account a request runs as.
- Any problem with a key (missing, malformed, unknown, revoked, expired) returns the same
401 unauthorized. The response never says which one it was. - The key is checked before the request body is parsed, so a request without a valid key
gets
401whatever its body holds (even malformed JSON). - Keep keys server-side. Don't ship them in browser or mobile apps. Call the Sonnit API from your backend and pass results to your clients. (Browsers also can't set custom headers on WebSockets, so streaming has to go through your backend anyway.)
Keys are issued by the Sonnit team. Contact us to get a key, rotate one or revoke one.
Audio format
Every batch model takes a 16 kHz PCM WAV, and live streams take raw 16 kHz PCM:
POST /v1/transcribe (batch) | /v1/transcribe/stream (streaming) | |
|---|---|---|
| Container | WAV (RIFF/WAVE) | none: raw PCM in binary WebSocket messages |
| Sample rate | 16,000 Hz in the WAV header | 16,000 Hz |
| Samples | PCM 8/16/24/32-bit integers or 32/64-bit float. 16-bit mono recommended | signed 16-bit little-endian (pcm_s16le), mono |
| Max size | 10 MiB of audio (about 5.5 minutes of 16-bit mono) | up to 1 hour per stream |
Some models take more. A model's input in GET /v1/models says what:
the file formats it reads, whether it takes a link, and the longest recording it takes.
soniox/stt-async-v6 takes the most:
soniox/stt-async-v6 | |
|---|---|
| Formats | aac, aiff, amr, asf, flac, mp3, ogg, wav, webm, m4a, mp4, at any sample rate, mono or stereo. No conversion needed: the file goes to Soniox as it is. |
| Longest recording | 300 minutes (Soniox's limit). In practice shorter for now: see Response times. |
| By link | Yes: Soniox fetches the file from a public https:// link. |
elevenlabs/scribe_v2, x-ai/grok-voice-transcribe-2.0 and modulate/velma-2-stt-batch
take mp3, wav, flac, ogg and m4a files of up to 60 minutes, passed on as they are. They
take no link. So do microsoft/mai-transcribe-2 and nvidia/nemotron-3.5-asr-multilingual
while OpenRouter serves them. The catalog is the source: read each model's input there.
There are three ways to send the audio to POST /v1/transcribe
(details and examples):
| How | For | Size limit |
|---|---|---|
Base64 in the JSON body (audio.data) | Short recordings, any model. | 15 MiB of JSON (about 11 MiB of audio) |
File upload (multipart/form-data) | Files up to 90 MiB. Any model takes a 16 kHz WAV of up to 10 MiB this way; other files need a model whose input lists more. | 90 MiB |
Link (audio.url) | Long or large recordings already stored somewhere public (a presigned S3 link, for example). Only for a model with input.url: true. | The model's own |
A PCM WAV is measured by the Sonnit API. A WAV of up to 10 MiB must hold at least one
sample; a WAVE_FORMAT_EXTENSIBLE WAV (as some recorders write) must declare a PCM or float
sub-format. The model receives exactly the samples the header's data chunk declares, and
that is what you are billed for: bytes after the data chunk are not sent. A file that isn't
such a WAV is 400 invalid_request for a model that only takes 16 kHz WAV; a model that
takes other formats gets it as it is, and you are billed the length its provider measured
(see What's billed).
For a model that only takes 16 kHz WAV, or for streaming, convert with ffmpeg:
# For POST /v1/transcribe: 16 kHz mono 16-bit WAV
ffmpeg -i input.mp3 -ar 16000 -ac 1 -c:a pcm_s16le sample.wav
# For streaming: raw 16 kHz mono 16-bit PCM, no header
ffmpeg -i input.mp3 -ar 16000 -ac 1 -f s16le sample.pcm
Languages
Each model's languages in GET /v1/models lists what it accepts, and
languageRequired says whether language must be sent:
languageRequired: false(the Soniox models):languageis optional and only a hint. Leave it out and the model detects the language itself, including switches mid-sentence. Any language code the provider takes works (fr,de,zh...), not only the ones listed. For several languages, send hints inoptionsinstead.languageRequired: true(every other model, and aliases such asauto): sendlanguage, one of the model'slanguages(aroren).
Request and correlation IDs
- Every successful transcription returns a
requestId(req_...), and every stream reports one in itsstartedanderrormessages. Store it: you can look it up later, and it identifies the request if you contact support. A failedPOST /v1/transcribereturns norequestId, onlyerror.correlationId, which is not a request ID and can't be looked up. Quote it to support instead. - Every HTTP response, including a refused stream handshake, carries an
X-Correlation-Idheader, and every error (HTTP or a stream'serrormessage) includes it aserror.correlationId. To tie Sonnit's logs to your own, send your own ID in anX-Correlation-Idrequest header (1-128 characters fromA-Z a-z 0-9 _ . -). The server echoes it back. If you don't send one, or send an invalid one, the server generates one. An accepted stream's handshake doesn't echo it, so use the stream'srequestIdthere.
Endpoints
List models
GET /v1/models returns every model you can request, which languages each takes, whether
it accepts recordings (batch) or live audio (streaming), and whether it can be used
right now.
{
"default": "soniox/stt-async-v6",
"models": [
{
"id": "soniox/stt-async-v6",
"label": "Soniox Async v6",
"provider": "soniox",
"version": "v6",
"languages": ["ar", "en"],
"modes": ["batch"],
"input": {
"formats": ["aac", "aiff", "amr", "asf", "flac", "mp3", "ogg", "wav", "webm", "m4a", "mp4"],
"url": true,
"maxDurationMinutes": 300
},
"status": "available"
},
{
"id": "soniox/stt-rt-v6",
"label": "Soniox Real-time v6",
"provider": "soniox",
"version": "v6",
"languages": ["ar", "en"],
"modes": ["streaming"],
"status": "available"
},
{
"id": "microsoft/mai-transcribe-2",
"label": "Microsoft MAI-Transcribe-2 (Azure Speech)",
"provider": "microsoft",
"version": "2",
"languages": ["ar", "en"],
"languageRequired": true,
"modes": ["batch"],
"input": { "formats": ["mp3", "wav", "flac", "ogg", "m4a"], "url": false, "maxDurationMinutes": 60 },
"servedVia": "openrouter",
"status": "available"
}
],
"aliases": [
{
"id": "auto",
"byLanguage": {
"ar": ["soniox/stt-async-v6", "elevenlabs/scribe_v2", "soniox/stt-rt-v6", "elevenlabs/scribe_v2_realtime"],
"en": ["elevenlabs/scribe_v2", "soniox/stt-async-v6", "elevenlabs/scribe_v2_realtime", "soniox/stt-rt-v6"]
}
}
]
}
| Field | Meaning |
|---|---|
id | What you pass as model. |
provider | The company whose model it is (sonnit = hosted by us). |
languages | Languages the model accepts. |
modes | batch: send a whole recording to POST /v1/transcribe. streaming: send live audio to /v1/transcribe/stream. |
input | On batch models: the audio it takes. formats: file formats, as extensions. url: whether audio.url (a link) works. Then either sampleRateHz, for a model that only takes PCM WAV at that one rate (16 kHz), or maxDurationMinutes, the longest recording, for a model that takes any rate. See Audio format. |
status | available: ready to use. unconfigured: listed but not enabled on this deployment (requests get 400 model_not_enabled, unbilled). unavailable: temporarily unreachable. |
servedVia | Present while a stand-in (currently openrouter) serves the model instead of its own provider. |
aliases | Names you can pass as model instead of an id. auto tries the listed models for your language in order, skipping ones that aren't enabled or don't take audio the way you're sending it. |
The catalog changes as models are added, so read it at startup (or cache it for a few minutes) rather than hard-coding ids.
Deprecated ids. soniox/stt-async-v5 and soniox/stt-rt-v5 are still accepted:
Soniox replaced its v5 models with v6, removing v5 on 15 December 2026, and these names
now send your request to soniox/stt-async-v6 and soniox/stt-rt-v6. They are listed
under aliases, not models. The response names the v6 model that served the request,
with routedFrom set to the v5 id you sent. Switch to the v6 ids; the v5 names will be
removed later, with notice.
curl
curl -s "$SONNIT_API_URL/v1/models" -H "X-API-Key: $SONNIT_API_KEY"
TypeScript (Node 18+, built-in fetch)
const res = await fetch(`${process.env.SONNIT_API_URL}/v1/models`, {
headers: { "X-API-Key": process.env.SONNIT_API_KEY! },
});
const catalog = (await res.json()) as { models: { id: string; modes: string[]; status: string }[] };
const usable = catalog.models.filter((m) => m.status === "available");
console.log(usable.map((m) => `${m.id} (${m.modes.join(", ")})`));
C# (.NET 8)
using System.Net.Http.Json;
using var http = new HttpClient { BaseAddress = new Uri(Environment.GetEnvironmentVariable("SONNIT_API_URL")!.TrimEnd('/') + "/") };
http.DefaultRequestHeaders.Add("X-API-Key", Environment.GetEnvironmentVariable("SONNIT_API_KEY"));
var catalog = await http.GetFromJsonAsync<ModelCatalog>("v1/models");
foreach (var m in catalog!.Models.Where(m => m.Status == "available"))
Console.WriteLine($"{m.Id} ({string.Join(", ", m.Modes)})");
record ModelCatalog(string Default, List<ModelInfo> Models);
record ModelInfo(string Id, string Label, string Provider, List<string> Languages, List<string> Modes, string Status);
Go
req, _ := http.NewRequest("GET", os.Getenv("SONNIT_API_URL")+"/v1/models", nil)
req.Header.Set("X-API-Key", os.Getenv("SONNIT_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
var catalog struct {
Models []struct {
ID string `json:"id"`
Modes []string `json:"modes"`
Status string `json:"status"`
} `json:"models"`
}
if err := json.NewDecoder(res.Body).Decode(&catalog); err != nil {
log.Fatal(err)
}
for _, m := range catalog.Models {
if m.Status == "available" {
fmt.Printf("%s %v\n", m.ID, m.Modes)
}
}
Transcribe a recording
POST /v1/transcribe transcribes a whole recording and returns the transcript in the
same response. Nothing to poll.
The audio comes in one of three ways: base64 in a JSON body, a file upload, or a link. Which formats and lengths work depends on the model: see Audio format.
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
model | string | yes | A model id with batch in its modes, or an alias such as auto. |
language | string | depends | A language code. Required unless the model has languageRequired: false; see Languages. |
options | object | no | The model's own options, under its provider's name: {"soniox": {...}}. See Model options. |
audio.encoding | string | with data | Always "base64". |
audio.data | string | one of data, url | The audio file, base64-encoded: a 16 kHz WAV for any model, or any format the model's input.formats lists. |
audio.url | string | one of data, url | A link to the audio file instead of the file, for a model with input.url: true. See By link. |
audio.sampleRate | integer | no | Optional. For a PCM WAV it must match the WAV header's rate; for any other audio it is ignored. (It used to be required and always 16000; sending it still works.) |
audio.durationSeconds | number | no | The recording's length, if you know it, for audio that isn't a PCM WAV. It only sets how much is held against your monthly cap while the request runs (see What's billed); you are billed the measured length either way. |
{
"model": "soniox/stt-async-v6",
"language": "ar",
"audio": { "encoding": "base64", "data": "SUQzBAAAAAAAI1RTU0UAAAA..." }
}
As a file upload (multipart/form-data)
For files too large for a JSON body, up to 90 MiB. Send the file in a form field named
file, and the rest as text fields:
| Form field | Required | Description |
|---|---|---|
file | yes | The audio file. Exactly one. Its name is not kept; only a plain extension (.mp3) is passed on. |
model | yes | As in JSON. |
language | depends | As in JSON. |
options | no | The options object as a JSON string: {"soniox":{"enable_speaker_diarization":true}}. |
durationSeconds | no | As audio.durationSeconds. |
sampleRate | no | As audio.sampleRate. |
curl -s "$SONNIT_API_URL/v1/transcribe" \
-H "X-API-Key: $SONNIT_API_KEY" \
--max-time 720 \
-F model=soniox/stt-async-v6 \
-F language=ar \
-F 'options={"soniox":{"enable_speaker_diarization":true}}' \
-F file=@interview.m4a
Let your HTTP client set the Content-Type header (it carries the multipart boundary).
A file over 90 MiB is 400 invalid_request: send a link instead. At most a few uploads
are held at once per server; beyond that the answer is 503 server_busy with
Retry-After (nothing was read or billed), and a link never needs a place.
By link (audio.url)
For a model with input.url: true, send a link and the model's provider fetches the file
itself. Nothing is uploaded through the Sonnit API, so there is no size limit of ours, only
the model's own (Soniox: 300 minutes).
{
"model": "soniox/stt-async-v6",
"audio": { "url": "https://my-bucket.s3.eu-central-1.amazonaws.com/interview.mp3?X-Amz-Signature=...", "durationSeconds": 5400 }
}
- The link must be
https://orhttp://, publicly reachable (the provider fetches it over the internet, from its own servers), point at the audio file itself (not a web page with a player), contain no user name or password, and be at most 4,096 characters. A presigned link (S3, GCS, Azure) works. A private or local address is400. - The Sonnit API passes the link to the provider and does not open it, store it, or return it. Only its host name appears in our logs.
- If the provider can't fetch it, the answer is
400 invalid_request("The audio could not be fetched from the link...") and no recording time is billed. - Send
durationSecondsif you know the length. Without it, the request holds the model's longest recording (300 minutes) against your monthly cap while it runs, and is refused with402if that doesn't fit what is left of the month. With it, only that much is held. Either way you are billed the measured length.
Response 200
{
"requestId": "req_5f1c9c1e-2b7d-4f0e-9a1b-6c3d2e1f0a9b",
"model": "soniox/stt-async-v6",
"provider": "soniox",
"text": "مرحبا، هذا اختبار.",
"audioDurationMs": 1620,
"transcript": {
"segments": [
{
"start": 0.12,
"end": 1.56,
"text": "مرحبا، هذا اختبار.",
"words": [
{ "text": "مرحبا،", "start": 0.12, "end": 0.6 },
{ "text": "هذا", "start": 0.66, "end": 0.9 },
{ "text": "اختبار.", "start": 0.96, "end": 1.56 }
]
}
]
},
"providerResponse": {
"id": "6c1f0a9b-2b7d-4f0e-9a1b-5f1c9c1e3d2e",
"text": "مرحبا، هذا اختبار.",
"tokens": [
{ "text": "مرحبا", "start_ms": 120, "end_ms": 540, "confidence": 0.97 },
{ "text": "،", "start_ms": 540, "end_ms": 600, "confidence": 0.93 },
{ "text": " هذا", "start_ms": 660, "end_ms": 900, "confidence": 0.98 },
{ "text": " اختبار", "start_ms": 960, "end_ms": 1500, "confidence": 0.96 },
{ "text": ".", "start_ms": 1500, "end_ms": 1560, "confidence": 0.91 }
]
}
}
| Field | Description |
|---|---|
requestId | ID of this request. |
model | The model that actually produced the text. |
provider | Who served it (openrouter while OpenRouter stands in for a model's own provider). |
routedFrom | Present only when model differs from what you asked for: an alias picked the model, or the requested model was down and a fallback served the request. |
text | The transcript. The one field every model has in common. |
audioDurationMs | The recording length this request is billed, in milliseconds: a PCM WAV's own length, otherwise what the model's provider measured. |
transcript | The shared transcript: the same shape for every model. segments, each with text and, where the model gives them, speaker, start, end and words. See the shared transcript. |
providerResponse | The model's own response, exactly as its provider sent it: same field names, same values, nothing removed or renamed. What is in it depends on the model, so read it by model (or provider); each model's entry under Models says what it holds. |
providerResponse.text | Always there. For a model whose own response the Sonnit API doesn't return yet, providerResponse is just {"text": ...}. |
The shared transcript
transcript is one shape for every model, so the code that displays a transcript doesn't
change when the model does. Read providerResponse only for what a model has beyond it.
{
"segments": [
{
"speaker": "1",
"start": 0.39,
"end": 16.35,
"text": "مرحبا بكم ...",
"words": [
{ "text": "مرحبا", "start": 0.39, "end": 0.63, "language": "ar" },
{ "text": "بكم", "start": 0.7, "end": 1.02, "language": "ar" }
]
}
]
}
| Field | Description |
|---|---|
segments | The transcript in order. A new segment starts when the speaker changes. For a model that gives sentences instead of words, each sentence is a segment. |
segments[].text | The segment's text. Always there. |
segments[].speaker | The provider's own speaker label, as a string ("1", "2"). Only when the model labels speakers. |
segments[].start, end | Where the segment starts and ends in the audio, in seconds. |
segments[].language | The segment's language. Only from a model that gives one per sentence (Modulate). |
segments[].words | The segment's words, each with text and, where the model gives them, start, end (seconds) and language. |
The rules:
- A field the model doesn't give is left out, never guessed. No speakers, times or languages are made up. Check that a field is there before you use it.
textis always there. A model that returns only text, or one whose transcript isn't translated to this shape yet, is one segment holding only its text:{"segments": [{"text": "Hello, this is the voice router."}]}.- Times are seconds, as decimals (
0.39). The model's own response keeps its own units (Soniox: milliseconds). - What is filled in depends on the connection that served the request. See the table below.
- The segments'
text, joined with spaces, is the transcript: the top-leveltext, without the translated text and audio events thattranscriptleaves out. - A stream sends the same shape live, as
transcriptmessages, and whole indone. See Stream live audio.
What each connection fills in. Speakers, word times and languages appear only when the model returns them. For most models that means turning on the provider's own option for it.
| Connection | Models | What transcript has |
|---|---|---|
| Soniox | soniox/stt-async-v6, soniox/stt-rt-v6 | Speakers, word times, each word's language. |
| ElevenLabs | elevenlabs/scribe_v2, elevenlabs/scribe_v2_realtime, elevenlabs/scribe_v3_live | Speakers, word times. |
| xAI | x-ai/grok-voice-transcribe-2.0, x-ai/grok-voice-transcribe-2.0-live | Speakers, word times. |
| Modulate | modulate/velma-2-stt-batch, modulate/velma-2-stt-streaming | Speakers, sentence times, each sentence's language. No words: a segment is one sentence. |
| OpenRouter | microsoft/mai-transcribe-2 | Speakers, word times. |
| OpenRouter | nvidia/nemotron-3.5-asr-multilingual | Text with one start and end time. No speakers (the model refuses the speaker option), no words. |
This table lists the models we have run a real recording through: see Tested models.
For a model served through OpenRouter, providerResponse is OpenRouter's response format,
not the model maker's own. Once that model's own connection is enabled, servedVia
disappears from the catalog and its transcript is text only until its own translator exists.
For soniox/stt-async-v6: speaker is there with enable_speaker_diarization, and each
word's language with enable_language_identification. Soniox's tokens are pieces of
words; words joins them into whole words. Translated text (translation) and audio
events are not in transcript; they stay in providerResponse.
The model's own response. For soniox/stt-async-v6, providerResponse is Soniox's
transcript:
id, text and tokens, each token with its text, start_ms, end_ms and
confidence. The options you turn on add their fields to the tokens:
speaker with enable_speaker_diarization, language with
enable_language_identification, and translation_status and source_language with
translation. The Sonnit API keeps no list of these fields, so a field the provider adds
tomorrow arrives the same day. A long recording's providerResponse is large: about 100
bytes per token, so a few hundred KB for a 5-minute file. transcript holds the same
words again with their times, so it adds to that.
Changed in December 2026. result was renamed providerResponse in December 2026;
transcript is new. The content of providerResponse is what result held, unchanged.
A client that reads result (or result.text) must read providerResponse instead, or
the top-level text: result is no longer sent.
Changed in November 2026. text is now at the top of the response, and
result (now providerResponse) is the model's own response. Its text is still there
for every model. The one thing an existing client may notice:
its language is gone. It only repeated the language you sent, so use the one in
your request; a language the model detected is in its own response (for Soniox, each
token's language with enable_language_identification). A client that rejects
unknown fields in it needs loosening too, since it now holds whatever the
model sends.
Changed in November 2026. Audio no longer has to be a 16 kHz WAV for a
model whose input says it takes more: other formats, a file upload and a link are new.
For an existing client nothing has to change. What it may notice: the response has a new
field, audioDurationMs; audio.sampleRate is optional; and a file that isn't a 16 kHz
WAV, sent to soniox/stt-async-v6 (or to auto when it can pick that model), is now
transcribed and billed where it used to be refused with 400.
Fallbacks. If the requested model is down or times out, the Sonnit API may retry on a configured fallback model (at most 3 models, within 10 minutes in total). It never retries when the request itself was the problem, and a fallback is only tried if it takes the audio the way you sent it: an MP3 or a link is never sent to a model that only takes 16 kHz WAV. You are billed once per request, however many models it tried.
Response times. Most models answer in seconds, but some providers (upload-and-poll
APIs such as Soniox async) can take several minutes on long audio, and
with fallbacks one request can take up to 10 minutes. However, api.sonnit.ai is
served through Cloudflare, which ends any request that hasn't answered within 125
seconds with its own 524 page. That response has no requestId, and the request is
still processed and billed. For audio that may take longer than that, use
a live stream (a WebSocket isn't subject to this limit), or a
faster model. This is what limits long recordings today: a file or link is transcribed
inside this one request, so a recording that takes the model more than about two minutes
to transcribe gets a 524 through api.sonnit.ai even though the model accepts files
of up to 300 minutes, and each attempt at Soniox is given at most 7 minutes. Long
recordings as a job you start and then poll are planned as the next step. Set your HTTP client timeout to 12 minutes for this endpoint anyway, so
that a 504 or 524 arrives before your client gives up. Many clients default to 30-100 seconds, and Node's built-in fetch gives up after 5
minutes without response headers (the TypeScript example below raises that).
Don't retry automatically after a model error. A request that reaches a model is
billed for its recording time even if the model then fails, so retrying a 5xx bills the
recording again. Retry automatically only on 429 (rate limited, never billed). See
Retrying safely.
Errors most specific to this endpoint: 400 invalid_request (bad body, unknown model,
a streaming-only model, a language the model doesn't take; for a model that only takes
16 kHz WAV: wrong sample rate, unreadable WAV, audio over 10 MiB, a link; an upload over
90 MiB; a link that isn't a public http(s) address; audio the provider could not fetch,
could not read, or that is longer than the model takes), 400 model_not_enabled,
402 usage_cap_exceeded, 429 rate_limited (also: more than 10 files or links of yours
being transcribed at once), 502 model_error, 503 model_unavailable, 503 server_busy
(too many file uploads in progress), 504 model_timeout. See Errors.
curl
# Builds the JSON body around the base64 audio and sends it on stdin (@-).
{ printf '{"model":"soniox/stt-async-v6","language":"ar","audio":{"encoding":"base64","sampleRate":16000,"data":"'
base64 < sample.wav | tr -d '\n' # no line breaks; works on Linux and macOS
printf '"}}'
} | curl -s "$SONNIT_API_URL/v1/transcribe" \
-H "X-API-Key: $SONNIT_API_KEY" \
-H "Content-Type: application/json" \
--max-time 720 \
--data-binary @-
Don't put the base64 audio in a -d '...' argument. Linux limits a single argument to
128 KB, so any recording over about 3 seconds fails with "Argument list too long".
A file upload and a link, for a model that takes them (here an M4A and an MP3, unconverted):
# A file upload: no base64, up to 90 MiB.
curl -s "$SONNIT_API_URL/v1/transcribe" \
-H "X-API-Key: $SONNIT_API_KEY" \
--max-time 720 \
-F model=soniox/stt-async-v6 \
-F file=@interview.m4a
# A link the model's provider fetches itself.
curl -s "$SONNIT_API_URL/v1/transcribe" \
-H "X-API-Key: $SONNIT_API_KEY" \
-H "Content-Type: application/json" \
--max-time 720 \
-d '{"model":"soniox/stt-async-v6","audio":{"url":"https://example.com/interview.mp3","durationSeconds":95}}'
The example programs under examples/ do both in each language.
TypeScript (Node 18.17+, with undici's fetch,
whose timeouts can be raised past the 5 minutes of Node's built-in one)
import { readFile } from "node:fs/promises";
import { Agent, fetch } from "undici";
const twelveMinutes = 12 * 60_000;
const wav = await readFile("sample.wav");
const res = await fetch(`${process.env.SONNIT_API_URL}/v1/transcribe`, {
method: "POST",
headers: { "X-API-Key": process.env.SONNIT_API_KEY!, "Content-Type": "application/json" },
body: JSON.stringify({
model: "soniox/stt-async-v6",
language: "ar",
audio: { encoding: "base64", sampleRate: 16000, data: wav.toString("base64") },
}),
dispatcher: new Agent({ headersTimeout: twelveMinutes, bodyTimeout: twelveMinutes }),
});
const body: any = await res.json();
if (!res.ok) throw new Error(`${res.status} ${body.error.code}: ${body.error.message}`);
console.log(body.requestId, body.model, body.text);
// body.transcript is the same shape for every model: segments, with a speaker and times
// (in seconds) where the model gives them.
for (const s of body.transcript.segments) console.log(s.speaker ?? "", s.start ?? "", s.end ?? "", s.text);
// body.providerResponse is the model's own response; for Soniox, its tokens with their timing:
for (const t of body.providerResponse.tokens ?? []) console.log(t.start_ms, t.end_ms, t.text);
C# (.NET 8)
using System.Net.Http.Json;
using var http = new HttpClient
{
BaseAddress = new Uri(Environment.GetEnvironmentVariable("SONNIT_API_URL")!.TrimEnd('/') + "/"),
Timeout = TimeSpan.FromMinutes(12),
};
http.DefaultRequestHeaders.Add("X-API-Key", Environment.GetEnvironmentVariable("SONNIT_API_KEY"));
var wav = await File.ReadAllBytesAsync("sample.wav");
using var res = await http.PostAsJsonAsync("v1/transcribe", new
{
model = "soniox/stt-async-v6",
language = "ar",
audio = new { encoding = "base64", sampleRate = 16000, data = Convert.ToBase64String(wav) },
});
if (!res.IsSuccessStatusCode)
{
var err = await res.Content.ReadFromJsonAsync<ErrorBody>();
throw new Exception($"{(int)res.StatusCode} {err!.Error.Code}: {err.Error.Message}");
}
var t = await res.Content.ReadFromJsonAsync<TranscribeResponse>();
Console.WriteLine($"{t!.RequestId} {t.Model}: {t.Text}");
// t.Transcript is the same shape for every model; a field the model doesn't give is null.
foreach (var s in t.Transcript.Segments)
Console.WriteLine($"{s.Speaker} {s.Start} {s.End} {s.Text}");
// t.ProviderResponse is the model's own response; for Soniox, its tokens with their timing:
if (t.ProviderResponse.TryGetProperty("tokens", out var tokens))
foreach (var token in tokens.EnumerateArray())
if (token.TryGetProperty("start_ms", out var start)) // translated tokens have no timing
Console.WriteLine($"{start.GetInt32()} {token.GetProperty("text").GetString()}");
// ProviderResponse: the model's own response, whatever it holds (using System.Text.Json).
record TranscribeResponse(string RequestId, string Model, string Provider, string? RoutedFrom, string Text,
string? Language, Transcript Transcript, JsonElement ProviderResponse);
record Transcript(Segment[] Segments);
record Segment(string Text, string? Speaker, double? Start, double? End, Word[]? Words);
record Word(string Text, double? Start, double? End, string? Language);
record ErrorBody(ApiError Error);
record ApiError(string Code, string Message, string CorrelationId);
Go
wav, err := os.ReadFile("sample.wav")
if err != nil {
log.Fatal(err)
}
payload, _ := json.Marshal(map[string]any{
"model": "soniox/stt-async-v6",
"language": "ar",
"audio": map[string]any{
"encoding": "base64",
"sampleRate": 16000,
"data": base64.StdEncoding.EncodeToString(wav),
},
})
req, _ := http.NewRequest("POST", os.Getenv("SONNIT_API_URL")+"/v1/transcribe", bytes.NewReader(payload))
req.Header.Set("X-API-Key", os.Getenv("SONNIT_API_KEY"))
req.Header.Set("Content-Type", "application/json")
client := &http.Client{Timeout: 12 * time.Minute}
res, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
var out struct {
RequestID string `json:"requestId"`
Model string `json:"model"`
RoutedFrom string `json:"routedFrom"`
Text string `json:"text"`
// The same shape for every model. A field the model doesn't give stays nil.
Transcript struct {
Segments []struct {
Speaker *string `json:"speaker"`
Start *float64 `json:"start"` // seconds
End *float64 `json:"end"`
Text string `json:"text"`
} `json:"segments"`
} `json:"transcript"`
// The model's own response, whatever it holds; decode the parts you need.
ProviderResponse json.RawMessage `json:"providerResponse"`
Error *struct {
Code string `json:"code"`
Message string `json:"message"`
} `json:"error"`
}
if err := json.NewDecoder(res.Body).Decode(&out); err != nil {
log.Fatal(err)
}
if res.StatusCode != http.StatusOK {
log.Fatalf("%d %s: %s", res.StatusCode, out.Error.Code, out.Error.Message)
}
fmt.Println(out.RequestID, out.Model, out.Text)
// For Soniox, the tokens with their timing:
var own struct {
Tokens []struct {
Text string `json:"text"`
StartMs int `json:"start_ms"`
EndMs int `json:"end_ms"`
} `json:"tokens"`
}
json.Unmarshal(out.ProviderResponse, &own)
for _, t := range own.Tokens {
fmt.Println(t.StartMs, t.EndMs, t.Text)
}
Stream live audio
GET /v1/transcribe/stream (WebSocket) transcribes audio while it is being recorded and
sends the transcript back as it is recognized. Use it for live captions, voice agents and
calls. Only models with streaming in their modes (currently soniox/stt-rt-v6 and
elevenlabs/scribe_v2_realtime, plus three experimental ones),
or auto, can serve a stream.
Opening the stream. Connect to wss://api.sonnit.ai/v1/transcribe/stream
(ws:// when the base URL is http://, e.g. a local gateway), with the X-API-Key header and these query
parameters:
| Parameter | Required | Value |
|---|---|---|
model | yes | A streaming model id, or auto. |
language | depends | A language code; required unless the model has languageRequired: false. See Languages. |
options | no | The model's own options as URL-encoded JSON, e.g. {"soniox":{"enable_endpoint_detection":true}}. See Model options. |
sampleRate | no | 16000 (the only value). |
encoding | no | pcm_s16le (the only value). |
These checks happen before the WebSocket is accepted: authentication, rate limits,
query validation, whether the model is enabled and takes live audio, how many streams
your account has open (at most 5 at a time), and billing caps. If one fails, the
handshake gets an ordinary HTTP error (401, 400, 402, 429...) with the usual
error body, and no WebSocket opens.
Whether the model can actually start is only known once the stream is open. If it can't
(for example, a provider outage), you get an error message (such as
model_unavailable) right after the handshake, before any started, and the socket
closes with 1011. A stream that fails before started is not billed.
Messages you send
- Binary messages of raw PCM audio: signed 16-bit little-endian, mono, 16 kHz.
Send it as it is recorded, in chunks of 100-250 ms (3,200-8,000 bytes). Any size up to
256 KiB per message is accepted. Audio sent before
startedarrives is buffered, not lost. - When the audio is finished, one text message:
{"type": "end"}.
Messages you receive (JSON text messages)
type | Fields | What to do |
|---|---|---|
started | requestId, model, provider, routedFrom? | A model is listening. |
partial | text | Unconfirmed text that may still change. Replaces the previous partial. |
final | text | Confirmed text. Append it to the transcript as is, spaces included. The partial so far is now settled. |
transcript | confirmed, pending: lists of segments | The shared transcript as it grows. Append the confirmed segments: they are final. Replace your previous pending guess with pending: it is the whole current guess. Ignore it if you only want text. See below. |
providerResponse | providerResponse: one of the model's own messages | The model's own message, exactly as its provider sent it. Ignore it if you only want text. Read it for what partial and final leave out: per-token timing, confidence, speaker and language, and markers such as <end>. It arrives just before the partial/final read from that same message. |
stopped | reason: max_duration or usage_cap_exceeded | A limit was reached. Further audio is ignored, but the transcript of what came before still follows. |
done | requestId, model, provider, routedFrom?, text, transcript: {segments}, providerResponse: {text}, audioSeconds, stopped? | The complete transcript: text (also as providerResponse.text), and transcript, the whole shared transcript in the same shape as an upload's. The server then closes the socket with code 1000. |
error | error: {code, message, correlationId, requestId} | The stream failed. The server then closes with 1011 (server or model failure) or 1008 (a client rule was broken). |
A typical session:
→ (binary PCM) (binary PCM) ...
← {"type":"started","requestId":"req_...","model":"soniox/stt-rt-v6","provider":"soniox"}
← {"type":"providerResponse","providerResponse":{"tokens":[
{"text":"Hello,","start_ms":180,"end_ms":480,"confidence":0.95,"is_final":false},
{"text":" this","start_ms":540,"end_ms":720,"confidence":0.81,"is_final":false}],
"final_audio_proc_ms":0,"total_audio_proc_ms":780}}
← {"type":"transcript","confirmed":[],"pending":[
{"start":0.18,"end":0.72,"text":"Hello, this","words":[
{"text":"Hello,","start":0.18,"end":0.48},{"text":"this","start":0.54,"end":0.72}]}]}
← {"type":"partial","text":"Hello, this"}
← {"type":"providerResponse","providerResponse":{"tokens":[
{"text":"Hello,","start_ms":180,"end_ms":480,"confidence":0.99,"is_final":true},
{"text":" this","start_ms":540,"end_ms":720,"confidence":0.98,"is_final":true},
{"text":" is","start_ms":780,"end_ms":900,"confidence":0.97,"is_final":true},
{"text":" the","start_ms":960,"end_ms":1080,"confidence":0.84,"is_final":false},
{"text":" voice","start_ms":1140,"end_ms":1440,"confidence":0.79,"is_final":false}],
"final_audio_proc_ms":900,"total_audio_proc_ms":1500}}
← {"type":"transcript","confirmed":[
{"start":0.18,"end":0.72,"text":"Hello, this","words":[
{"text":"Hello,","start":0.18,"end":0.48},{"text":"this","start":0.54,"end":0.72}]}],
"pending":[
{"start":0.78,"end":1.44,"text":"is the voice","words":[
{"text":"is","start":0.78,"end":0.9},{"text":"the","start":0.96,"end":1.08},
{"text":"voice","start":1.14,"end":1.44}]}]}
← {"type":"final","text":"Hello, this is"}
← {"type":"partial","text":" the voice"}
→ {"type":"end"}
← ... (more providerResponse, transcript, final and partial messages)
← {"type":"providerResponse","providerResponse":{"tokens":[],"final_audio_proc_ms":6640,"total_audio_proc_ms":6640,"finished":true}}
← {"type":"done","requestId":"req_...","model":"soniox/stt-rt-v6","provider":"soniox",
"text":"Hello, this is the voice router.",
"transcript":{"segments":[{"start":0.18,"end":2.4,"text":"Hello, this is the voice router.","words":[...]}]},
"providerResponse":{"text":"Hello, this is the voice router."},"audioSeconds":6.64}
(close 1000)
To display a live transcript as text: display = finals.join("") + currentPartial.
The shared transcript, live
transcript messages carry the shared transcript while the
audio is still coming. The segments have the same shape as an upload's. Use them when you
want speakers and times without reading each provider's own messages.
confirmed: append. These segments are final. They are sent once and never change.pending: replace. This is the whole current guess for what is still being spoken. Each one replaces the previous one. An empty list clears it.- To display it:
display = confirmedSoFar.concat(latestPending). - A
transcriptmessage comes just before thepartial/finalread from the same provider message. It is sent only when something changed. done.transcriptis everything confirmed, whole. In it, pieces confirmed one after another by the same speaker are joined into one segment, so a speaker's turn is one segment. Join them the same way if you build the transcript yourself.- Times are seconds from the start of your stream. This holds after a dropped provider connection too: the new connection's times are moved to your stream's clock, and words it repeats are left out.
- What is filled in depends on the connection: the same table as for uploads.
- Soniox confirms a word in
transcriptonce the next word has started, soconfirmedcan be one word behindfinal. At the end of the stream they match. - ElevenLabs sends word times on a stream only with
options.elevenlabs.include_timestampsset totrue, and speakers only withdiarizeset totrue. Without them its livetranscriptis text only. - A model with no live translator sends no
transcriptmessages. Itsdone.transcriptis one segment holding the text:{"segments": [{"text": "..."}]}.
The model's own messages (providerResponse). Every message the model's provider sends is
passed to you untouched inside a providerResponse message: same field names, same values, nothing
removed. For soniox/stt-rt-v6 that is each of Soniox's
token messages (tokens, with
text, start_ms, end_ms, confidence, is_final, and speaker, language,
translation_status and source_language when you turn those options
on, plus final_audio_proc_ms and total_audio_proc_ms), the marker tokens <end>
(with enable_endpoint_detection) and <fin>, and the last message with
"finished": true. Things to know:
partial,finalanddoneare unchanged and are all a text-only client needs. Marker tokens such as<end>are never part of their text; they are only inproviderResponse.- A
providerResponsemessage can be up to 4 MiB; in practice Soniox's are a few KB. - Read messages as they arrive. If more than 8 MiB of messages is waiting for your
client to read, the stream ends with
errorinvalid_request(1008). donedoes not repeat the model's messages: itsproviderResponseholds only the text. Keep theproviderResponsemessages you need as they come.- For speakers and times in one shape for every model, read the
transcriptmessages instead (see above). - The provider's own error message is not passed on: a failure arrives as Sonnit's
errormessage. - After a dropped provider connection. If the connection to the provider drops,
the Sonnit API opens a new one and carries on (at most 3 times per stream).
finaltext is joined up for you.providerResponsemessages are not edited: they come from the new connection as it sends them. Itsstart_ms/end_mscount from where the new connection began, not from the start of your stream. And if the drop came after yourend, the last 5 seconds of audio are transcribed again there, so their tokens can repeat.
Changed in December 2026. result was renamed providerResponse in December 2026:
the message {"type":"result","result":{...}} is now
{"type":"providerResponse","providerResponse":{...}}, and done.result is now
done.providerResponse. Same content. A client that reads result messages or
done.result.text must read the new names (or done.text). transcript is new: on
uploads, and on streams as transcript messages and done.transcript. A client that
treats an unknown message type as an error must ignore transcript messages (or use them).
Changed in November 2026. The model's own messages (then result, now
providerResponse messages) are new, and done now has text at the top. The one
thing an existing client may notice: the language beside done's text is gone (it
only repeated the language you sent), and a client that treats an unknown message type
as an error must ignore these messages (or use them).
Rules and limits
- Text messages other than
{"type":"end"}end the stream witherror(1008). - If nothing (no audio and no end message) arrives for 30 seconds, the stream ends with
error(1008). - A message larger than 256 KiB closes the socket with code
1009. - A stream can carry up to 1 hour of audio. Then the server sends
stopped: max_duration. - A stream can also stay open at most the start timeout (20 seconds) plus 1 hour of wall
time, however little audio it sends. Then it gets
stopped: max_durationtoo. - Send audio as it is recorded. Audio that arrives while the model is starting, or while
the server extends the stream's allowance, waits in memory, up to 8 messages' worth
(2 MiB, about 65 seconds; while the model starts, that much per model it may try). A client that sends far faster than real time and passes that
gets
errorinvalid_request(1008). - An account can have up to 5 streams open at once, across all its keys. Opening
another gets
429 rate_limited(unbilled, withRetry-After) until one has ended. - Once audio is flowing, fallbacks no longer apply: if the model fails mid-stream, you get
error. Open a new stream to continue. - To stop recording, send
{"type":"end"}and keep reading untildone: you get the transcript of everything sent. Closing the socket without it abandons the stream: no transcript, but the audio already sent is billed. In the example clients, ending the audio sequence (closing the Go channel, finishing the TS iterable or the C# sequence) sends the end message. A sequence that throws, cancellation included, abandons the stream. - Billing: a stream is billed for the audio you sent (
audioSeconds) once a model has started on it. A stream that no model could start is not billed.
These read a 16 kHz mono 16-bit WAV, skip its header, and send the samples in 100 ms chunks at real-time pace, as a microphone would. To stream from a microphone, send its 16 kHz PCM frames the same way. To stay short, they don't check the WAV's format: any other format would be streamed as noise (and billed). The full example programs check it first.
curl can't hold a two-way WebSocket conversation (a stream needs binary audio messages and a text end message), so there is no curl example for streaming. Use one of the programs below. curl is still handy for checking that a stream would be accepted, since every refusal is an ordinary HTTP response:
# Prints the status line: 101 = the request is accepted. Whether the model starts comes
# next, as a "started" or "error" message. Drop "| head -1" to see an error's body.
# --http1.1: a WebSocket upgrade needs HTTP/1.1 (over HTTP/2 curl drops the Upgrade headers).
curl -s -i --http1.1 --max-time 3 "$SONNIT_API_URL/v1/transcribe/stream?model=soniox/stt-rt-v6&language=en" \
-H "X-API-Key: $SONNIT_API_KEY" \
-H "Connection: Upgrade" -H "Upgrade: websocket" \
-H "Sec-WebSocket-Version: 13" -H "Sec-WebSocket-Key: $(openssl rand -base64 16)" | head -1
A check that returns 101 really opens a stream, which curl then drops. That costs no
recording time, since no audio was sent, but it counts toward the rate limit and shows up
as a failed request in your usage. Don't run it in a loop.
TypeScript (Node 18+, ws, since the standard
WebSocket API has no way to set the X-API-Key header)
import { readFile } from "node:fs/promises";
import WebSocket from "ws";
const pcm = pcmFromWav(await readFile("sample.wav"));
const url = new URL(`${process.env.SONNIT_API_URL!.replace(/^http/, "ws")}/v1/transcribe/stream`);
url.search = new URLSearchParams({ model: "soniox/stt-rt-v6", language: "en" }).toString();
const ws = new WebSocket(url, { headers: { "X-API-Key": process.env.SONNIT_API_KEY! }, handshakeTimeout: 30_000 });
ws.on("unexpected-response", (_req, res) => {
// A refusal (401, 402, 429...) is an HTTP response, not a WebSocket.
let body = "";
// "close", not "end": it also fires if the connection drops partway through the body.
res.on("data", (c) => (body += c)).on("close", () => console.error(res.statusCode, body));
});
ws.on("error", (err) => console.error(err.message)); // e.g. connection refused
let finals = "";
ws.on("message", (data) => {
const msg = JSON.parse(data.toString());
switch (msg.type) {
case "partial": process.stdout.write(`\r${finals}${msg.text}`); break;
case "final": finals += msg.text; break;
// The model's own message, untouched. For Soniox: tokens with timing, and markers.
case "providerResponse":
if (msg.providerResponse.tokens?.some((t: any) => t.text === "<end>")) process.stdout.write(" [end of utterance]");
break;
case "done": console.log(`\n${msg.text} (${msg.audioSeconds}s, ${msg.model})`); break;
case "error": console.error(`\n${msg.error.code}: ${msg.error.message}`); break;
}
});
ws.on("open", async () => {
const chunk = 3200; // 100 ms of 16 kHz 16-bit mono
for (let i = 0; i < pcm.length; i += chunk) {
if (ws.readyState !== WebSocket.OPEN) return; // the stream ended early (error)
ws.send(pcm.subarray(i, i + chunk)); // Buffers go out as binary messages
await new Promise((r) => setTimeout(r, 100));
}
ws.send(JSON.stringify({ type: "end" })); // strings go out as text messages
});
/** The samples of a WAV file: the payload of its "data" chunk. */
function pcmFromWav(wav: Buffer): Buffer {
for (let off = 12; off + 8 <= wav.length; ) {
const id = wav.toString("ascii", off, off + 4);
const size = wav.readUInt32LE(off + 4);
if (id === "data") return wav.subarray(off + 8, Math.min(wav.length, off + 8 + size));
off += 8 + size + (size % 2);
}
throw new Error("no data chunk");
}
C# (.NET 8, built-in ClientWebSocket)
using System.Net.WebSockets;
using System.Text;
using System.Text.Json;
var baseUrl = Environment.GetEnvironmentVariable("SONNIT_API_URL")!;
var uri = new Uri(baseUrl.Replace("https://", "wss://").Replace("http://", "ws://")
+ "/v1/transcribe/stream?model=soniox/stt-rt-v6&language=en");
using var ws = new ClientWebSocket();
ws.Options.SetRequestHeader("X-API-Key", Environment.GetEnvironmentVariable("SONNIT_API_KEY"));
ws.Options.CollectHttpResponseDetails = true; // keeps the status code of a refused handshake
try { await ws.ConnectAsync(uri, new CancellationTokenSource(TimeSpan.FromSeconds(30)).Token); }
catch (Exception e) when (e is WebSocketException or OperationCanceledException)
{
Console.Error.WriteLine(ws.HttpStatusCode != 0 ? $"refused: HTTP {(int)ws.HttpStatusCode}" : e.Message);
return;
}
var pcm = PcmFromWav(await File.ReadAllBytesAsync("sample.wav"));
using var stop = new CancellationTokenSource(); // stops the sender once the stream ends
var sender = Task.Run(async () =>
{
try
{
const int chunk = 3200; // 100 ms
for (var i = 0; i < pcm.Length; i += chunk)
{
var part = pcm.AsMemory(i, Math.Min(chunk, pcm.Length - i));
await ws.SendAsync(part, WebSocketMessageType.Binary, true, stop.Token);
await Task.Delay(100, stop.Token);
}
var end = Encoding.UTF8.GetBytes("{\"type\":\"end\"}");
await ws.SendAsync(end, WebSocketMessageType.Text, true, stop.Token);
}
catch (Exception e) when (e is WebSocketException or OperationCanceledException) { } // ended early
});
var finals = new StringBuilder();
var buffer = new byte[64 * 1024];
while (ws.State == WebSocketState.Open)
{
using var message = new MemoryStream();
WebSocketReceiveResult r;
do
{
r = await ws.ReceiveAsync(buffer, CancellationToken.None);
message.Write(buffer, 0, r.Count);
} while (!r.EndOfMessage);
if (r.MessageType == WebSocketMessageType.Close) break;
using var doc = JsonDocument.Parse(message.ToArray());
var msg = doc.RootElement;
switch (msg.GetProperty("type").GetString())
{
case "partial": Console.Write($"\r{finals}{msg.GetProperty("text").GetString()}"); break;
case "final": finals.Append(msg.GetProperty("text").GetString()); break;
// "providerResponse": the model's own message, untouched (msg.GetProperty("providerResponse")). Ignored here.
case "done": Console.WriteLine($"\n{msg.GetProperty("text").GetString()}"); break;
case "error": Console.Error.WriteLine($"\n{msg.GetProperty("error").GetProperty("code").GetString()}"); break;
}
}
stop.Cancel();
await sender;
static byte[] PcmFromWav(byte[] wav)
{
for (long off = 12; off + 8 <= wav.Length;)
{
var id = Encoding.ASCII.GetString(wav, (int)off, 4);
long size = BitConverter.ToUInt32(wav, (int)off + 4); // may be 0xFFFFFFFF ("until the end")
if (id == "data") return wav[(int)(off + 8)..(int)Math.Min(wav.Length, off + 8 + size)];
off += 8 + size + (size % 2);
}
throw new InvalidDataException("no data chunk");
}
Go (github.com/coder/websocket)
ctx := context.Background()
// The library takes the http(s) URL as is.
wsURL := os.Getenv("SONNIT_API_URL") + "/v1/transcribe/stream?model=soniox/stt-rt-v6&language=en"
conn, res, err := websocket.Dial(ctx, wsURL, &websocket.DialOptions{
HTTPHeader: http.Header{"X-API-Key": {os.Getenv("SONNIT_API_KEY")}},
})
if err != nil {
if res != nil { // refused before the upgrade: an ordinary HTTP error
body, _ := io.ReadAll(res.Body)
log.Fatalf("refused: %d %s", res.StatusCode, body)
}
log.Fatal(err)
}
defer conn.CloseNow()
conn.SetReadLimit(1 << 20) // the default 32 KiB is too small for a long transcript in "done"
wav, _ := os.ReadFile("sample.wav")
pcm := pcmFromWav(wav)
go func() {
const chunk = 3200 // 100 ms
for i := 0; i < len(pcm); i += chunk {
if err := conn.Write(ctx, websocket.MessageBinary, pcm[i:min(i+chunk, len(pcm))]); err != nil {
return
}
time.Sleep(100 * time.Millisecond)
}
conn.Write(ctx, websocket.MessageText, []byte(`{"type":"end"}`))
}()
var finals strings.Builder
for {
_, data, err := conn.Read(ctx)
if err != nil {
break // closed: 1000 after "done", 1008/1011 after "error"
}
var msg struct {
Type string `json:"type"`
Text string `json:"text"` // partial, final and done
// On "providerResponse": the model's own message, untouched. Decode the parts you need.
ProviderResponse json.RawMessage `json:"providerResponse"`
Error struct{ Code, Message string } `json:"error"`
}
json.Unmarshal(data, &msg)
switch msg.Type {
case "partial":
fmt.Printf("\r%s%s", finals.String(), msg.Text)
case "final":
finals.WriteString(msg.Text)
case "done":
fmt.Println("\n" + msg.Text)
case "error":
log.Printf("%s: %s", msg.Error.Code, msg.Error.Message)
}
}
// pcmFromWav returns the samples of a WAV file: the payload of its "data" chunk.
func pcmFromWav(wav []byte) []byte {
n := int64(len(wav)) // int64: chunk sizes go up to 0xFFFFFFFF
for off := int64(12); off+8 <= n; {
size := int64(binary.LittleEndian.Uint32(wav[off+4:]))
if string(wav[off:off+4]) == "data" {
return wav[off+8 : min(n, off+8+size)]
}
off += 8 + size + size%2
}
log.Fatal("no data chunk")
return nil
}
Look up a request
GET /v1/transcribe/{requestId} returns the status and timing of an earlier request,
batch or streaming. Transcripts and audio are never stored, so this returns
metadata only. Save the transcript from the original response.
{
"requestId": "req_5f1c9c1e-2b7d-4f0e-9a1b-6c3d2e1f0a9b",
"model": "soniox/stt-async-v6",
"status": "succeeded",
"createdAt": "2026-10-13T09:21:04.512Z",
"durationMs": 2381
}
status is succeeded or failed. model is the model that served the request (or,
for a stream that failed, the last one tried). Failed POST /v1/transcribe requests return
no requestId, so only successful ones and streams can be looked up. A request ID that doesn't exist and a request belonging
to another account both return 404 not_found. A malformed ID returns
400 invalid_request.
Lookup history is kept in memory on the gateway and is cleared when the service restarts. Use it for recent requests, not as a permanent record.
curl
curl -s "$SONNIT_API_URL/v1/transcribe/$REQUEST_ID" -H "X-API-Key: $SONNIT_API_KEY"
TypeScript
const res = await fetch(`${process.env.SONNIT_API_URL}/v1/transcribe/${encodeURIComponent(requestId)}`, {
headers: { "X-API-Key": process.env.SONNIT_API_KEY! },
});
if (res.status === 404) console.log("no such request");
else console.log(await res.json()); // { requestId, model, status, createdAt, durationMs }
C#
using var res = await http.GetAsync($"v1/transcribe/{Uri.EscapeDataString(requestId)}");
if (res.StatusCode == System.Net.HttpStatusCode.NotFound) Console.WriteLine("no such request");
else Console.WriteLine(await res.Content.ReadAsStringAsync());
Go
req, _ := http.NewRequest("GET", os.Getenv("SONNIT_API_URL")+"/v1/transcribe/"+url.PathEscape(requestID), nil)
req.Header.Set("X-API-Key", os.Getenv("SONNIT_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(body))
Billing usage
GET /v1/billing/usage returns your account's usage on both billing meters: recording
time and generated tokens. It covers all time (top level) and this calendar month
(currentPeriod, the window the monthly caps apply to).
{
"recording": { "totalSeconds": 3725.5, "hours": 1, "minutes": 2, "seconds": 5 },
"tokens": { "total": 1234, "unreportedRequests": 0 },
"requests": { "total": 12, "succeeded": 11, "failed": 1, "inProgress": 0 },
"currentPeriod": {
"start": "2026-10-01T00:00:00.000Z",
"resetsAt": "2026-11-01T00:00:00.000Z",
"recording": {
"totalSeconds": 845.2, "hours": 0, "minutes": 14, "seconds": 5,
"limitHours": 40, "remainingSeconds": 143154.8
},
"tokens": { "total": 980, "reserved": 0, "estimated": 0, "limit": 5000000, "remaining": 4999020 }
}
}
| Field | Meaning |
|---|---|
recording.totalSeconds | Total length of all audio you've submitted, to the millisecond. hours/minutes/seconds break down the whole seconds. |
tokens.total | Tokens the models generated for your transcripts. |
tokens.unreportedRequests | Successful requests whose model reported no token count (not included in total). |
requests | Request counts, including inProgress (still running). |
currentPeriod.recording.remainingSeconds | Recording time left this month. |
currentPeriod.tokens.reserved | Estimated tokens held by requests still running. |
currentPeriod.tokens.estimated | Estimates counted for models that don't report tokens. |
currentPeriod.tokens.remaining | limit - total - reserved - estimated. |
curl
curl -s "$SONNIT_API_URL/v1/billing/usage" -H "X-API-Key: $SONNIT_API_KEY"
TypeScript
const res = await fetch(`${process.env.SONNIT_API_URL}/v1/billing/usage`, {
headers: { "X-API-Key": process.env.SONNIT_API_KEY! },
});
const usage: any = await res.json();
const hoursLeft = usage.currentPeriod.recording.remainingSeconds / 3600;
console.log(`${hoursLeft.toFixed(1)} h of recording left until ${usage.currentPeriod.resetsAt}`);
C#
using var doc = JsonDocument.Parse(await http.GetStringAsync("v1/billing/usage"));
var period = doc.RootElement.GetProperty("currentPeriod");
var hoursLeft = period.GetProperty("recording").GetProperty("remainingSeconds").GetDouble() / 3600;
Console.WriteLine($"{hoursLeft:F1} h of recording left until {period.GetProperty("resetsAt").GetString()}");
Go
req, _ := http.NewRequest("GET", os.Getenv("SONNIT_API_URL")+"/v1/billing/usage", nil)
req.Header.Set("X-API-Key", os.Getenv("SONNIT_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
var usage struct {
CurrentPeriod struct {
ResetsAt string `json:"resetsAt"`
Recording struct {
RemainingSeconds float64 `json:"remainingSeconds"`
} `json:"recording"`
} `json:"currentPeriod"`
}
json.NewDecoder(res.Body).Decode(&usage)
fmt.Printf("%.1f h of recording left until %s\n",
usage.CurrentPeriod.Recording.RemainingSeconds/3600, usage.CurrentPeriod.ResetsAt)
Health
GET /v1/health needs no API key. It returns 200 {"status":"ok","model":"available"}
when the service and its models are reachable, and 503 {"status":"degraded",...} when
they are not.
curl -s "$SONNIT_API_URL/v1/health"
Legacy: GET /v1/model
An older, smaller version of the catalog, kept for existing clients:
{ "default", "models": [{ "model", "version", "status" }], "supportedLanguages" }.
New integrations should use GET /v1/models.
Errors
Every error has the same JSON body, whatever the endpoint:
{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded.",
"correlationId": "req_8c1d..."
}
}
Branch on code (stable) and the HTTP status, not on message (human-readable; it may
change). Messages never contain internal details.
| HTTP | code | Meaning | Retry? |
|---|---|---|---|
| 400 | invalid_request | The request is invalid: malformed JSON or form, missing field, unknown model, wrong mode for the model, unsupported language, audio the model doesn't take (for most models anything but a 16 kHz WAV of up to 10 MiB; see Audio format), an upload over 90 MiB, a link that isn't a public http(s) address, or audio the model's provider could not fetch from the link, could not read, or found longer than it takes. message says what's wrong for audio and model problems (and for a stream's query). For POST /v1/transcribe body fields it is just "The request body failed validation.", so check the body against the request fields and the ids from GET /v1/models. | No. Fix the request. |
| 400 | model_not_enabled | The model exists but isn't enabled on this deployment (or no model behind auto can serve the request). | No. Pick another model. |
| 401 | unauthorized | Missing or invalid API key. | No. |
| 402 | usage_cap_exceeded | Your monthly cap is reached. See below. | After Retry-After (the monthly reset). |
| 404 | not_found | No such route or request ID. | No. |
| 429 | rate_limited | Too many requests; or (opening a stream) too many streams open at once; or more than 10 of your files or links (anything but a PCM WAV) being transcribed at once. Never billed. | Yes, after Retry-After seconds. |
| 500 | internal_error | Unexpected server error. | Reads: yes, with backoff. Transcriptions: see below. |
| 502 | model_error | The model's provider rejected the request or returned something unusable. | Usually no; try another model. |
| 503 | model_unavailable | The model service is unreachable or busy (all fallbacks included). Also returned with internal_error if rate limiting is temporarily unavailable. | Reads: yes, with backoff. Transcriptions: see below. |
| 503 | server_busy | Too many file uploads are in progress on the server that took yours. Nothing was read or billed. | Yes, after Retry-After seconds; or send a link, which needs no place. |
| 504 | model_timeout | The model didn't answer in time. | Transcriptions: see below; or use a faster model or shorter audio. |
| 524 | (none: a Cloudflare page, not JSON) | No response within 125 seconds (see Response times). The request may still complete and be billed. | No. Stream long audio, or use a faster model. |
A 402 also carries error.usage and a Retry-After header (seconds until the monthly
reset):
{
"error": {
"code": "usage_cap_exceeded",
"message": "Monthly recording cap of 40 hours reached; usage resets at 2026-11-01T00:00:00.000Z.",
"correlationId": "req_...",
"usage": { "cap": "recording", "used": 143999, "limit": 144000, "resetsAt": "2026-11-01T00:00:00.000Z" }
}
}
used and limit are seconds for cap: "recording" and tokens for cap: "tokens".
Retrying safely.
- Reads (
GETendpoints) are safe to retry on429,500,503and504. POST /v1/transcribeisn't idempotent: a retry is a new request with its own charge. A request that reached a model is billed for its recording time even when the model then failed (500,502,503 model_unavailable,504). Retry it automatically only on429and503 server_busy, which are rejected before anything is billed. After a5xx, retrying (perhaps with another model) is your call, knowing that the recording is billed again.- Streams: a refused handshake (
429afterRetry-After, or503) and a stream that fails beforestarted(e.g.model_unavailable) are never billed, so both can be retried. A stream that failed afterstartedwas billed for the audio it sent.
Wait Retry-After or an exponential backoff (1, 2, 4, 8 s), whichever is longer, and add
some random jitter so that clients limited at the same moment don't all retry together.
Each of the example programs includes such a retry helper, following these rules.
Rate limits
Limits apply per account (shared by all of its keys) and per endpoint, as a token bucket: you can send a short burst at once, and then the bucket refills at a steady rate. They hold for the whole service, however many servers answer your requests.
| Endpoint | Sustained | Burst |
|---|---|---|
POST /v1/transcribe | 30 requests/minute | 5 |
GET /v1/transcribe/stream (opening a stream) | 30 streams/minute | 5 |
All other endpoints together (/v1/models, /v1/model, /v1/transcribe/{requestId}, /v1/billing/usage) | 60 requests/minute, shared | 10 |
/v1/health is not rate limited.
Separately from the rate of opening them, an account can have at most 5 live streams
open at once. Another gets 429 rate_limited, with a message saying so and
Retry-After, until one of them has ended.
Responses from rate-limited HTTP endpoints carry these headers (a refused stream
handshake carries only Retry-After):
| Header | Meaning |
|---|---|
X-RateLimit-Limit | Bucket size (the burst). |
X-RateLimit-Remaining | Requests left in the bucket right now. |
X-RateLimit-Reset | Unix time (seconds) when the bucket will be full again. |
Retry-After | On 429 and 503 server_busy (and on 402, until the monthly reset): seconds to wait before retrying. |
Limits and billing
| Limit | Value |
|---|---|
Request body (POST /v1/transcribe) | 15 MiB of JSON, or a 90 MiB file as multipart/form-data; uncompressed (a Content-Encoding such as gzip is 400 invalid_request) |
| Time to send a request | 5 minutes for the whole body. A 90 MiB upload needs about 2.5 Mbit/s or more |
options | 16 KiB as JSON (UTF-8 bytes), uploads and streams |
| Audio per request, 16 kHz WAV (every batch model) | 10 MiB (about 5.5 minutes of 16 kHz 16-bit mono) |
Audio per request, other formats (models whose input lists them) | By base64: what fits the 15 MiB body. By upload: 90 MiB. By link: the model's own limit (Soniox: 300 minutes). See Response times for what completes in practice |
| Files or links being transcribed at once (anything but a PCM WAV) | 10 per account (429 beyond) |
| File uploads in progress per server | 8 (503 server_busy beyond) |
| Audio per stream | 1 hour |
| Live streams open at once | 5 per account |
| Stream message size (what you send) | 256 KiB |
| Stream messages waiting to be read by your client | 8 MiB |
| Stream idle timeout | 30 seconds |
| Recording time per month | 40 hours (default) |
| Tokens per month | 5,000,000 (default) |
What's billed. Two meters: recording time (the length of the audio) and
tokens (generated by the model for the transcript). The response's audioDurationMs
is the recording time billed for that request. Where the length comes from:
| Audio | Recording time billed |
|---|---|
| A PCM WAV of up to 10 MiB | Its own length, read from the WAV header before the model runs. |
| A live stream | Counted from the PCM you send. |
| Any other file, or a link | What the model's provider measured. The Sonnit API doesn't decode these, so it can't know the length up front. |
For a file or link, the length isn't known until the provider has it, so while the
request runs it holds an amount against your monthly recording cap: your
durationSeconds if you sent one, otherwise a guess from the file's size (at 32 kbit/s,
so the guess errs long) or, for a link, the model's longest recording (300 minutes).
GET /v1/billing/usage shows the hold while the request is in progress.
When it finishes, the hold is replaced by the measured length, and the token estimate is
recomputed from it. durationSeconds never changes what you are billed.
If a file or link fails:
| What happened | Recording time billed |
|---|---|
| The provider had measured the recording before failing | The measured length. |
| An uploaded file failed before the provider measured it | What it held (your durationSeconds, or the guess from its size), as a failed WAV is billed its length. |
| A link failed before the provider measured it (it couldn't be fetched, say) | None. It still counts as a failed request. |
- One request is one charge, even if it fell back across several models.
- Requests that Sonnit's own checks reject (authentication, rate limits, request validation, an unknown or disabled model, monthly caps) are not billed.
- A request that reaches a model is billed for its recording time even if the model then rejects or fails it. A failed request generates no tokens.
- Models that don't report token counts are billed on an estimate (16 tokens per second of audio).
- Options that make the provider do more text work count as tokens too. For Soniox:
contextadds about 0.8 tokens per byte of its JSON (at most 8,000, Soniox's limit), andtranslationdoubles the per-second estimate (the translated text is extra output).
Monthly caps reset at 00:00 UTC on the 1st. A request is rejected with 402 if its
audio (for a file or link: what it holds, above) would take the month's recording time
past the cap, or if the token cap is already reached. A file or link is billed its
measured length even where that is more than it held, so the requests in progress when
you reach the cap can take you past it; that is why at most 10 run at once. Because tokens are only known after transcription, the request that crosses the
token cap still completes. Check where you stand with
GET /v1/billing/usage.
Model options
Whatever model you pick, you can use its provider's own options: put them in options,
under the provider's name, exactly as the provider's API documents them. The Sonnit API
passes them on as they are. It keeps no list of allowed options, so an option the
provider adds tomorrow works the same day.
{
"model": "soniox/stt-async-v6",
"audio": { "encoding": "base64", "sampleRate": 16000, "data": "UklGRiQAAABXQVZF..." },
"options": {
"soniox": {
"language_hints": ["ar", "en"],
"enable_speaker_diarization": true,
"context": { "terms": ["Sonnit"] }
}
}
}
- Uploads:
optionsin the body. Streams: anoptionsquery parameter holding the same object as JSON (URL-encoded). contextandtranslationare billed as tokens on top of the audio (see Limits and billing).optionscan be at most 16 KiB as JSON (counted in UTF-8 bytes). More is400 invalid_request. On a stream, keep it well under that: the whole handshake URL must fit in 16 KiB, or the server refuses it with431.- Only the part under the serving model's provider is used:
options.sonioxgoes to Soniox's models, and is ignored if a fallback served the request instead. - The Soniox, ElevenLabs, xAI and Modulate models read their part of
options:options.soniox,options.elevenlabs,options.xai,options.modulate. A model served through OpenRouter readsoptions.openrouter. Other models ignoreoptions. The Soniox entries below list their options; for the others, see the provider's own API reference. - A few fields are set by the Sonnit API itself and can't be overridden, because they decide
which audio the provider transcribes (which is what you're billed for). Setting one is
400 invalid_request. For Soniox:model,file_idandaudio_url(uploads), andmodel,audio_format,sample_rate,num_channelsandapi_key(streams). - A value the provider refuses (for example
max_endpoint_delay_ms: 1) is400 invalid_request, saying to checkoptions. On a stream it is anerrormessage (close1008). The request reached the model, so its recording time is billed. - Options that change what the model returns (speaker labels, token languages,
translation, endpoint markers) show up in the model's own response:
providerResponseon an upload, theproviderResponsemessages on a stream. Speaker labels, times and languages also show up intranscript, on uploads and streams.text,partialandfinalstay plain text.
Models
What each model takes and returns through the Sonnit API today, and what its provider
offers that the Sonnit API doesn't pass through yet. This guide describes only models we have
run a real recording through, and only those are switched on: they are listed under
Tested models. Each entry is built from the model's
sheet in docs/models/, which records everything the provider's own API
offers, with sources. The catalog (GET /v1/models) says which models are
enabled on your deployment.
soniox/stt-async-v6 (batch)
Soniox's async speech-to-text v6, released 3 November 2026. Sheet:
soniox-stt-async-v6.md.
| Through the Sonnit API | |
|---|---|
| Endpoint | POST /v1/transcribe |
| Languages | Optional (languageRequired: false): without one, Soniox detects the language. With one, it is sent as a hint: ["ar", "en"] for ar (so Arabic with English words is recognized), otherwise just that code, any of Soniox's 60 languages. options.soniox.language_hints replaces it. |
| Options | Everything on Soniox's create transcription request, under options.soniox: language_hints, language_hints_strict, enable_language_identification, enable_speaker_diarization, context, translation, webhook_url (with webhook_auth_header_name/_value), client_reference_id. |
| Audio | Any of aac, aiff, amr, asf, flac, mp3, ogg, wav, webm, m4a, mp4, at any sample rate, mono or stereo, passed to Soniox as it is: as base64 (about 11 MiB), as a file upload (90 MiB), or by link (Soniox fetches it). A PCM WAV of up to 10 MiB is measured and billed by its header; anything else is billed the length Soniox measured. Soniox takes files of up to 300 minutes; what completes inside one request is less, see below. |
| Returns | text: the whole transcript. audioDurationMs: the length billed. transcript: the shared transcript, built from Soniox's tokens: segments split where the speaker changes, with start and end in seconds and words (Soniox's word pieces joined into words, each with start, end, and language with language identification on); speaker with diarization on. Translated tokens and audio events are left out of it. providerResponse: Soniox's own transcript, untouched: id, text, and tokens, each with text, start_ms, end_ms, confidence, and, with the matching option on, speaker, language, translation_status, source_language. Translated tokens have no timing. |
| Time per attempt | up to 7 minutes (upload, queue and transcription at Soniox) |
| Replaces | soniox/stt-async-v5, still accepted as a deprecated id |
Offered by Soniox but not passed through yet:
- Input: long recordings as a job. Soniox takes files of up to 300 minutes, and a link
to one is accepted here, but the transcript has to come back inside the one request: at
most 7 minutes per attempt, and through
api.sonnit.aiabout 2 minutes before Cloudflare answers524(the request is then still processed and billed). Starting a job and polling for its result is the planned next step. Formats Soniox doesn't read itself aren't converted. - Output: the job's own record (
audio_duration_ms,created_at,filename,webhook_status_codeand the rest of Soniox's transcription object).providerResponseis the transcript only. The transcript'sidcan't be used at Soniox afterwards: The Sonnit API deletes the job there as soon as it has the result.
soniox/stt-rt-v6 (streaming)
Soniox's real-time speech-to-text v6, released 3 November 2026. Sheet:
soniox-stt-rt-v6.md.
| Through the Sonnit API | |
|---|---|
| Endpoint | WebSocket /v1/transcribe/stream |
| Languages | Optional, with the same hints as the batch model |
| Options | Everything on Soniox's start request, under options.soniox: language_hints, language_hints_strict, enable_language_identification, enable_speaker_diarization, context, enable_endpoint_detection, max_endpoint_delay_ms, endpoint_sensitivity, endpoint_latency_adjustment_level, enable_agent_text_input, idle_timeout_ms, enable_reconnect, translation, client_reference_id. |
| Audio | raw 16 kHz mono signed 16-bit little-endian PCM, up to 1 hour per stream |
| Returns | partial (the current guess, which may change) and final (confirmed text) messages, then done with the whole transcript. transcript messages with the shared transcript as it grows (speakers with diarization on, word times, each word's language with language identification on), and done.transcript with all of it. Also every message Soniox sends, untouched, as providerResponse messages: tokens (each with text, start_ms, end_ms, confidence, is_final, and, with the matching option on, speaker, language, translation_status, source_language), final_audio_proc_ms, total_audio_proc_ms, the <end> and <fin> marker tokens, and finished. |
| Replaces | soniox/stt-rt-v5, still accepted as a deprecated id |
Offered by Soniox but not passed through yet:
- Input:
- sample rates from 4,000 to 192,000 Hz (so 8 kHz phone audio without resampling);
- up to 8 channels, mixed into one transcript;
- mulaw and alaw;
- container formats.
- Messages a client sends mid-stream:
finalize,keepalive,ping,agent_text(whichenable_agent_text_inputturns on) andreconnect. A stream takes only audio and{"type": "end"}today. Soenable_agent_text_inputandenable_reconnectcan be switched on but not used yet, and<fin>andpongnever come. - Output: Soniox's own error message (
error_code,error_type,error_message,more_info,request_id): a failure arrives as Sonnit'serrormessage instead.
Tested models
A model is described here only after a real recording has gone through it on this API and we have checked what came back. Tested on 30 November and 1 December 2026 with one recording: 5 minutes 39 seconds, two speakers, Arabic.
Recordings (POST /v1/transcribe)
| Model | Speakers | Times | providerResponse | Notes |
|---|---|---|---|---|
soniox/stt-async-v6 | Yes | Each word | Soniox's own response, untouched. | Also each word's language. Full entry above. |
elevenlabs/scribe_v2 | Yes | Each word | ElevenLabs' own response, untouched. | Spacing and audio events (laughter and the like) are left out of transcript; they are in providerResponse. |
x-ai/grok-voice-transcribe-2.0 | Yes | Each word | xAI's own response, untouched. | |
modulate/velma-2-stt-batch | Yes | Each sentence. No words. | Modulate's own response, untouched. | Each sentence's language. Its emotion, accent and other per-sentence fields are only in providerResponse. |
microsoft/mai-transcribe-2 | Yes | Each word | OpenRouter's response, untouched. | Served through OpenRouter, so this is OpenRouter's format, not Microsoft's own. |
nvidia/nemotron-3.5-asr-multilingual | No | One start and end for the whole text. No words. | OpenRouter's response, untouched. | Served through OpenRouter. The model refuses the speaker option, so transcript is one segment. |
Live streams (WebSocket /v1/transcribe/stream)
| Model | Speakers | Times | providerResponse messages | Notes |
|---|---|---|---|---|
soniox/stt-rt-v6 | Yes | Each word | Each of Soniox's messages, untouched. | Full entry above. |
elevenlabs/scribe_v2_realtime | No | Each word | Each of ElevenLabs' messages, untouched. | The whole stream came back as one segment. |
elevenlabs/scribe_v3_live | With options.elevenlabs.diarize | Each word, with options.elevenlabs.include_timestamps | Each of ElevenLabs' messages, untouched. | Experimental. Text only without those two options. |
x-ai/grok-voice-transcribe-2.0-live | Yes | Each word | Each of xAI's messages, untouched. | Experimental. |
modulate/velma-2-stt-streaming | Yes | Each sentence. No words. | Each of Modulate's messages, untouched. | Experimental. Each sentence's language. The number of speakers it found changed between runs of the same recording (1, 2 and 3 for two real speakers). |
Speakers and times appear only when the model returns them. Turn on the provider's own
option for them under options.
The three experimental streaming models may change or be removed without notice, and
they are not enabled on every deployment: check GET /v1/models. auto
never picks them. language is optional for all three.
Models not in these tables are switched off. api.sonnit.ai serves only the models
above. A model is switched on once a real recording has been run through it and its row
is added here. A request for any other model is refused, and
GET /v1/models doesn't list it. (The catalog can still show a model as
unconfigured: that one has no provider key and can't be called either.)
Full example programs
examples/ has a complete, runnable program per language. Each one lists
models, transcribes a file, looks up the request, streams the same file live (all but the
curl one, since curl can't hold a WebSocket conversation), checks usage, and retries
following Retrying safely:
| Language | Folder | Run |
|---|---|---|
| curl / shell | examples/curl | ./sonnit.sh sample.wav [language] [file-or-link] |
| TypeScript (Node 18.17+) | examples/typescript | npm install && npm start -- sample.wav |
| C# (.NET 8) | examples/csharp | dotnet run -- sample.wav |
| Go (1.22+) | examples/go | go run . sample.wav |
All of them read SONNIT_API_URL and SONNIT_API_KEY from the environment. A
6.6-second English sample to try them with is
integration/fixtures/hello-en.wav. Each also
takes an optional third argument (after the language), a file in another format (sent as
an upload) or an https:// link, and sends it to soniox/stt-async-v6; the same recording as
hello-en.mp3 and
hello-en.m4a is there to try that with.
OpenAPI specification
The machine-readable spec is API/openapi/openapi.yaml
(OpenAPI 3.0). Load it into Postman, Insomnia or Swagger UI to explore the API, or into an
OpenAPI generator to produce a typed client in other languages.