Skip to main content

File Transcription

Upload an audio file and receive a text transcription. This endpoint is compatible with the OpenAI Audio Transcription API.

POST /v1/audio/transcriptions

View the full OpenAPI reference for file transcription.

Supported Formats

wav, mp3, flac, ogg, m4a, webm — up to 15 MB per file.

Request

Response Formats


Real-Time Streaming (WebSocket)

For real-time transcription, connect via WebSocket and stream audio frames. The server uses LocalAgreement to emit stable (confirmed) words as they are recognized, plus tentative partial results.
Real-time streaming is currently in beta. The WebSocket endpoint is available at wss://stt.freyavoice.ai/v1/audio/stream.

Connection

Pass your API key as the token query parameter. Non-browser clients can alternatively use the Authorization: Bearer YOUR_API_KEY header during the WebSocket handshake.

Wire Protocol

The session follows a simple three-phase protocol: 1. Configure — Send a JSON text frame with session settings:
2. Stream audio — Send raw PCM audio as binary WebSocket frames.
  • Format: 16-bit signed integer, little-endian, mono
  • Send frames continuously as audio is captured (e.g. every 100–500 ms)
3. End session — Send a JSON text frame to signal end-of-audio:

Server Messages

The server sends JSON text frames throughout the session:

How LocalAgreement Works

The server re-transcribes the accumulated audio buffer on every tick (~500 ms). It compares consecutive hypotheses and only emits words that both agree on as final. The unstable tail is sent as partial and may change on the next tick. This gives you low-latency confirmed words without hallucinated flicker.

JavaScript Example

Python Example