Skip to main content
An agent is the reusable configuration a call runs: what it says first, how it behaves, which voice, which language, and when it must stop. Calls reference an agent by ID; per-call differences go in 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.
Hear the catalogue and pick a voice_id in the console. See Voices.

Ending a call

The agent gets an end_call tool. When it fires, the agent speaks message and hangs up.
Only message is enforced todayenabled and confirm are validated, stored, echoed back and carried into the call payload, but the agent currently reads only end_call.message. Until the worker picks the other two up, assume the tool is available and confirmation behaves at its default. Set them now — they take effect without any change on your side.
Leave confirm: true unless you are running a one-turn notification. It costs one extra turn in the rare case and prevents the far more expensive failure of hanging up on a customer mid-sentence.

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

201 Created — the full agent object.

Get an agent

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
Each element is the full agent object — the same shape 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

Send only the fields you are changing. Nested objects are replaced wholesale — to change end_call.message, send the whole end_call object.
200 OK — the updated agent object.
An update takes effect on the next call. Calls already queued, dialing or in_progress keep the configuration they were created with.

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.
Prompts that cause trouble: multi-branch scripts (“if they say X, then go through the following seven questions”), instructions that assume the model remembers a previous call, and anything that needs a database lookup mid-call — that is a t3/t5 feature, see tiers.