Skip to content
Wixzel Voice
Web and mobile apps

Voice agent API for web and mobile apps

Adding a voice agent to an app usually means buying a phone number you do not need, or joining speech-to-text, a model and a voice yourself while keeping the API keys off the device. 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.voice.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

A phone app screen with a large green mascot, a greeting in a speech bubble above it, and a Talk button below

How do you build a voice agent for a web or mobile app with Wixzel Voice?

  1. 01
    POST /v1/agents

    Create the agent: prompt, opening line, knowledge base and a voice engine. It is the same agent a phone call would reach.

  2. 02
    POST /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.

  3. 03
    wss://api.voice.wixzel.com/v1/realtime

    Your client opens the socket with the secret and streams audio. In a browser, RealtimeSession from wixzel-voice/realtime handles the microphone, playback and barge-in; in Flutter, RealtimeConnection from the wixzel_voice package speaks the protocol and your app supplies the microphone and speaker.

  4. 04
    GET /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.

  5. 05
    wixzel-voice/mascot, wixzel_voice_flutter

    Optional: show the agent's mascot, its animated face, while it talks. In a web page, mountMascot from wixzel-voice/mascot draws it and face.connect(session) runs the call with the mouth in sync. In Flutter, AgentMascotView from the wixzel_voice_flutter package draws it and MascotRealtimeLink keeps it in step with a RealtimeConnection.

Which voice engine fits a voice agent in a web or mobile app?

Use the gemini-live engine on Wixzel Voice, at $0.0491 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 sarvam pipeline runs over the socket too, for Indian languages, and so does classic when you need a specific ElevenLabs voice.

What does a voice agent in a web or mobile app cost on Wixzel Voice?

Wixzel Voice engine time for 4-minute sessions on the gemini-live engine, at typical speech rates, billed per second of actual usage. There is no telephony cost, because there is no phone line, so shorter sessions cost proportionally less.

Sessions per monthConnected minutesEngine cost per month
5002,000$98.20
2,50010,000$491
10,00040,000$1,964

Prepaid: add credit from $5 and the sessions spend it. Estimate your own mix.

Which guides show how to build a voice agent for a web or mobile app on Wixzel Voice?

Frequently asked questions

Can I put a voice agent built on Wixzel Voice 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.voice.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-voice 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_voice 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.

Can my app show the agent's face while it talks?

Yes. Every Wixzel Voice agent has a mascot, an animated face drawn from a small spec in the agent's mascot field. In a web page, mountMascot from wixzel-voice/mascot (wixzel-voice 0.10.0 on npm) draws it on a canvas, and face.connect(session) starts the realtime call with the mouth moving in time with the agent's audio. In Flutter, the wixzel_voice_flutter package on pub.dev has AgentMascotView to draw it and MascotRealtimeLink to make it listen, think and talk along with a RealtimeConnection. Neither records or plays audio for you in Flutter; the web helper does both.

Is there a version that needs no code at all?

Yes, for websites: the mascot widget. Turn it on for the agent, list your site in embed_origins and paste one script tag, and visitors can call the agent from the corner of the page. It uses the same realtime API underneath and is billed the same way. See the AI voice assistant for your website.

What else do agencies and developers build on Wixzel Voice?

Appointment booking

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.

Outbound lead qualification

Upload leads, start a campaign, and have an agent call each one over your own SIP trunk and ask your qualifying questions. Every call is a record with its status and transcript, linked to the lead.

Inbound support line

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.

Indian languages

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.

Website voice assistant

Put a talking AI assistant on your website with one script tag: an agent made from your site, with an animated mascot visitors call from the browser, caller details, who-can-call settings and daily caps.

Phone calls from AI agents

Connect Claude Code, Codex, 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.

Low-cost AI calling

Run AI phone calls for a few cents a minute: per-second billing from prepaid credit, no subscription or minimum, your own SIP trunk with no telephony markup, and every charge itemised.

Talking AI avatar

Give a voice agent a face: an animated avatar that lip-syncs to the agent, for a website, a share link, a web app or a Flutter app, with no fee for the avatar.

For agencies

Build a phone agent for each client on their own account and carrier, in their language, and charge a retainer on a cost billed per second.

All Wixzel Voice facts

Operator, prices, limits, refunds and data location, on one page.

Build your first voice agent