Create Agent
Create a new AI voice agent with a custom voice, LLM, prompt, and telephony settings.
When to use this
Use this endpoint to programmatically create agents as part of your onboarding flow, template system, or multi-tenant setup. For example, if each of your customers needs their own agent pre-configured with their business details, this lets you spin them up automatically.Key fields
pipeline_type: UseCascadedfor the standard STT, LLM, and TTS pipeline. UseSpeech_To_Speechfor realtime speech models such as GPT realtime.prompts.prompt_text: The system prompt that shapes the agent’s personality, instructions, and scope. Write it clearly; the LLM follows this closely.voice: Pass a voiceidfrom List Voices, or configure it inline.speech.transcriber_id: Selects the primary STT provider for cascaded agents. Speech to Speech agents do not use a separate transcriber.speech.fallback_stt_enabled: Enables a backup STT provider for cascaded agents. When enabled, also sendspeech.stt_fallback_transcriber_id.speech.audio_cache_enabled: Caches repeated TTS phrases for lower latency on cascaded agents. Speech to Speech agents do not use TTS audio cache.telephony.call_limits: Set how long a call can run, how long to wait before ending on silence, and how long to ring before giving up.functions: Tools the agent can invoke mid-call, such as calendar booking, CRM lookups, or custom webhooks.analysis.postcall_analysis: Fields to extract from the transcript after each call (e.g., CSAT score, intent, outcome).metadatavia dynamic variables: You can reference{{variable_name}}in your prompt; values are injected at call time from the call’smetadataobject.
Pipeline Types
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
RSA encrypted organization ID (base64 format)
"BASE64_ENCRYPTED_ORG_ID_HERE"
Body
Grouped request body. Fallback LLM: set llm.fallback.fallback_llm_enabled and llm.fallback.llm_fallback_model (or fall_back_llm_id). PCA: set analysis.postcall_analysis with field_name, field_type, field_description, and optional additional_fields.
"Customer Support Agent"
Enable fallback LLM (flat alias; prefer llm.fallback.fallback_llm_enabled)
false
Fallback LLM id (flat alias; prefer llm.fallback.llm_fallback_model)
"abc123xyz789ab"
Fallback delay ms (flat alias; prefer llm.fallback.llm_fallback_delay_ms)
500
Post-call analysis (PCA) fields for the agent version
Response
Agent created; current_version includes llm.fallback and flat fallback fields
0
false
false
"llm_abc123xyz789ab"
"llm_abc123xyz789ab"
500
"tr0deepnova3xx"