AI voice agents inside web and mobile apps, over a WebSocket
For product teams who want a voice agent inside their own app rather than on a phone line: the same agents, engines, knowledge bases and appointment booking that answer phone calls, reached from a browser tab or a mobile app over wss://api.phone.wixzel.com/v1/realtime. Nothing to connect, no number to buy. Your server mints a single-use session so your API key never reaches the client, and the session spends the same prepaid balance per second as a call on the same engine.
Last updated
How it is built
- 01POST /v1/agents
Create the agent: prompt, opening line, knowledge base and a voice engine. It is the same agent a phone call would reach.
- 02POST /v1/realtime/sessions
From your server, with your API key: name the agent, optionally the allowed browser origins and your own metadata, and get back a client_secret that works once, for one minute, for that agent.
- 03wss://api.phone.wixzel.com/v1/realtime
Your client opens the socket with the secret and streams audio. In a browser, RealtimeSession from wixzel-phone/realtime handles the microphone, playback and barge-in; in Flutter, RealtimeConnection from the wixzel_phone package speaks the protocol and your app supplies the microphone and speaker.
- 04GET /v1/calls/{id}
Every session is a call record with channel web: transcript, duration, cost and your metadata, and the same callCompleted webhook when it ends.
The engine to use
gemini-live, $0.0466 per connected minute. One realtime model handles listening, thinking and speaking, so the round trip is what Gemini itself delivers and it is the cheapest engine per minute. The classic and sarvam pipelines run over the socket too; choose them when you need a specific voice or an Indian language.
What it costs
Engine time for 4-minute sessions on the gemini-live engine, at typical speech rates. There is no telephony cost, because there is no phone line; the meter charges per second, so shorter sessions cost proportionally less.
| Sessions per month | Connected minutes | Engine cost per month |
|---|---|---|
| 500 | 2,000 | $93.20 |
| 2,500 | 10,000 | $466 |
| 10,000 | 40,000 | $1,864 |
Prepaid: add credit from $5 and the sessions spend it. Estimate your own mix.
Frequently asked questions
- Can I put a Wixzel Phone voice agent in my website or mobile app?
- Yes. Your server calls POST /v1/realtime/sessions with your API key and receives a client_secret; your page or app opens wss://api.phone.wixzel.com/v1/realtime with it and streams audio both ways. The agent, engine, prompt and knowledge base are the same ones a phone call would use. No SIP trunk and no phone number are involved.
- Does my browser or app need my API key?
- No, and it must never have it. The client only ever holds a client_secret minted by your server, which works once, for one minute, for one agent. For browsers, pass allowed_origins when you mint it and the socket is refused from any other site, so a secret copied out of your page is useless elsewhere.
- Which SDKs support the realtime API?
- The TypeScript SDK (wixzel-phone on npm) ships a browser client, RealtimeSession, that asks for the microphone, encodes and plays audio and handles the user interrupting the agent. The Dart SDK (wixzel_phone on pub.dev) ships RealtimeConnection for Flutter and Dart, which speaks the protocol while your app supplies the microphone and speaker. Anything else uses the protocol directly: JSON frames over a WebSocket, with audio as base64 G.711 µ-law at 8 kHz.
- What audio quality do web and app sessions have?
- Phone quality. Audio is G.711 µ-law at 8 kHz in both directions, the same as a phone line, because the sessions run through the same media path as calls. That is fine for speech and a real limitation next to platforms whose browser audio is wideband; it is stated here rather than discovered later.
- How is a web or app session billed?
- Exactly like a phone call on the same engine: the same per-minute price, from the same prepaid balance, per second, itemised in GET /v1/usage/events. There is no telephony cost because there is no phone line. A session counts toward the account's concurrent-call limit, five by default. Minting a session costs nothing, so a user who opens your page and denies the microphone costs you nothing.
- How long can a session last?
- Ten minutes by default. Set max_duration_seconds when you mint the session, anywhere from 10 seconds to an hour, and the server ends the session at that point. The agent can also end it, and so can your client.
- Does it work in Flutter?
- Yes. The Dart SDK's RealtimeConnection handles the socket and the protocol. Your app records 16-bit PCM at 8 kHz with any recording plugin, converts it to µ-law with the helper the SDK provides, and plays the agent's audio back with any PCM player. Turn on echo cancellation, or the agent hears itself through the speaker.
Other uses
Build an agent that answers the phone, checks availability and books an appointment, over your own SIP trunk, with the booking written back through the API.
Upload leads, start a campaign, and have an agent call each one over your own SIP trunk, ask your qualifying questions, and record the outcome per lead.
Answer a support number with an agent that reads from a knowledge base you upload, handles the common questions, and leaves a transcript of every call.
Run phone agents in Indian languages on models built for them, with the sarvam engine covering speech-to-text, the language model and text-to-speech end to end.
Connect Claude Code, claude.ai, Claude Desktop, Cursor or any MCP client to your account, and let an AI agent connect a carrier, build a voice agent, place calls, run campaigns and read transcripts, with every tool that spends money asking first.
Operator, prices, limits, refunds and data location, on one page.
