Create browser voice session
POST
/v1/voice-agents/agents/{agentId}/sessionsHow to call this endpoint
Every ACP API request uses bearer authentication. The examples here show the actual request path, auth header, and body shape that the platform expects.
Path, query, and header parameters
These parameters control which ACP object the endpoint acts on and how the request is processed.
Path parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
| agentId | path | string | Yes | Agent ID |
Query parameters
None.
Body schema
Content type: application/json · Optional
| Field | Type | Required | Description |
|---|---|---|---|
| threadId | string | No | Thread ID. |
| environmentId | string | No | Computer ID. |
| title | string | No | Display title. |
What the API returns
Each response code below includes the documented payload shape for the ACP API.
201Voice session and xAI browser connection detailsapplication/json
| Field | Type | Required | Description |
|---|---|---|---|
| voiceSession | object | No | — |
| voiceSession.id | string | No | Unique identifier. |
| voiceSession.agentId | string | No | Agent ID. |
| voiceSession.threadId | string | No | Thread ID. |
| voiceSession.bindingId | string | No | — |
| voiceSession.provider | xai | No | — |
| voiceSession.channel | web | phone | No | — |
| voiceSession.status | initializing | active | completed | failed | cancelled | No | Current lifecycle status. |
| voiceSession.xaiCallId | string | No | — |
| voiceSession.xaiSessionId | string | No | — |
| voiceSession.fromNumber | string | No | — |
| voiceSession.toNumber | string | No | — |
| voiceSession.startedAt | string | No | ISO 8601 timestamp. |
| voiceSession.endedAt | string | No | — |
| voiceSession.durationSeconds | number | No | — |
| voiceSession.metadata | object | No | Free-form metadata object. |
| thread | object | No | — |
| xai | object | No | — |
| xai.realtimeUrl | string | No | — |
| xai.clientSecret | object | No | — |
| xai.clientSecret.value | string | No | — |
| xai.clientSecret.expiresAt | integer | No | — |
| xai.websocketProtocol | string | No | — |
| xai.sessionUpdate | object | No | — |