Skip to main content
The ringglabs Python SDK sends a complete audio file in one REST request, or streams live audio over a WebSocket and returns transcripts while the speaker talks; every feature works with both a synchronous Client and an AsyncClient. Parrot is in beta: SDK v0.1.x, MIT licence, Python 3.10 or later. Parameters and event fields can change before general availability.

Before you start

A workspace API key

The SDK sends it on every request; store it as RINGG_API_KEY.

Balance

At least one minute of credit to start a transcription.

Try it in the dashboard

Sidebar → Labs → STT (page heading Speech To Text, marked BETA) transcribes without code and shows your usage. Its API docs button opens the SDK on PyPI. The page has four tabs: Logs lists Request ID, Timestamp, Duration, Mode, Credits and Status, filtered by Status (In progress, Done, Failed), Mode (Streaming, On Final, REST) and a date range. Click a row to open the STT Request drawer with the request’s Parameters and Latency. In the try-it panel, pick Language (English or Hindi; Hindi is the default), switch Punctuation on if you want capitalisation and punctuation (off by default here; the SDK defaults it to on), then Upload file (WAV, MP3, FLAC or M4A, up to 10 MB) or Transcribe live from your microphone. The result shows on Transcription; Code shows the same request as TypeScript, Python and cURL.
STT try-it panel with Language English, Punctuation on, Upload file and Transcribe live buttons, and a Transcription box showing a transcribed Acme Lending payment reminder with a 6.2s duration chip

The try-it panel after uploading a file

Quickstart

The video ends at the API key the SDK needs; the steps below start there.

A tour of the STT page: file upload, then the Logs, Usage and Pricing tabs and the API key

1

Install

Add the SDK to your environment:
2

Get an API key

The SDK uses your workspace API key, generated under Settings → API key. Store it as RINGG_API_KEY.The workspace needs at least one minute of credit to start a transcription.
Generate API Key dialog showing a demo key, a Copy button and a warning that the key cannot be viewed again after leaving the page

The key is shown once, when generated

3

First call

Transcribe a local audio file:

SDK implementation

Pick the example that matches your audio source and execution model. The streaming examples read a WAV file and send it in 20 ms chunks, using two helpers from Audio helpers; for live audio, send each chunk as it is captured instead (20 to 40 ms chunks work best).

Audio helpers

The streaming examples import these from audio_helpers.py. They use only the Python standard library.
To convert another file to this format, run ffmpeg -i input.mp3 -ac 1 -ar 16000 -sample_fmt s16 sample.wav.

Client initialization

Client(...) and AsyncClient(...) share the same constructor. Both can be used as context managers (with / async with), which close the underlying connections on exit.

transcribe() (offline / REST)

Single-shot transcription of a complete audio file. Available on both Client and AsyncClient (await client.transcribe(...)).

Response: RestTranscriptionResult

STT Request drawer for a Done streaming request: timestamp, duration 47.8s, mode Streaming, credits 0.40 rupees, and a Latency tab listing audio duration, compute latency, processing time and segments

A request opened from the Logs tab by its request_id

stream() (real-time / WebSocket)

Open a streaming session, send audio chunks, and receive transcript events. Use it as a context manager so the session is opened on entry and closed on exit.

Stream and on-final modes

  • stream: the server detects pauses with its own voice activity detection (VAD) and sends a final transcript event for each spoken segment. Join the segments to build the full transcript. The session’s closing transcript event can have an empty transcription, so skip blank ones.
  • on_final: you mark each turn with start_speaking() and stop_speaking() (requires accept_client_vad_events=True). The server sends partial transcripts (is_final=False) that grow as the turn continues, then one final transcript (is_final=True) after stop_speaking().

Session methods

The async session is identical, with await on every call and async for on events().

WebSocket event types

Transcript event fields

Fields that don’t apply to an event are None.

Timeouts

Pass a TimeoutConfig to Client(timeout=...). All values are in seconds.

Errors

All SDK exceptions are importable from ringglabs.stt and inherit from RinggLabsError. A file over 10 MB is rejected with an ApiError (status_code=413), and a file in another format with status_code=415 (code UNSUPPORTED_AUDIO_FORMAT). A streaming session ends after one hour with the error code MAX_DURATION_EXCEEDED, and after 5 minutes without a message from the client with SESSION_TIMEOUT.
  • Reuse client instances in long-running services.
  • Set explicit timeout budgets with TimeoutConfig.
  • Log result.raw and event.raw, which carry the request_id.
  • Retry only transport failures and idempotent requests.
  • Keep sync and async execution models separate.

Next steps

Store the key safely

Keep it in a secret manager and rotate it if it leaks.

Use Parrot through TrueFoundry

Gateway access control and tracing in front of Parrot.