variables.
Base URL https://api.voice.miraiminds.co. All endpoints require
Authorization: Bearer sk_live_….
The agent object
Fields
Server-set and read-only:
id, object, created_at, updated_at.
Voice
voice.language is recorded, not yet appliedThe field is validated, stored and echoed back, and it travels with the call
payload — but the voice today renders in the agent’s top-level language. Set
both to the same value and you get what you expect; set them differently and the
top-level one wins until per-voice rendering ships.voice_id in the
console. See Voices.
Ending a call
The agent gets anend_call tool. When it fires, the agent speaks message and
hangs up.
Voicemail
Either way the call ends with
status: voicemail and fires a
call.voicemail event. Voicemail detection is
available on every tier — see the feature matrix.
Create an agent
- cURL
- Python
- Node.js
201 Created — the full agent object.
Get an agent
- cURL
- Python
- Node.js
200 OK — the agent object. 404 not_found if the agent was deleted, if
the ID does not exist, or if it exists in another workspace — all three answer
identically, so a 404 is never a hint that the ID is real. Never 403: that
status means your key has been revoked and nothing else. See
errors.
List agents
200 OK
GET /v2/agents/{id} returns, prompts included. There is no trimmed summary
form, so listing a page of agents with long prompts is a large response: page
with limit rather than pulling everything at once.
Deleted agents are excluded. See pagination.
Update an agent
end_call.message, send the whole end_call object.
- cURL
- Python
- Node.js
200 OK — the updated agent object.
Delete an agent
204 No Content.
The delete is soft: the agent stops appearing in GET /v2/agents and can no
longer be used for new calls, but historical calls keep resolving their
agent_id. Calls already in flight are not affected.
Writing a good prompt
The tier-1 product is a transactional call — one job, done in under two minutes. Prompts that work:- Name the job in the first line. “Confirm order
{{order_id}}. Nothing else.” - Cap reply length explicitly. “One or two short sentences.” Long turns are the single biggest driver of perceived latency.
- State the ending condition. “When the customer confirms or refuses, thank
them and call
end_call.” Without this the model keeps talking. - Put per-call data in
variables, not the prompt. One agent, thousands of calls, no re-create. - Write in the language you will speak. A Hindi call driven by an English prompt code-switches badly. Write the Hindi lines in Devanagari.
t3/t5 feature, see tiers.