Skip to main content
Mic sessions let you test your AI agents directly from the browser using your microphone, without making a real phone call.

Endpoint

POST /v1/orgs/:org_id/mic-session

Request

{
  "agent_id": 12
}
FieldTypeRequiredDescription
agent_idintegerYesID of the agent to start a session with

Examples

curl -X POST https://api.thunderphone.com/v1/orgs/{org_id}/mic-session \
  -H "Authorization: Token YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": 12
  }'

Response (201)

{
  "call_id": 987654321,
  "token": "eyJ...",
  "room_name": "mic-987654321",
  "server_url": "wss://livekit.thunderphone.com"
}
FieldTypeDescription
call_idintegerUnique call identifier for this mic session
tokenstringLiveKit access token for joining the room
room_namestringLiveKit room name
server_urlstringLiveKit WebSocket server URL
Use the token, room_name, and server_url with the LiveKit client SDK to connect from the browser and stream audio to your agent.

Error Responses

StatusDescription
400Missing agent_id in request body
402Insufficient account balance
404Agent not found
502Internal service error (e.g. failed to create LiveKit room)