Start building
Voice AI APIs for developers building in India
Mirai has four ways in. The voice-agent API places and answers phone calls for you. The Realtime API takes your caller's audio and returns the agent's spoken reply. Mira TTS turns text into Hindi, Hinglish or English speech, and offline transcription turns recordings into text. Start with the one that covers the part of the call you don't want to build yourself.
Which API should you start with?
Mirai is a voice infrastructure company: it builds its own speech synthesis, speech recognition and language models and offers them as APIs, with voice agents on top. Voice agents run from ₹1 a minute at volume (T1, with a ₹1,00,000 monthly commitment) and ₹5 a minute pay as you go (T5). Pick the API by asking which part of the call you want to own. Each of these uses the same sk_live_ key and draws on the same prepaid wallet.
| Your application needs | Start with | What your team still owns |
|---|---|---|
| An agent that rings customers, or answers your number | Voice-agent API (/v2/agents, /v2/calls, /v2/campaigns) |
The prompt, the customer data you pass in, and what happens after the call |
| Your own app or Pipecat bot, with Mirai doing recognition, the model and speech | Realtime API (OpenAI Realtime protocol over WebSocket) | Audio transport, tools and session settings |
| Hindi or Hinglish speech from text | Mira TTS (/v1/audio/speech and a streaming WebSocket) |
Text generation, playback and the conversation itself |
| Transcripts of calls that already happened | Offline transcription (/v2/transcriptions) |
Storage and review of the transcripts |
Streaming speech recognition runs inside every voice agent and every Realtime session. As a standalone API it is in private preview, so ask Mirai for access before you design around it. The docs list per-token LLM pricing, and say to contact Mirai to activate an LLM plan.
The agent API takes Hindi, English and the Hinglish most real calls are spoken in. There are four voices today: ashu, neha, shruti and sameer.
How does a phone call work through the API?
A call is an asynchronous job. You create an agent once, then ask for calls against it. POST /v2/calls answers 202 Accepted with a call ID and status: "queued". At that point the phone has not rung. The outcome arrives later as signed webhooks.
- Open the sandbox and create a key under Developers. You get a secret key, shown once, and a
whsec_webhook secret. Keep both on your server. - Create an agent with
POST /v2/agents: a name, a system prompt, an opening line, a voice and a language such ashi-IN. - Place a call with
POST /v2/calls. Send anIdempotency-Keyderived from your own record, so a retried request never rings the customer twice. - Save the call ID against your own job before you return from that request. A webhook can arrive while it is still in flight.
- Verify each webhook’s
X-Mirai-Signatureover the raw body, dedupe on the eventid, and update your records from the terminal event.
The Python phone-call guide walks through those requests with runnable code, and the webhook guide covers the receiver. To dial a whole list instead of one number, use campaigns. For the business side of AI calling, see AI calling.
Every request in the docs goes to https://sandbox.voice.miraiminds.co. Until your company completes Go live in the console, calls are billed at T5. After that you send the same requests to https://prod.voice.miraiminds.co. A key from a workspace that has not gone live gets 403 production_workspace_required there.
What should you test for Indian callers?
Test the speech your callers produce. A Hindi sentence with an English product name, a spoken amount and a local address is a harder test than a clean English demo. Include a caller who corrects a digit halfway through and one who talks over the agent, and listen on a real handset as well as the browser web phone, because carrier audio sounds different.
Write the prompt in the language the call will be in, with Hindi in Devanagari and English words in Latin script. The prompting guide explains why numbers and amounts should be written out as words.
For speech quality checks, use the Hindi TTS guide. For timing, use the latency guide.
Where does the data go?
Per the docs, media runs in India: audio, speech recognition, speech synthesis and the model. Workflow orchestration and the API run in Europe and stay off the audio path. In a Realtime session, if one of Mirai’s own steps is unavailable, that step moves to a third-party fallback and the turn’s metadata says so.
That covers Mirai’s side. The finished application also includes your telephony provider if you bring one, your storage and analytics, and any tools the agent calls. Call recordings and transcripts are kept for 90 days, so copy anything you need for longer into your own systems.
What belongs in a production acceptance test?
Follow one complete job from start to finish. Can the caller understand the opening line? Does the agent recover when an order number is corrected? Does your backend receive the final event and match it to the right record? Can you reconcile a job whose webhook was delayed, using GET /v2/calls?
Keep call completion separate from task completion. status: "completed" means the conversation connected and ended normally. Whether the customer confirmed the order is a separate question, which you can answer from post-call analysis or your own review. When a call goes wrong, GET /v2/agents/{id}/logs lists tool errors, tools the model asked for that the agent doesn’t have, and the variables each call received.
Before you forecast spend, read the pricing guide or see pricing. To decide how much of the stack to own, compare integrated and assembled stacks.
Common questions
Does Mirai provide a complete voice-agent API or only text to speech?
Both, plus two more. The voice-agent API runs whole phone and browser calls. The Realtime API runs speech recognition, the model and speech on Mirai's side for audio you stream in. Mira TTS and offline transcription are available as standalone APIs with the same sk_live_ key.
Can I use Mira TTS without moving my whole voice stack?
Yes. Mira TTS speaks the OpenAI POST /v1/audio/speech protocol, so you change the base URL and the model name and keep your own recognition, model and orchestration. There is also a WebSocket endpoint and a Pipecat package.
Do I need an access code to try it?
No. The sandbox opens without signing up. The first time you create a key, an agent or a test, the console asks for your work email, and confirming it gives the workspace ₹200 of starter credit billed at T5. An access code still works if Mirai gave you one.
Where does the audio get processed?
The docs say media (audio, speech recognition, speech synthesis and the model) runs in India, and the control plane that runs orchestration and the API runs in Europe, off the audio path. Map the services you add yourself, such as storage, analytics and your own tools, separately.
Sources and API references
References reviewed on . Measurement dates and experimental limits are stated in the article. Check current API and runtime documentation when integrating.