Speech to Text API Accuracy: Fix Names
Improve speech to text API accuracy: set language as an ISO-639-1 code, pass names in prompt, upload the file rather than a URL, and measure on your audio.
By OceanToken Team

Editor's note: When a transcript spells your product name three different ways, the instinct is to blame the model and switch. Before you do, look at what the request sent. A call that carries only a file and a model id leaves unused the two fields aimed squarely at this problem. Switching models without using them just moves the same mistakes somewhere new.
Want to run the examples in this article? Get API Key and call every model below with one key.
Short answer: To improve speech to text API accuracy, first send language as an ISO-639-1 code such as en or zh, then put the names and terms you expect in prompt. Upload the audio as a file, because a URL is not fetched. Split long recordings and pass the previous chunk's last sentence as context. Measure proper-noun hits before and after.
We run these tests on OceanToken because one key and the same OpenAI-style POST /v1/audio/transcriptions call reach both openai/whisper-1 and microsoft/mai-transcribe-2, so you can compare the two on your own audio by changing the model string, with one prepaid balance and no subscription (docs.oceantoken.ai, checked November 30, 2026).
01 · What you can change in a transcription request
A transcription request has five fields, and only two of them affect what words come back. The rest decide what you send and what shape the answer takes. Here they are as our audio guide and both model references list them, read on November 30, 2026.
| Field | What it does | Affects accuracy? |
|---|---|---|
file |
The audio, uploaded as multipart: mp3, m4a, wav, webm and other common formats | Indirectly: a bad file gives bad text |
model |
The transcription model's id | Yes, but it is the last thing to change |
language |
The spoken language as an ISO-639-1 code, such as en or zh |
Yes: "improves accuracy when you know it" |
prompt |
"Names and spellings to expect" | Yes, for names and terms |
response_format |
json, text, verbose_json, srt or vtt; models differ in which they offer |
No, only the shape |
That is a short list, and it is the reason this article is more about method than about settings. There is no accuracy dial, no custom vocabulary upload and no confidence threshold in the documented request. What you have is a language hint, a text hint, the quality of the audio you send, and the choice of model. The first two cost nothing to add, so they come before any model change.
response_format deserves one note even though it does not change the words. If you plan to check accuracy segment by segment, verbose_json adds segments with timestamps, which makes it much easier to find where an error happened. Not every model offers every format, so confirm it on the model you use; our transcription API SRT subtitles guide covers the subtitle formats in detail.
02 · Speech to text API accuracy: match the error to the field
Transcription errors fall into a few recognizable types, and each one points to a different field. Before changing anything, read twenty or thirty lines of a bad transcript and sort the mistakes. The fix for a misspelled surname is not the fix for a paragraph that came back in the wrong language.

| What went wrong | Likely cause | Field to change | What to try |
|---|---|---|---|
| Whole passages in the wrong language, or translated | Language detected wrongly | language |
Send the ISO-639-1 code of the spoken language |
| Short clips come back in a different language | Too little audio to detect from | language |
Always send it for clips of a few seconds |
| Names, brands or product terms misspelled | Model has never seen the spelling | prompt |
List the correct spellings, comma-separated |
| Acronyms expanded or split up | Model guesses at letters | prompt |
Include the acronym as you want it written |
| Errors at the start of each chunk of a long file | Chunk lost the earlier context | prompt |
Pass the last sentence of the previous chunk |
| Garbled words throughout | Audio quality or heavy compression | file |
Re-export at a cleaner bitrate, cut noise |
| A request fails before transcribing | Wrong input type or size | file |
Upload the file; keep it under 10 MB |
| Errors remain after all of the above | The model's limits on this audio | model |
Run the same test on another model |
Mixed-language audio is the hard case. A Mandarin meeting full of English product names is one language with borrowed words; a call that switches between English and Spanish sentence by sentence is two. The language field takes a single code, so for the first case send zh and list the English terms in prompt, and for the second case test with and without language and compare, since forcing one code may hurt the other half.
03 · Transcription language parameter: ISO-639-1 codes
The transcription language parameter takes a two-letter ISO-639-1 code: en for English, zh for Chinese, es for Spanish, ja for Japanese, de for German. Our docs describe it as optional and say it "improves accuracy when you know it". If you know the language, send it every time.
The reason it helps is simple. Without language, the model has to identify the language from the audio before transcribing it, and that guess can go wrong, most often on short clips, heavy accents, or recordings that open with music or a greeting in another language. With the code, that step is settled for it.
Three mistakes show up repeatedly. The first is sending a full name such as "english" or a locale such as "en-US" instead of the two-letter code; the field asks for ISO-639-1. The second is sending a three-letter code such as eng. The third is hard-coding en in a product that now takes uploads from users in several countries. If your users pick a language in your interface, pass that choice through; if they do not, consider a short detection pass on the first minute and then send the detected code for the full file.
What happens with a code a model does not support is something to test on your own account. Our API overview states the general rule for every endpoint: a parameter the model does not support is dropped and the request runs without it, and "a successful response is not evidence that every parameter you sent took effect." The x-oceantoken-dropped-params response header names a dropped parameter, so read it once per model when you integrate.
04 · Whisper API prompt parameter: names and spellings
The Whisper API prompt parameter is a plain text field: put the names, brands and terms you expect, spelled the way you want them written. Our docs describe it in four words, "Names and spellings to expect", and both openai/whisper-1 and microsoft/mai-transcribe-2 list it.
A glossary prompt works better than a sentence of instructions. Write the terms as a short, natural list, for example "Speakers: Anika Desai, Tomasz Wróbel. Products: OceanToken, Kubernetes, PostgreSQL, gRPC." Instructions such as "Please spell names correctly" carry no spelling for the model to copy, so they give it nothing to work with.
Length matters on Whisper. OpenAI's speech-to-text guide says that for whisper-1, prompts have a 224-token limit and provide less control than the transcription model OpenAI now recommends. That is room for a few dozen names, not a full product catalog.
If your glossary is longer, pick the terms most likely to appear in this particular recording, such as the speakers on the call and the products on the agenda, and leave the rest out. The same guide lists carrying context from a previous chunk of a longer recording and preserving punctuation and capitalization as further uses of the prompt. It also says whisper-1 is deprecated and scheduled to shut down on February 26, 2027, which is one more reason to run every test in this article on microsoft/mai-transcribe-2 as well; the request is identical apart from the model string.
The prompt also shapes style. A prompt written in full sentences with punctuation nudges the transcript toward punctuation; a prompt in lowercase without commas can nudge it the other way. If your transcripts come back without punctuation, write the glossary as proper sentences.
On microsoft/mai-transcribe-2, the field is listed with the same description, but how much the model draws on it, and whether it has a length limit, is not documented on our side. Run the comparison in section 07 on both models rather than assuming the Whisper behavior carries over.
05 · Transcription API file URL not fetched: upload the audio
If your transcription API call sends a file URL and fails or comes back empty, the cause is documented: on POST /v1/audio/transcriptions the file must be uploaded, and "a URL in place of the file is not fetched." Download the audio to your server first and send the bytes as a multipart upload.
This catches people who come from video or image requests, where a public URL is the normal way to pass media. Transcription follows the OpenAI Audio API shape instead, which is multipart with a file field. With the OpenAI SDK, that means opening the file and passing the handle:
from openai import OpenAI
import os, requests
client = OpenAI(base_url="https://api.oceantoken.ai/v1",
api_key=os.environ["OCEANTOKEN_API_KEY"])
# Audio lives at a URL? Fetch it yourself, then upload the bytes.
audio = requests.get("https://example.com/recordings/standup.mp3", timeout=60)
with open("standup.mp3", "wb") as f:
f.write(audio.content)
with open("standup.mp3", "rb") as f:
result = client.audio.transcriptions.create(
model="openai/whisper-1", file=f, language="en",
prompt="Speakers: Anika Desai, Tomasz Wróbel. Terms: OceanToken, gRPC.")
print(result.text)
Size is the second half of the same problem. Our docs ask you to keep the request under 10 MB where you can, and give a useful rule of thumb: a 10 MB MP3 at 64 kbit/s holds about 20 minutes. For longer recordings, split the audio or compress it. Compression has an accuracy cost if you push it too far, so for speech, a mono MP3 around that bitrate is a sensible middle ground; test lower settings before you depend on them.
06 · Long recordings: carry context across chunks
When you split a long recording, each chunk starts with no memory of the one before, which is why errors often cluster in the first sentence or two of each piece. The fix is to pass the last sentence of the previous chunk's transcript in prompt, together with your glossary, so the model sees how the conversation was going and how names were spelled.
Keep the combined prompt short on Whisper, since the 224-token limit covers both the glossary and the carried-over text. Cutting at a pause instead of at a fixed byte count also helps, because a word split across two chunks is hard for either side to recover. The mechanics of splitting and shifting timestamps are covered in section 07 of our SRT subtitles guide, so we do not repeat them here.
07 · Measure it: a proper-noun hit test
The only way to know whether language or prompt helped is to count. The script below transcribes one file four ways on each model, with and without language and with and without prompt, then counts how many of your expected terms appear spelled correctly. It prints counts only; the numbers you get are about your audio, not a general ranking.
import os, re
from openai import OpenAI
client = OpenAI(base_url="https://api.oceantoken.ai/v1",
api_key=os.environ["OCEANTOKEN_API_KEY"])
AUDIO = "standup.mp3"
LANG = "en"
TERMS = ["Anika Desai", "Tomasz Wróbel", "OceanToken", "PostgreSQL", "gRPC"]
GLOSSARY = "Speakers: Anika Desai, Tomasz Wróbel. Terms: OceanToken, PostgreSQL, gRPC."
MODELS = ["openai/whisper-1", "microsoft/mai-transcribe-2"]
def hits(text):
return sum(1 for t in TERMS if re.search(re.escape(t), text))
for model in MODELS:
for use_lang in (False, True):
for use_prompt in (False, True):
kwargs = {"model": model}
if use_lang: kwargs["language"] = LANG
if use_prompt: kwargs["prompt"] = GLOSSARY
with open(AUDIO, "rb") as f:
raw = client.audio.transcriptions.with_raw_response.create(file=f, **kwargs)
text = raw.parse().text
dropped = raw.headers.get("x-oceantoken-dropped-params")
print(f"{model:28} lang={use_lang!s:5} prompt={use_prompt!s:5} "
f"hits={hits(text)}/{len(TERMS)} dropped={dropped}")
Two details keep the count honest. The script prints x-oceantoken-dropped-params for every run, because a prompt that was silently dropped would look like a prompt that did not help. And it counts exact spellings, which is strict on purpose: "Postgres" is not "PostgreSQL" if your style guide says otherwise. Use a recording of a few minutes with a known transcript, and run it more than once if your results are close.
How to test this on your workload
We have not run this test on our side, so no results are shown. This is the order we would follow on a real recording.
- Pick three recordings that represent your traffic: a clean one, a noisy one and one with many names. Write correct transcripts for a few minutes of each.
- Baseline. Transcribe each with only
fileandmodel, and count proper-noun hits. - Add
language. Rerun with the ISO-639-1 code and compare counts. - Add
prompt. Rerun with a glossary of the names that appear, and compare again. - Check dropped parameters. Confirm
x-oceantoken-dropped-paramsis empty forlanguageandprompton each model. - Long file. Split one recording, transcribe the chunks with and without the previous chunk's last sentence in
prompt, and compare the first lines of each chunk. - Second model. Repeat steps 2 to 4 on the other model, using the same audio.
- Charge. Check each run in the console's Logs, since models are billed per minute of audio or by token.
Our take: Set language on every request where you know it, and keep a short glossary per recording in prompt. Only after both are in place is a model comparison fair, and only your own hit counts, on your own audio, should decide it.
Running it on OceanToken
The base URL is https://api.oceantoken.ai/v1, transcription goes to POST /v1/audio/transcriptions as a multipart upload, and the model ids above are openai/whisper-1 and microsoft/mai-transcribe-2. What helps when you work on accuracy, from our docs as of November 30, 2026:
- One key for both models. The same OpenAI SDK call reaches both, so an A/B test is a change of
modelstring. The SDKs work with only the base URL and key changed. - Visible dropped parameters. The
x-oceantoken-dropped-paramsheader tells you when a field you sent was not applied. - Speech the other way too. The same key makes voice-overs; see our AI voiceover API guide. If you are deciding whether audio should go to a chat model instead of a transcription model, our Qwen3.8 Omni Flash vs Qwen3.8 Flash comparison covers that choice.
- Prepaid, no subscription. One balance covers transcription, text, image and video models.
Most transcription models are billed per minute of audio and a few by token; each model page shows the unit. Price: see the current rate on /whisper-api and on the Whisper 1 and MAI-Transcribe 2 model pages.
FAQ
What format does the language parameter take? A two-letter ISO-639-1 code, such as en, zh or es. Not a full name and not a locale like en-US.
What should I put in the prompt parameter? The names, brands and terms you expect, spelled correctly, as a short list. On whisper-1, OpenAI documents a 224-token limit.
Is whisper-1 being retired? OpenAI's speech-to-text guide says whisper-1 is deprecated and scheduled to shut down on February 26, 2027 (checked 2026-11-30). For a new integration, run the same tests on microsoft/mai-transcribe-2 by changing the model string.
Can I send a URL to the audio instead of the file? No. The file must be uploaded as multipart; a URL in place of the file is not fetched.
How large can the audio be? Keep the request under 10 MB where you can. A 10 MB MP3 at 64 kbit/s holds about 20 minutes; split or compress longer recordings.
Does response_format change accuracy? No, it changes only the shape of the answer. verbose_json adds timestamped segments, which help you find errors.
How do I know the prompt was used? Check the x-oceantoken-dropped-params header, then compare hit counts with and without it on the same audio.
Sources
- docs.oceantoken.ai: Speech and transcription guide (checked 2026-11-30)
- docs.oceantoken.ai: Whisper 1 API reference (checked 2026-11-30)
- docs.oceantoken.ai: MAI-Transcribe 2 API reference (checked 2026-11-30)
- docs.oceantoken.ai: API overview (checked 2026-11-30)
- OpenAI: Speech to text guide (checked 2026-11-30)
Get your OceanToken API key
- Create an OceanToken account and an API key.
- Copy the snippet below, paste your key, and run it.
- Check the current rate on /whisper-api.
curl https://api.oceantoken.ai/v1/audio/transcriptions \
-H "Authorization: Bearer $OCEANTOKEN_API_KEY" \
-F model="openai/whisper-1" \
-F file=@meeting.mp3 \
-F language="en" \
-F prompt="Speakers: Anika Desai, Tomasz Wróbel. Terms: OceanToken, gRPC."
Swap the model to microsoft/mai-transcribe-2 to run the same file on the second model.
More from the blog
LLM API Request Timeout: Fix 504 and 408
Why an LLM API request timeout happens after switching to a reasoning model or long output: the 240-second 504, the 120-second silent-stream 408, and the fixes.
Streaming LLM API Token Usage and Cost
Streaming LLM API token usage is null by default. Fix it with stream_options include_usage, then get the cost of a streamed completion from /v1/usage by id.
Hailuo Video Problems: 10 Fixes by Symptom
Hailuo video problems sorted by symptom: morphing faces, static or frantic motion, ignored camera moves, refused requests. Causes, fixes and a triage table.