Skip to main content
GET
/
v1
/
omni
Open an Omni voice-agent session (WebSocket)
curl --request GET \
  --url https://api.pyai.com/v1/omni \
  --header 'Authorization: Bearer <token>'
{
  "error": {
    "message": "<string>",
    "type": "<string>",
    "param": "<string>"
  }
}

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 telephony.

Available options:
16000,
24000

Response

Switching Protocols — the Omni WebSocket is open.