Agents — client.agent
Agents define the LLM, STT, TTS, voice, and behavior of your voice AI. Create a draft, then publish() to make it callable.
create(**params) → AgentResponse
POST /v1/agents — create a new agent in draft state.
Only agent_name is required; everything else has a sensible default.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
agent_name | str | yes | — | Display name (1–255 chars). |
description | str | no | None | Internal description. |
agent_type | str | no | "orchestration_agent" | orchestration_agent (STT→LLM→TTS) or realtime_agent (speech-to-speech). |
agent_mode | str | no | "single_prompt" | single_prompt or conversation_flow. |
llm_provider | str | no | "openai" | openai, anthropic, groq, local_llm, ollama. |
llm_model | str | no | "gpt-4o" | Model name. |
system_prompt | str | no | "You are a helpful AI assistant." | Main instructions. |
greeting_message | str | no | None | First utterance; empty = agent waits for the user. |
temperature | float | no | 0.7 | 0–2. |
max_completion_tokens | int | no | 1024 | 1–8192. |
voice_provider | str | no | "elevenlabs" | elevenlabs, openai, deepgram, cartesia, kokoro. |
voice_id | str | no | "21m00Tcm4TlvDq8ikWAM" | Provider voice id. |
voice_speed | float | no | 1.0 | 0.5–2.0. |
stt_provider | str | no | "deepgram" | deepgram, google, azure. |
stt_model | str | no | "nova-2" | STT model. |
stt_multilingual | bool | no | False | Auto language detection. |
realtime_provider / realtime_model / realtime_voice | str | no | None | For realtime_agent types. |
language | str | no | "en-US" | BCP-47 tag (tr-TR, de-DE, …). |
interruption_sensitivity | float | no | 0.8 | 0–1. |
end_call_after_silence_ms | int | no | 60000 | Auto-end after silence. |
max_call_duration_ms | int | no | 600000 | Hard cap on call length. |
enable_sentiment_analysis | bool | no | None | None = org default. |
enable_summary_generation | bool | no | None | None = org default. |
knowledge_base_ids | List[str] | no | None | RAG knowledge bases to attach. |
webhook_url | str | no | None | Webhook for call events. |
mcp_config | dict | no | None | MCP server config (external tools). |
native_tools_config | dict | no | None | Built-in tools (end_call, transfer_to_human, agent_transfer, …). |
llm_base_url, llm_api_key, tts_model, volume, emotion, tts_base_url, tts_sample_rate, tts_use_websocket, stt_base_url, stt_api_key, voice_stability, responsiveness, endpointing_ms, enable_backchannel, response_delay_ms, reminder_trigger_ms, reminder_max_count, background_sound, analytics_prompt, analytics_model_provider, analytics_model, post_call_analysis_config, version_description.
Returns AgentResponse: agent_id, agent_name, description, is_published, published_version, agent_type, agent_mode, created_at, updated_at, versions (list of AgentVersion config snapshots), linked_workflows.
agent = client.agent.create(
agent_name="Reservations Bot",
agent_type="orchestration_agent",
llm_provider="openai", llm_model="gpt-4o",
voice_provider="elevenlabs", voice_id="21m00Tcm4TlvDq8ikWAM",
system_prompt="You take restaurant reservations. Be concise and friendly.",
language="en-US",
)
retrieve(agent_id) → AgentResponse
GET /v1/agents/{agent_id} — full agent including version history.
list(skip=0, limit=20) → list[AgentResponse]
GET /v1/agents — all agents in your organization.
update(agent_id, **params) → AgentResponse
PATCH /v1/agents/{agent_id} — change any field from create (all optional). Saves a new draft version; call publish() to go live.
publish(agent_id) → AgentResponse
POST /v1/agents/{agent_id}/publish — publish the current draft as a live version. Only published agents can take phone/web calls.
delete(agent_id) → None
DELETE /v1/agents/{agent_id} — permanently delete the agent and all versions.
get_versions(agent_id) → list[AgentVersion]
GET /v1/agents/{agent_id}/versions — full version history.
export(agent_id) → dict
GET /v1/agents/{agent_id}/export — portable JSON you can re-import.
import_agent(file_path) → AgentResponse
POST /v1/agents/import — create an agent from a previously exported JSON file.
Workflow linking
link_workflow(agent_id, workflow_id, trigger_condition_description=None, priority=0, execution_mode_override=None) → AgentWorkflowLinkResponseunlink_workflow(agent_id, workflow_id) → dictlist_workflows(agent_id) → list[AgentWorkflowListItem]