Sessions
A session is one conversation between a visitor and an agent.
The quickest way to put an agent on your website is the widget embed code from a website channel. It calls these endpoints for you. See Website widget channel. Use the endpoints below only if you build your own client.
Start a session
/widget/v1/sessionStarts a voice session with an agent and returns a short-lived token. Your client uses the token to open a realtime voice connection with the provider named in model.
Before the session starts, the API checks that your organization has credit and a free voice line. A session reserves some credit while it runs.
Requires the widget:session permission.
Headers
X-API-KeystringrequiredBody
agent_idintegerrequiredGET /widget/v1/config.modelstringoptionalopenai or gemini. Any other value is ignored and the agent's own setting is used.voicestringoptionalcontextobjectoptional{"name": "Asha", "plan": "Gold"}. The agent sees them at the start of the conversation. Empty values are skipped.user_idstringoptionaluser_hash.user_hashstringoptionaluser_id, as hex. See Agent Memory for how to compute it on your server.visitor_idstringoptionaluser_id.Response fields
successbooleanoptionaltrue when the session started.session_idstringoptionalagent_idintegeroptionalagent_namestringoptionalmodelstringoptionalopenai or gemini.voice_llm_modelstring or nulloptionalclient_secretobjectoptionalclient_secret.ephemeral_tokenstringoptionalclient_secret.expires_atinteger or nulloptionalice_serversarray or nulloptionalinitial_messagestring or nulloptionalResponses
detail says why.widget:session, or is not allowed from this domain.agent_id is missing or user_id is longer than 128 characters.The token in client_secret is short-lived and only works for this session. Request a new session for each conversation. Do not cache or reuse it.
Get an ElevenLabs signed URL
/widget/v1/elevenlabs-convai/signed-urlFor agents that run on ElevenLabs Conversational AI. Returns a signed URL your client uses to connect to ElevenLabs directly. You can tell these agents apart in GET /widget/v1/config: their elevenlabs_convai_agent_id is set.
Your plan must include ElevenLabs voice. Requires the widget:session permission.
Headers
X-API-KeystringrequiredQuery parameters
agent_idintegerrequiredResponse fields
signed_urlstringoptionalResponses
widget:session, or is not allowed from this domain.