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.

agent_id
string

Deprecated alias for session_label. Accepted for back-compat; prefer session_label. If both are present, session_label wins.

format
enum<string>
default:pcm16

Audio sample format for both directions.

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

Audio sample rate in Hz. Use 24000 for browser/WebRTC, 16000 for wideband telephony, or 8000 for an 8 kHz G.711/Twilio leg (μ-law companding only, no resampling). Load-bearing on the connect URL; the gateway preserves it verbatim.

Available options:
8000,
16000,
24000

Response

Switching Protocols, the Omni WebSocket is open.