NanoASR API
Offline speech recognition. This page describes the endpoints this server has actually mounted, and nothing it does not serve.
- version v1.4.2
- auth apikey
- upload limit 1024 MiB
- dialect openai
- dialect native
- dialect era
Authentication
Every request needs an API key, as a bearer token:
curl -H "Authorization: Bearer $NANOASR_KEY" \
-F file=@call.wav -F model=gigaam-v3-ctc-punct-ru \
http://localhost:8080/v1/audio/transcriptions
A browser cannot set a header when it opens a WebSocket, so
/v1/realtime also accepts the key as a subprotocol:
openai-insecure-api-key.<key>. Any script on the page can read a
key the page holds, which is what "insecure" refers to; it is still a real key and
is checked like one.
Served without a credential:
/healthz, /readyz, /docs, /, /ui.
OpenAI audio API
Drop-in for /v1/audio/transcriptions, so an OpenAI SDK works by changing base_url and nothing else.
Transcribe an uploaded file.
multipart/form-data with file, and optionally model, language, response_format (json, verbose_json, text, srt, vtt) and repeated timestamp_granularities[] (word, segment). prompt is applied as a comma-separated hotword list rather than as an LM prompt, and temperature is accepted and ignored because the decoders do not sample; both are reported back as warnings. Asking for word timings from a model that cannot produce them yields segment timings and a warning, or 422 with X-NanoASR-Strict: 1.
Not implemented: this build ships transcription models only.
Answers 501. Translation needs a model that writes a language it did not hear.
List the models that can be passed as `model`.
Transcription models only: the supporting models (VAD, punctuation, diarization) and the streaming models are left out, because passing one here would fail. Each entry carries the NanoASR state, languages and whether it produces word timestamps.
Describe one model.
NanoASR API
Everything the server can do, in its own shapes: queued jobs with progress, word timings, diarization, and model administration. Errors are problem+json (RFC 9457).
Transcribe an uploaded file and wait for the result.
multipart/form-data with file, plus model, language (a locale of a multilingual model, or auto), channel_mode, diarize, num_speakers, punctuate, itn, hotwords, hotwords_dict, hotwords_score, decoding_method and word_timestamps. hotwords_dict names stored dictionaries by key and merges their phrases into hotwords. Cancelling the request stops the decode between batches rather than at the end of the file.
Queue the same work and return a job.
Takes the same fields as transcribe, plus webhook_url for a signed delivery on completion. The upload is held on disk until the job reaches a terminal state and is then deleted.
List this key's jobs.
Scoped to the calling key unless the key is administrative. Paged by cursor.
Fetch one job and its result.
Follow a job as server-sent events.
text/event-stream of numbered job states. Last-Event-ID resumes rather than replays. A job that has already finished yields one catch-up event and closes.
Name the speakers of a finished diarized job.
JSON: {"speaker_names": {"spk_0": "Anna"}}; an empty name gives a speaker its id back. The names are kept with the result as speakers[].name, beside the ids the segments carry, and label the srt and vtt cues.
Cancel a queued or running job.
A diarization pass already under way cannot be interrupted and runs to its end.
Say whether voice isolation is on, its download formats, and whether isolations may be kept.
{enabled, formats, keep}. Every /api/v1/isolations route answers capability_unavailable on a server where it is off. The steps: upload (POST /isolations), wait for awaiting_selection, listen to the voices' samples, then keep one (extract), every one (extract-all) or transcribe them all by speaker (POST transcript); fetch tracks and the transcript once the isolation is done.
List this key's isolations, the newest first.
{data: [isolation]}. An administrative key sees every one.
Upload a recording to isolate voices from.
multipart/form-data with file, num_speakers if known, and keep=true to store it until it is deleted. Answers 202 with an isolation that finds the voices (status analysing) and then waits for a choice (awaiting_selection). Unlike a job, its audio is kept until isolation.ttl passes with nothing happening, it is deleted, or the server stops; a kept one survives all but the delete.
Fetch an isolation: its voices, tracks and transcript progress.
status is queued, analysing, awaiting_selection, extracting, transcribing, done or failed. voices lists each speaker with its name, speaking time and the 3-second sample it would be isolated by, or the reason it has none; tracks the voices isolated so far; transcript the state of the transcript by speakers and its jobs.
Name the voices, and keep the isolation or let it expire.
JSON: {"names": {"spk_0": "Anna"}, "keep": true}; either may be left out, and an empty name gives a voice its id back. Names label the tracks' files and the transcript, including one already made.
Follow an isolation as server-sent events.
Numbered states until the isolation waits on a person or is done, then a done event. Watch again after starting the next step.
Listen to a voice: its sample as WAV.
Exactly the 3 seconds the extractor is told to keep.
Isolate one voice onto its track.
JSON or form: speaker, and sample_start in seconds to take the sample from somewhere else. May be repeated once nothing is running; isolating a voice again replaces its own track and no other.
Isolate every voice, a track each.
Every voice with a sample and no track yet. A voice without a sample is skipped with a warning: isolate it with extract and sample_start.
Download one voice's track.
format=wav (default) or mp3, 16 kHz mono, as long as the recording. MP3 needs ffmpeg on the server. /result?speaker= is the same; /result alone is the voice chosen last.
Download the recording as the isolation holds it.
format=wav or mp3, 16 kHz mono, on the same timeline as the tracks.
Queue one track for transcription.
Takes the fields of /api/v1/jobs except file, plus speaker, and answers 202 with the job. The job holds its own copy of the audio.
Transcribe by speaker: every voice isolated and transcribed alone.
Takes the fields of /api/v1/jobs except file; diarize is ignored. Isolates every voice still without a track, queues a job per track and merges them, each word labelled with its voice. Two voices speaking at once are both transcribed. Answers 202 with the isolation; follow its events through extracting and transcribing to done.
Fetch the transcript by speaker.
response_format=json (default: a result whose speakers carry their names), text (a dialogue, name: words), srt or vtt (labelled by name).
Delete an isolation and its audio now, kept or not.
Stops its work, and cancels the jobs of a transcript in progress.
List installed models and what is resident.
List the models available for download.
Download a catalog model, streaming progress as SSE.
Load a model into memory now.
Release a model.
Keep a model resident, or stop keeping it.
Swap in another revision without dropping requests.
The new instance is loaded and warmed before the pointer moves.
List hotword dictionaries, with the server's biasing policy.
q searches keys, names, descriptions and the phrases themselves; limit caps the page. Phrases are left out of a listing — fetch one dictionary for those — and policy says whether biasing is switched on at all, which models it can apply to being a separate question answered per model in /api/v1/models.
One dictionary and its phrases.
response_format=text returns the plain file the import endpoint reads back.
Create a dictionary.
JSON: key, name, description, score, and either phrases as a list or text as one block. Refuses a key that already exists; PUT replaces.
Replace a dictionary wholesale.
Delete a dictionary.
Upload phrases into a dictionary, creating it if the key is new.
multipart with a file field, or the file as the request body. One phrase per line with # comments, a one-column CSV, a JSON array of phrases, or a JSON dictionary as exported here. mode=append is the default; mode=replace swaps the phrase list.
The effective configuration, with secrets redacted.
whisper-asr-webservice contract
For clients written against ahmetoner/whisper-asr-webservice. It mounts at the root, so it is enabled deliberately rather than by default.
Transcribe and return the transcript as a file.
multipart with audio_file, plus output (txt, json, srt, vtt, tsv), task, language, word_timestamps and encode. task=translate is refused rather than answered with a transcription.
Report the language of the audio.
Answered from the model's declared languages, not from an acoustic language identifier: these are monolingual models, so the honest answer is what the model was trained on. A multilingual model left to choose the language is refused with 422: it decided something and the runtime does not say what.
Queue the same work and return a task id.
Poll a queued task.
Not enabled here
This build also carries the dialects below. They answer nothing
until they are named in api.dialects in the configuration, so their
routes are left out of this page and out of
openapi.json.
- realtime — OpenAI realtime transcription (websocket) Recognition while the audio is still arriving, over a websocket, in the event protocol of OpenAI's realtime API with intent=transcription. Needs a streaming model: realtime.model in the configuration.
Server
Endpoints that belong to no dialect.
Liveness, with the native library versions.
Readiness, and the queue depth.
503 when the queue is full, which is when a load balancer should stop sending work here.
This page.
The same endpoint list, as OpenAPI.
Redirects to /docs.
The test UI.
Served without a credential because a browser does not send a bearer token when it loads a script tag. The SPA discovers whether the API needs a key from the first 401 it gets.