Skip to main content
GET
Open an Omni voice-agent session (WebSocket)

Authorizations

Authorization
string
header
required

Use Authorization: Bearer pyai_live_... (or pyai_test_...).

Query Parameters

session_label
string

Optional opaque tag for this session, echoed to your own kb_endpoint so you can branch per session. The session is authorized by your key's org (PyAI stores no per-agent state); any value in your org's namespace is accepted. Must be safe as a header value (no control chars, ≤256 chars). Omit it entirely if you don't need per-session correlation.

format
enum<string>
default:pcm16

Audio sample format for both directions.

Available options:
pcm16
rate
enum<integer>
default:24000

Caller-input sample rate in Hz. Use 24000 for browser/WebRTC, 16000 for wideband input, or 8000 for telephony. Agent output is 24 kHz for both 24 kHz and 16 kHz input sessions; 8 kHz sessions receive 8 kHz output. Read hello.audio_out, which is authoritative.

Available options:
8000,
16000,
24000
api_key
string<password>

Intentional server-side WebSocket auth option. Prefer the pyai.v1, pyai-key.<API_KEY> subprotocol pair in browsers so the key is not placed in a URL.

Maximum string length: 512

Response

Switching Protocols, the Omni WebSocket is open.