Build an interruptible voice agent (beta)
Create an agent in the portal, mint a browser token on your server, and report what was actually played when a caller interrupts.
Voice agents are in beta: a turn is one question and one spoken answer, billed at $10 per 1,000 turns (first 200 free). You get the reply text plus one audio link per sentence. It is not a phone call: there are no phone numbers and no streamed audio yet.
1. Create the agent
In the portal's agent builder, describe the agent, add business facts and publish a version. You get an agent id (ag_...).
2. Server: mint a 10-minute browser token
cURL (server)
curl -X POST https://speakvora.com/api/v1/agents/ag_123/sessions -H "x-api-key: $AGENT_KEY"3. Browser: send a turn
JavaScript
const turn = await fetch("https://speakvora.com/api/v1/agents/ag_123/turn", {
method: "POST",
headers: { authorization: "Bearer " + token, "content-type": "application/json" },
body: JSON.stringify({ session: "visit-42", text: "Can I move my appointment to Thursday?" }),
}).then(r => r.json());
// turn.sentences[i].audio_url -> play in order4. Interrupt
If the caller talks over the agent, stop playback and send the next turn with "interrupted":{"generation":"...","played":1}. Sentences not yet produced are discarded and the agent's memory keeps only what was played.
Agents answer from the business facts you give them. They do not give medical, legal or financial advice.