> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getbutter.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Agent

Create a new AI voice agent with specific configuration for STT, TTS, LLM, and behavior.

### Headers

<ParamField header="X-API-Key" type="string" required>
  Your API key for authentication.
</ParamField>

<ParamField header="X-Organization-Id" type="string" required>
  The organization ID.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`.
</ParamField>

### Permissions

* `agents:create` (admin, agent\_manager)

### Request Body

<ParamField body="agent_name" type="string" required>
  The name of the agent (1-100 characters).
</ParamField>

<ParamField body="stt_provider" type="string" required>
  Speech-to-Text provider (e.g., `deepgram`, `deepgram-nova-3`, `aws`).
</ParamField>

<ParamField body="tts_provider" type="string" required>
  Text-to-Speech provider (e.g., `elevenlabs`, `cartesia`, `deepgram`).
</ParamField>

<ParamField body="tts_voice" type="string" required>
  Voice ID for the selected TTS provider.
</ParamField>

<ParamField body="llm_provider" type="string" required>
  LLM provider (e.g., `openai`, `anthropic`, `google`).
</ParamField>

<ParamField body="llm_model" type="string" required>
  Model ID (e.g., `gpt-4o`, `gemini-2.5-flash-lite`).
</ParamField>

<ParamField body="system_prompt" type="string" required>
  The system prompt that defines the agent's persona and instructions (10-10000 characters).
</ParamField>

<ParamField body="language" type="string" default="EN">
  Primary language for the agent (e.g., `EN`, `ES`).
</ParamField>

<ParamField body="speak_first" type="boolean" default="false">
  Whether the agent should speak first when the call connects.
</ParamField>

<ParamField body="end_call_tool" type="boolean" default="false">
  Enable the built-in end call tool for the agent.
</ParamField>

<ParamField body="llm_temperature" type="number" default="0.7">
  Temperature setting for the LLM (0.0 to 2.0).
</ParamField>

<ParamField body="llm_fallback_provider" type="string">
  Fallback LLM provider when primary fails.
</ParamField>

<ParamField body="llm_fallback_model" type="string">
  Fallback LLM model when primary fails.
</ParamField>

<ParamField body="recording_enabled" type="boolean" default="false">
  Enable call recording for this agent.
</ParamField>

<ParamField body="voicemail_detection" type="boolean" default="false">
  Enable AMD (Answering Machine Detection).
</ParamField>

<ParamField body="voicemail_message" type="string">
  Message to leave if a voicemail is detected.
</ParamField>

<ParamField body="voicemail_response_delay" type="number" default="2.0">
  Delay in seconds before speaking the voicemail message (1.0-5.0).
</ParamField>

<ParamField body="custom_tools" type="array">
  List of custom tool IDs to attach to this agent.
</ParamField>

<ParamField body="kb_document_ids" type="array">
  List of knowledge base document IDs to attach to this agent.
</ParamField>

<ParamField body="assigned_phone_number_ids" type="array">
  List of phone number IDs to assign to this agent.
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Indicates if the request was successful.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable success message.
</ResponseField>

<ResponseField name="data" type="object">
  The created agent object (AgentData).
</ResponseField>

<RequestExample>
  ```json Request theme={null}
  {
    "agent_name": "Sales Rep",
    "stt_provider": "deepgram",
    "tts_provider": "elevenlabs",
    "tts_voice": "21m00Tcm4TlvDq8ikWAM",
    "llm_provider": "openai",
    "llm_model": "gpt-4o",
    "system_prompt": "You are a helpful sales representative...",
    "language": "EN",
    "speak_first": true,
    "recording_enabled": true
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "message": "Agent created successfully",
    "data": {
      "agent_id": "agent_a1b2c3d4e5f6",
      "agent_name": "Sales Rep",
      "language": "EN",
      "stt_provider": "deepgram",
      "tts_provider": "elevenlabs",
      "tts_voice": "21m00Tcm4TlvDq8ikWAM",
      "llm_provider": "openai",
      "llm_model": "gpt-4o",
      "system_prompt": "You are a helpful sales representative...",
      "speak_first": true,
      "end_call_tool": false,
      "llm_temperature": 0.7,
      "recording_enabled": true,
      "voicemail_detection": false,
      "voicemail_response_delay": 2.0,
      "custom_tools": [],
      "kb_document_ids": [],
      "assigned_phone_number_ids": [],
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    }
  }
  ```
</ResponseExample>
