Skip to main content
POST
Create voice agent
The Create Voice Agent API allows you to create and configure AI voice agents with comprehensive settings including voice configuration, speech-to-text, LLM selection, and advanced call handling features.

API Endpoint

POST /create-agent Content-Type: application/json Authentication: Required (Token parameter)

Request Body

Required Fields

The voice object is optional — include it to configure TTS provider, voice ID, and voice settings.

Optional Fields

Basic Information

Voice Configuration

The voice object is optional and, if provided, contains the following properties:

Voice Providers

Voice Models

ElevenLabs Models

OpenAI Models

Sarvam Models

Cartesia Models

Amazon Polly Models

Smallest Models

Soniox Models

Azure Models

Voice Settings

The settings object contains fine-tuning parameters for voice output:

Speech-to-Text Configuration

The speech_to_text object configures the transcription service. Use full language names (not codes) for the language field — for example english, hindi, multi, spanish, etc. Supported values include:
  • english, hindi, multi, albanian, arabic, armenian, azerbaijani, belarusian, bengali, bosnian, bulgarian, catalan, chinese, croatian, czech, danish, dutch, english_australia, english_india, english_new_zealand, english_uk, english_us, english_spanish, estonian, finnish, french, galician, georgian, german, german_switzerland, greek, gujarati, haitian_creole, hausa, hebrew, afrikaans, hungarian, icelandic, indonesian, italian, japanese, javanese, kannada, kazakh, khmer, korean, latvian, lithuanian, macedonian, malay, malayalam, maori, marathi, nepali, norwegian, persian, polish, portuguese, portuguese_brazil, punjabi, romanian, russian, serbian, shona, slovak, slovenian, somali, spanish, spanish_latin_america, sundanese, swahili, swedish, tagalog, tamil, tajik, telugu, thai, tswana, turkish, ukrainian, urdu, vietnamese, welsh.
The speech_to_text object configures the transcription service:

STT Providers and Models

Deepgram (Provider: deepgram)

Gladia (Provider: gladia)

Sarvam (Provider: sarvam)

ElevenLabs (Provider: elevenLabs)

Cartesia (Provider: cartesia)

Soniox (Provider: soniox)

Azure (Provider: azure)

LLM Configuration

The llm object configures the language model:

Available LLM Models

Pass the provider name in llm.llm (e.g. openai) and the model’s Value in llm.model (e.g. gpt-4o). Each group below shows its provider name in the heading.

OpenAI Models (Provider: openai)

OpenAI Realtime Models

Meta LLaMA Models

Mistral Models

Other Models

Anthropic Models (Provider: anthropic)

Google Gemini Models (Provider: Gemini)

Azure OpenAI Models (Provider: azure)

Sarvam Models (Provider: sarvam)

AWS Bedrock Models (Provider: bedrock)

Cerebras Models (Provider: cerebras)

Grok Models (Provider: grok)

Configurations

The configurations object contains advanced call handling settings:

Confidence Threshold

Do Not Call Detection

Agent Terminate Call

Configuration for when the agent can end calls autonomously: Example:

Inactivity Handling

Configuration for handling user inactivity: Example:

Interruption Settings

Configuration for handling user interruptions: Sensitivity Levels:
  • 1 - Very low (agent rarely gets interrupted)
  • 2 - Low
  • 3 - Medium (Recommended)
  • 4 - High
  • 5 - Very high (agent easily interrupted)

Voicemail Handling

Configuration for voicemail detection and handling: Example:

Response

Success Response

Status Code: 200 OK

Error Responses

400 - Bad Request

Common causes:
  • Missing required fields (agent_name, prompt, or voice)
  • Invalid data types
  • Invalid provider or model values

401 - Unauthorized

Common causes:
  • Missing authorization header or token parameter
  • Invalid or expired API key
  • Insufficient permissions

422 - Validation Error

Common causes:
  • Invalid enum values (provider, model names)
  • Out of range values (stability, speed, confidence_threshold)
  • Invalid format (timezone, language codes)

500 - Internal Server Error

Example Requests

Minimal Request

Complete Request with All Features

Important Notes

  1. Required Fields: Only agent_name and prompt are required. The voice object is optional — include voice (with provider and voice_id) when you want to configure TTS for the agent. All other fields are optional.
  2. Voice IDs: Get available voice IDs from the List Voices API.
  3. Webhooks: If you provide a session_data_webhook, ensure your endpoint can handle POST requests with session data.
  4. Timezones: Use standard timezone strings (e.g., “America/New_York”, “Europe/London”, “Asia/Tokyo”).
  5. Language Names: Use full language names (e.g., english, hindi, spanish) or region-specific variants (e.g., english_us, english_uk) as shown in the Speech-to-Text section above.
  6. Model Compatibility: Ensure the voice model is compatible with your chosen provider. For example, eleven_turbo_v2_5 only works with ElevenLabs.
  7. Rate Limits: API calls are subject to rate limiting based on your plan. See pricing documentation for details.
  8. Testing: After creating an agent, test it thoroughly before using in production. Use the Make Call API to test your agent.
  9. Attaching phone numbers is necessary to place calls via agents

Headers

token
string
required

API token for authentication

Body

application/json
agent_id
integer
agent_name
string
description
string
prompt
string
timezone
string
greeting
string
session_data_webhook
string
voice
object
speech_to_text
object
llm
object
configurations
object

Response

201

Created