Docs/API/Agents

Agents

The agent is the unit of voice behavior — system prompt, voice, model routing, and tools — referenced by the calls API.

The agent object

json
{
  "id": "agent_abc123",
  "object": "agent",
  "name": "Support Agent",
  "system_prompt": "You are a support agent...",
  "voice_id": "ember",
  "stt_model": "voxtral-realtime",
  "llm_model": "qwen3.5-4b",
  "tts_model": "qwen3-tts",
  "language": "en",
  "first_message": "Thanks for calling. How can I help?",
  "interruption_threshold": 0.5,
  "context_window": 20,
  "tools": [ {...} ],
  "phone_numbers": ["+14155559999"],
  "created": 1712345678
}

Create an agent

POST/v1/agents
namestringRequired

Human-readable name. Shown in the dashboard and logs.

system_promptstringRequired

Prompt that defines the agent's behavior. Supports {{variable}} placeholders populated from call context.

voice_idstringRequired

TTS voice. Use any built-in or custom voice id from /v1/voices.

llm_modelstringOptional

Override the default LLM model for this agent.

stt_modelstringOptional

Override the default STT model for this agent.

tts_modelstringOptional

Override the default TTS model for this agent.

languagestringOptional

Primary language; ISO 639-1.

first_messagestringOptional

Spoken at call start. Optional — defaults to letting the caller speak first.

interruption_thresholdnumberOptional

0–1. How much concurrent caller speech stops the agent mid-utterance. Default 0.5.

context_windowintegerOptional

How many prior turns to include in the LLM prompt. Default 10.

toolsTool[]Optional

Function schemas the agent may invoke. See the chat completions reference for the shape.

tool_urlstringOptional

HTTPS webhook that receives tool invocations. Required if tools is set.

phone_numbersstring[]Optional

E.164 numbers that should route inbound calls to this agent.

metadataobjectOptional

Up to 20 free-form key/value pairs.

Retrieve / list / update / delete

GET/v1/agents/{agent_id}
GET/v1/agents
PATCH/v1/agents/{agent_id}
DELETE/v1/agents/{agent_id}

PATCH accepts any create-body field and applies the diff. DELETE is permanent; existing calls are unaffected, but new inbound calls to the agent's numbers will fail.

List an agent's calls

GET/v1/agents/{agent_id}/calls

Query parameters: limit, cursor, status, created_after, created_before.