Agents

Mint a hosted widget voice session

Validates the published widget, exact browser Origin, Agent/account status, credit posture, and durable per-widget/per-IP daily limits, then returns one short-lived origin-locked omni:session token. The request body cannot select an organization, project, or Agent.

post/public/widgets/{publicId}/session

Request

  • Base URL: https://api.pyai.com
  • URL: https://api.pyai.com/public/widgets/{publicId}/session
  • Auth: none required

Path parameters

publicIdstring required

Headers

Originstring uri required

Response

Short-lived widget session

objectstring
tokenstring

The ephemeral session token. Offer it as the WebSocket subprotocol pyai-key.<token> after the pyai.v1 marker. Short-lived and origin-locked; safe to hand to the browser.

expires_atinteger

Token expiry, Unix epoch milliseconds.

urlstring

The Omni realtime WebSocket URL to connect to.

session_labelstring nullable

Echoed back when supplied on the request.

Example response

{
  "object": "omni.session",
  "token": "pyai_live_sess_a1B2…",
  "url": "wss://api.pyai.com/v1/omni?format=pcm16&rate=24000"
}

Changes

No recorded changes to this operation across all 1 revision of this API.