Speech to text
Transcription of audio files and streaming real-time STT. Swedish-trained Whisper.
Speech to text
POST /v1/audio/transcriptions — KB-Whisper Large, trained on Swedish speech. Send the audio file as multipart/form-data in the audio field. NOTE: the field is called audio, not file — an OpenAI client sending file gets 422.
The cap is 50 MB per file; larger returns 413. The file is streamed through and counted byte by byte, so a misdeclared content-length does not get past the cap.
The language is locked to Swedish. There is no language parameter and no automatic language detection, so a short clip containing English terms cannot be misdetected as English.
Audio is decoded with ffmpeg, so most things work: WAV, MP3, AAC in mp4/m4a, Opus in ogg and webm are all verified. Android recordings do not need on-device transcoding.
The model field is not needed and is ignored — the server runs a fixed model (KB-Whisper Large, with a Swedish alignment model for the word timestamps). Send only audio.
Ordlista och terminologi
There is no vocabulary hint today. The Whisper architecture supports initial_prompt and hotwords, but our serving does not expose them per request. Proper nouns and technical terms — class names, paths, commands — are therefore transcribed by ear and often come out wrong. Clean up afterwards with a language model if terminology matters.
Svarets form
The response is WhisperX's own shape, NOT OpenAI's. You get segments — a list with start, end, text, words and avg_logprob — plus word_segments with per-word timestamps. There is no combined text field; join the segment texts yourself. response_format is not supported.
Svarstid och samtidighet
Transcription runs serialized: one file at a time for the whole service, so concurrent calls queue. Measured on an idle cluster: 30 seconds of audio took 1.4 seconds, 3 minutes took 3.3 seconds — roughly 55× faster than real time.
Speaker separation (opt-in)
Diarization — labelling who speaks when — is off by default and must be requested explicitly. Adding ?diarize=true is not enough: you must also send the header X-Diarize-Attestation: true. That header is your confirmation that you have a legal basis under GDPR Article 9(2) for the data subjects whose voices are separated — voice data identifying individuals is sensitive personal data. Without the header we return 400. Every diarized call is logged on our side for traceability.
The number of speakers can be bounded with the min_speakers and max_speakers query parameters (defaults 1 and 8). With diarization every word and segment gets a speaker field.
Streaming transcription (real time)
Besides file upload there is a WebSocket endpoint for real-time STT: wss://api.grunden.ai/v1/audio/realtime. Same model, but the transcript arrives continuously as you speak instead of when the file is done.
The key is sent as Authorization: Bearer on the HTTP upgrade, not as a message afterwards. Without it the server answers 401 during the handshake. A plain HTTP request to the address returns 404 — the endpoint exists only as a WebSocket upgrade.
Protocol
The FIRST message must be JSON containing a numeric sample_rate (8,000–192,000). After that, send audio as binary frames in PCM float32 mono. If audio arrives before the config, or sample_rate is missing, the session closes with code 1008 — we would rather measure nothing than measure wrongly. A later config with a DIFFERENT sample_rate is rejected for the same reason: the factor is locked per session.
Billing
Minutes are derived from bytes, not from wall clock: minutes = bytes / (sample_rate × 4 × 60). Connected-but-silent time is therefore free, and sending faster than real time costs the length of the audio, not the speed of the upload. The price is the same as for file transcription.
Limits
Maximum 2 MB per message. If the receiver falls behind and the queue passes 8 MB the session closes with code 1013. The server pings every 30 seconds, and a connection with no client data for 120 seconds is closed. Wallet balance must be above zero, as for the other Tier-1 services.
Real-time transcripts are not marked as AI-generated — the output is text from your own audio, not synthetic content.