Skip to content

Speech to text

Transcribe recorded audio over REST, or stream a live transcript over a realtime WebSocket.

Sprag transcribes speech with Rhythm, over an API that follows the OpenAI shape. If you already call OpenAI for speech to text, change the base URL and the model in your existing client.

1

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>
2

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=rhythm
3

Read the response

The default response carries the transcript and a usage record, and no other fields.

{
  "text": "Thanks, everyone, for joining. Let us start with the roadmap.",
  "usage": { "input": { "audio": { "duration": "5" } } }
}

usage is abbreviated above; the real object carries a per-modality vector for both sides of the request.

For audio duration, word timings, and speaker labels, use the verbose_json path, 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. Rhythm and Symphony for transcripts, Symphony for spoken conversation as well, Symphony Notes for describing what a recording contains.

Concepts. Timestamps, diarization, and language coverage.

Language coverage

Rhythm transcribes thirty languages plus twenty-two Chinese dialects. Sprag generates speech in ten, all of them inside Rhythm's set, so twenty of the languages a product can understand have no Sprag voice to answer in. If your product both listens and replies, check what Sprag can speak before committing to a language list.