Live voice calls API
Check live browser-call availability, negotiate WebRTC audio sessions and receive real-time speech events.
Returns live voice readiness, supported languages and the current per-minute rate in paise.
curl -s -b cookies.txt https://dhvani.aware.co.in/api/live/status
{
"ready": true,
"reason": "",
"languages": ["Hindi", "Hinglish", "English"],
"price_per_minute_paise": 700
}
Exchanges a WebRTC SDP offer for an answer and starts the real-time voice session. Returns 402 if a business workspace has less than 1 minute of wallet balance, or 503 if the language or voice service is unavailable.
| Field | Type | Notes |
|---|---|---|
sdp | string | Required, 10 to 20,000 chars. |
type | string | Usually "offer". |
agent_id | string | Target agent ID (`404` if missing). |
language | string | One of Hindi, Hinglish, or English. |
pc_id, restart_pc | string?, bool? | Optional WebRTC peer connection ID and restart flag. |
{
"sdp": "v=0\r\n...",
"type": "answer",
"pc_id": "conn-...",
"max_seconds": 180,
"demo": true
}
Delivers trickle ICE candidates to an active WebRTC peer connection.
{
"pc_id": "conn-...",
"candidates": [
{"candidate": "candidate:...", "sdp_mid": "0", "sdp_mline_index": 0}
]
}
{"ok": true}
Data channel events
Clients open a WebRTC data channel named chat (ordered: true), send an initial rtvi-ai client-ready message, and receive server JSON events with label: "rtvi-ai":
Event type | Meaning |
|---|---|
user-started-speaking | Caller audio activity detected. |
bot-started-speaking | Agent started speaking (barge-in supported). |
bot-stopped-speaking | Agent finished speaking; caller's turn. |
user-transcription | Final recognized caller transcript when data.final is true. |
bot-output | Streamed spoken agent text when data.spoken is true. |
Call recording and billing
Completed calls are logged automatically to the workspace call history. Demo calls are free and capped at 180 seconds; business workspace calls are capped up to 900 seconds (or available wallet balance) and billed per started minute.