Speech to text
Transcribe recorded audio over REST, or stream a live transcript over a realtime WebSocket.
Speech to text turns recorded or live audio into a transcript through an API that follows the OpenAI shape. Upload a file for a finished recording, or open a realtime session for a live stream. If you already call OpenAI for speech to text, change the base URL and the model in your existing client.
Get an API key
Create a Sprag account and open API keys in the app to generate one.
Copy the key immediately. The full value is shown once and is not recoverable after you leave the page.
Export it as an environment variable, replacing the placeholder with your key:
export SPRAG_API_KEY=<your_sprag_api_key>Make a request
Upload the audio as multipart/form-data. Point any OpenAI-compatible client
at https://api.sprag.ai/v1 and pass rhythm as the model.
curl https://api.sprag.ai/v1/audio/transcriptions \
-H "Authorization: Bearer $SPRAG_API_KEY" \
-F [email protected] \
-F model=rhythmRead the response
The default response carries the transcript and a usage record.
{
"text": "Thanks, everyone, for joining. Let us start with the roadmap.",
"usage": { "input": { "audio": { "duration": "5" } } }
}usage is abbreviated above. For audio duration, word timings, and speaker
labels, request verbose_json, covered under Concepts.
Where to go next
API. Two transports: REST for a finished file, realtime for a live stream. Start here if you are not sure which you want.
Models. The models that take audio in, and which one fits transcription, conversation, or description.
Concepts. Timestamps, diarization, and language coverage. Transcription covers more languages than speech synthesis, so if your product both listens and replies, check what Sprag can speak before committing to a language list.