Full reference
Realtime voice and bounded audio
Use the hosted audio routes for individual speech operations, or a realtime websocket for an interactive voice session.
Updated
Reviewed against Console v0.2.2. Available actions depend on project access and runtime configuration; check your installed CLI version for command differences.
Choose an enabled audio route
The hosted gateway exposes speech synthesis, transcription and /api/v1/inference/realtime for supported realtime providers. Availability depends on the configured provider, model and workspace. Keep application bearer credentials on a trusted server or executor.
Provider and runtime choices
The realtime client resolves its endpoint and model from configuration. Hosted provider-backed voice and a separately configured native runtime have different capabilities. Do not assume a voice model, audio rate or turn-control setting is interchangeable between them.
Manage one connection lifecycle
Set up each connection once. Send audio in the format expected by that route, commit the input when using manual turn control, and request a response. Consume typed events until completion and handle cancellation or disconnection. A reconnect starts a fresh connection and needs its own setup.
Install the voice extra
uv add 'stimulir[realtime]'from stimulir.realtime import RealtimeClient, AudioDelta, ResponseDone
async with RealtimeClient(instructions="Answer briefly.").connect() as conn:
await conn.setup()
await conn.send_audio(pcm16_16k_mono)
await conn.commit()
await conn.create_response()
async for event in conn.events():
if isinstance(event, AudioDelta):
consume_audio(event.pcm16)
elif isinstance(event, ResponseDone):
breakProvide authorized input audio and implement consume_audio for your playback or storage destination. The example shows the client’s PCM path; check the selected route’s format before connecting.
Bound work and inspect usage
Use a bounded audio file or utterance while validating an integration. The CLI provides TTS, STT and realtime file-output commands below. Inspect trace and usage records after completion; audio cost and latency should be measured for the selected route.
Command catalogue
Expand a command for its arguments. These commands follow the released CLI source; check stimulir --version and the command’s --help for your installation. Required flags are marked; some operations also validate combinations of inputs.
stimulir voice realtime-say
Speak bounded stdin over Stimulir realtime; requires stimulir[realtime].
--output, -orequired- See the installed command’s --help for accepted values.
--provider- See the installed command’s --help for accepted values.
--model- See the installed command’s --help for accepted values.
--voice- See the installed command’s --help for accepted values.
--timeout- See the installed command’s --help for accepted values.
stimulir voice sts
Send one 16kHz mono PCM16 WAV utterance through realtime speech-to-speech.
audiorequired- Positional argument. See the installed command’s --help for accepted values.
--output, -orequired- See the installed command’s --help for accepted values.
--provider- See the installed command’s --help for accepted values.
--model- See the installed command’s --help for accepted values.
--voice- See the installed command’s --help for accepted values.
--timeout- See the installed command’s --help for accepted values.
stimulir voice stt
Transcribe one bounded local audio file and emit only the typed transcript.
audiorequired- Positional argument. See the installed command’s --help for accepted values.
--model- See the installed command’s --help for accepted values.
--language- See the installed command’s --help for accepted values.
--json- See the installed command’s --help for accepted values.
stimulir voice tts
Synthesize bounded stdin to an explicit output file.
--output, -orequired- Audio output file.
--model- See the installed command’s --help for accepted values.
--voice- See the installed command’s --help for accepted values.
--format- See the installed command’s --help for accepted values.