Choose a speech-to-text API for a voice agent by what the agent needs during a live call: streaming transcripts, a clear end to each turn, support for your audio format and language, and a destination for the audio that your team allows. Accuracy and speed matter as much, but they depend on your callers and your audio, so compare candidates on your own recordings instead of a published number.
This post doesn't rank vendors, and nothing in it was measured. VoiceAI SDK is a developer preview, and its benchmark results will be published with the 1.0 release. The code uses the planned 1.0 API to show how to check each requirement on a session, and was not run against live accounts.
What to check at a glance
| Requirement | Why a voice agent needs it | How to check it |
|---|---|---|
| Streaming transcripts | The agent hears the caller while they talk, which barge-in depends on | session.capabilities.streamingStt |
| End of turn | The agent should answer once the caller stops, not mid-sentence | final transcripts after vad.silenceMs of quiet |
| Phone audio | Calls arrive as 8 kHz mu-law | createSession with encoding: "mulaw" and sampleRate: 8000 |
| Language | The provider has to expect the caller's language | The language option |
| Word timings | Align captions or cut clips from a call | session.capabilities.wordTimings |
| Speaker labels | Recordings with more than one voice | session.capabilities.diarization |
| Where audio goes | Some teams can't send audio to a third party | local() keeps it on your machine |
An option the provider can't honour fails at createSession with VoiceError code unsupported. The SDK never drops it silently, so opening a session with your production options is itself a test.
Streaming, not only batch
A recording can wait for a batch transcript. A live call can't: the agent needs transcripts while the caller speaks, so it can hear them during its own reply and stop. Some providers only transcribe finished recordings; in the SDK they support transcribe and fail listen with unsupported.
import { createSession } from "voiceai-sdk";
import { assemblyai } from "voiceai-sdk/assemblyai";
await using session = await createSession(assemblyai(), { sampleRate: 16000, encoding: "pcm16", language: "en" });
const { streamingStt, wordTimings, diarization } = session.capabilities;
console.log({ streamingStt, wordTimings, diarization });Capabilities describe the session you opened, with its options, and some depend on the language. Read them after createSession rather than from a table you copied.
Try your production options on each candidate
List the options your agent will really use, then open a session with each candidate. This loop checks Spanish phone audio on three providers:
import { createSession, VoiceError } from "voiceai-sdk";
import { deepgram } from "voiceai-sdk/deepgram";
import { gladia } from "voiceai-sdk/gladia";
import { speechmatics } from "voiceai-sdk/speechmatics";
const candidates = { deepgram, gladia, speechmatics };
for (const [name, factory] of Object.entries(candidates)) {
try {
await using session = await createSession(factory(), { encoding: "mulaw", sampleRate: 8000, language: "es" });
console.log(name, session.capabilities);
} catch (err) {
if (!(err instanceof VoiceError && err.code === "unsupported")) throw err;
console.log(name, "unsupported:", err.message);
}
}The loop opens real sessions, so it needs each provider's key, such as DEEPGRAM_API_KEY, GLADIA_API_KEY and SPEECHMATICS_API_KEY. A provider that reports unsupported for this combination is out for a Spanish phone line, whatever else it does well.
Turn detection
A caller's turn ends when they have been quiet for vad.silenceMs, and the session produces a final transcript. A short value answers sooner but cuts in when callers pause to think. A long value is patient but makes every reply start later. How each provider marks the end of an utterance depends on the provider; the SDK turns it into a final transcript either way.
Tune silenceMs on recordings of real calls. Whether a provider accepts a custom value also depends on the provider, and one that can't fails at createSession.
Compare on your own recordings
Collect short recordings that sound like your callers: their accents, their phones, their background noise, and the words your business uses. Type a reference transcript for each. Then run them through every candidate with the CLI:
mkdir -p out
for provider in deepgram assemblyai speechmatics local; do
for file in recordings/*.wav; do
npx voiceai-sdk transcribe "$file" --provider "$provider" --json > "out/$provider-$(basename "$file" .wav).json"
done
doneCompare each output with its reference. Word error rate is the usual measure: substituted, deleted and inserted words, divided by the number of words in the reference. Look hardest at the words that matter to your agent, such as names, order numbers and product names.
For speed, stream a recording at real-time pace and time the transcripts:
import { readFile } from "node:fs/promises";
import { createSession } from "voiceai-sdk";
import { deepgram } from "voiceai-sdk/deepgram";
await using session = await createSession(deepgram(), { sampleRate: 16000, encoding: "pcm16" });
// 20 ms of 16 kHz mono pcm16 is 640 bytes. Send it at the pace a caller speaks.
async function* realTime(bytes: Uint8Array) {
for (let i = 0; i < bytes.length; i += 640) {
yield bytes.subarray(i, i + 640);
await new Promise((resolve) => setTimeout(resolve, 20));
}
}
const start = performance.now();
for await (const t of session.listen(realTime(await readFile("recordings/order-1.pcm")))) {
console.log(t.type, Math.round(performance.now() - start), "ms", t.text);
}Run it many times, from the region your server runs in, and compare the median and the slow end rather than a single run.
Keep the choice reversible
The provider is the first argument to createSession, so switching is an import change. Take the provider as a parameter in your own code, and use a pipeline such as { stt: speechmatics(), tts: cartesia({ voice }) } so you can replace speech-to-text without touching the voice. If a provider changes its models or terms, you can move without rewriting the agent.
Common questions
Which speech-to-text API is the most accurate? There is no general answer. Accuracy depends on the language, the accent, the audio quality, the vocabulary and the model. Benchmarks describes how VoiceAI SDK will measure providers for 1.0. Until then, your own recordings are the best test.
Should speech-to-text and text-to-speech come from the same provider? They don't have to. A pipeline combines any speech-to-text provider with any text-to-speech provider. One provider for both means one key and one account to manage.
Do I need speaker labels for a phone agent? Usually not for a one-to-one call. They matter when you transcribe meetings or calls with several people on one line. Speaker labels depend on the provider, and sometimes on the language.
What if audio can't leave our servers? Use local(), which runs Whisper on your machine. Partials arrive less often than from cloud providers, and speed depends on your hardware; see Run Whisper and Piper locally from TypeScript.
Next steps
- Choose a provider: common needs mapped to providers.
- Compare providers: the capability matrix for every provider.
- Benchmarks: what will be measured for 1.0, and how to measure in your own app.
More guides on the VoiceAI SDK blog, or start with the quickstart.