Skip to content
VoiceMint Developers

Build an agent

Create a voice and chat agent with instructions, a model, a voice and a greeting, then test it in chat.

An agent is a set of instructions, a language model, a voice, optional knowledge and tools. The same agent answers phone calls, runs campaigns, chats on your website and WhatsApp, and talks live in your app. Keys need agents.write to create or change agents (agents.read to list them).

Create an agent#

curl -X POST https://api.voicemint.io/api/v1/agents \
  -H "Authorization: Bearer $VOICEMINT_API_KEY" -H "Content-Type: application/json" \
  -d '{
    "name": "Support bot",
    "instructions": "You answer questions about Acme orders. Be brief. Hindi or English, as the caller prefers.",
    "greeting": "Namaste! Acme support here. How can I help?",
    "default_language": "hi-IN",
    "status": "active"
  }'

Other fields: llm ({provider, model, temperature}; GET /agents/models lists the choices), voice (provider and voice id), knowledge_base_ids, tools, call_settings (recording, post-call summary and sentiment, voicemail detection) and tags. GET /agents/templates has ready-made agents to start from.

Test it in chat#

curl -X POST https://api.voicemint.io/api/v1/agents/AGENT_ID/chat \
  -H "Authorization: Bearer $VOICEMINT_API_KEY" -H "Content-Type: application/json" \
  -d '{"message": "Where is my order A-77?"}'

Pass session_id to continue a conversation. GET /agents/{id}/sessions and GET /agents/sessions/{session_id}/messages read past conversations.

Variables in prompts#

Instructions and greetings can contain {placeholders} filled per call or session: {name}, {order.id} (dot path), or {{name}}. Values come from a campaign's CSV columns, variables on a single call or live session, and these always-available values: {from_number}, {to_number}, {call_id}, {current_date}, {current_time}, {timezone}. A placeholder with no value is left as written.

Versions#

Every saved change makes a new version; GET /agents/{id}/versions lists them. Phone numbers can pin an agent version, and A/B experiments can compare versions.

Next#

Knowledge · Tools · Phone calls · Live voice in apps