curl -X POST https://api.thinnest.ai/v2/calls \
-H "Authorization: Bearer $THINNESTAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "web",
"agent_id": "ag_5d2678fd_e556"
}'
Request Body
Call type: web (browser) or outbound (phone)
Phone number to call from
voice_config
object
default:"Agent default"
Override STT/TTS config
Web Call
Creates a browser-based voice session. Returns a LiveKit token for the client to connect.
{
"type": "web",
"agent_id": "ag_5d2678fd_e556",
"voice_config": {
"stt_provider": "deepgram",
"tts_provider": "cartesia"
}
}
Response 201
{
"id": "demo-abc123",
"type": "web",
"status": "active",
"agent_id": "ag_5d2678fd_e556",
"token": "eyJhbGciOiJIUzI1...",
"livekit_url": "wss://api.thinnest.ai/livekit",
"room_name": "voice-ag_5d2678fd-abc123",
"expires_in": 300
}
Outbound Phone Call
Initiates an outbound phone call via Twilio/Vobiz SIP.
{
"type": "outbound",
"agent_id": "ag_5d2678fd_e556",
"phone_number_id": 12,
"customer": {
"number": "+919876543210",
"name": "Rahul"
}
}
Response 201
{
"id": 78,
"type": "outbound",
"status": "connecting",
"agent_id": "ag_5d2678fd_e556",
"customer": {
"number": "+919876543210",
"name": "Rahul"
},
"room_name": "voice-ag_5d2678fd-def456"
}
Errors
| Code | Description |
|---|
402 | Insufficient balance |
422 | Missing agent_id or invalid type |
429 | Rate limit exceeded (5 calls/min) |