Skip to main content
POST
/
v1
/
public
/
agents
curl --request POST \
  --url https://api.eigi.ai/v1/public/agents \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "agent_name": "Support Agent",
  "agent_type": "INBOUND",
  "agent_category": "Customer Service",
  "stt": {
    "provider_name": "DEEPGRAM",
    "model_name": "nova-2",
    "language": "en",
    "params": {}
  },
  "llm": {
    "provider_name": "OPENAI",
    "model_name": "gpt-4o",
    "params": {
      "temperature": 0.7
    }
  },
  "tts": {
    "provider_name": "CARTESIA",
    "model_name": "sonic-2",
    "language": "en",
    "voice_id": "a0e99841-438c-4a64-b679-ae501e7d6091",
    "params": {
      "speed": 1
    }
  },
  "prompt_content": "You are a helpful customer support agent.",
  "call_analysis_enabled": true,
  "call_analysis_prompt": {
    "prompt_name": "support_call_analysis",
    "custom_prompt": "Analyze the call outcome, customer sentiment, and follow-up actions."
  },
  "call_analysis_schema": {
    "call_outcome": {
      "type": "str"
    },
    "customer_sentiment": {
      "type": "str"
    },
    "follow_up_required": {
      "type": "bool"
    }
  },
  "first_message_prompt": "Hello! How can I help you today?",
  "tools": {
    "end_call": true,
    "transfer_call": {
      "transfer_phone_number": "+919876543210"
    }
  }
}
'
{
  "id": "<string>",
  "agent_name": "<string>",
  "agent_description": "<string>",
  "agent_category": "<string>",
  "agent_tips": [
    "<string>"
  ],
  "agent_mobile_number": [
    "<string>"
  ],
  "stt": {},
  "llm": {},
  "tts": {},
  "sts": {},
  "call_analysis_enabled": true,
  "prompt": {
    "prompt_name": "<string>",
    "prompt_version": 123,
    "prompt_content": "<string>"
  },
  "first_message_prompt": "<string>",
  "dynamic_variables": [
    "<string>"
  ],
  "tools": {},
  "widget_config": {},
  "MediaFiles": [
    {
      "fileType": "<string>",
      "mediaUrl": "<string>"
    }
  ],
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}
{
"detail": "<string>"
}
{
"detail": "<string>"
}
{
"detail": "<string>"
}
{
"detail": "<string>"
}

Overview

Create a new AI agent with full configuration including speech-to-text (STT), speech-to-speech (STS), large language model (LLM), text-to-speech (TTS), main prompt, call analysis prompt, tools, and widget settings.

Prompt Configuration

You can configure the agent’s prompt in two ways:
  1. Inline prompt (prompt_content) — Provide the prompt text directly. An internal prompt is auto-created for the agent.
  2. Prompt reference (prompt) — Reference an existing prompt by name and optionally version.

Call Analysis Configuration

You can optionally configure a dedicated call analysis prompt and schema:
  1. Enable analysis (call_analysis_enabled) — Set this to true only when you want call analysis to run.
  2. Analysis prompt reference (call_analysis_prompt) — Reference an existing analysis prompt by name and optionally version.
  3. Inline analysis prompt (call_analysis_prompt.custom_prompt) — Provide prompt content directly to create a new analysis prompt version before linking it to the agent.
  4. Structured output schema (call_analysis_schema) — Define the expected JSON structure for call analysis output.
If you do not want call analysis, omit call_analysis_enabled, call_analysis_prompt, and call_analysis_schema. If call_analysis_enabled is true, provide call_analysis_prompt as well.

Try It Behavior

In Try it, llm is shown as a single object.
  • For standard providers, fill llm.params.temperature only.
  • For CUSTOM_LLM, fill llm.params.base_url, llm.params.api_key, and optionally llm.params.API_TYPE.

Provider Restrictions (Public API)

ProviderAllowed params
STTNo params allowed (must be empty {})
STSNo public API param restrictions
LLMStandard providers: only temperature (0.0 - 2.0). CUSTOM_LLM: requires base_url plus api_key; optional API_TYPE and temperature
TTSOnly speed

Authentication

X-API-Key
string
required
Your eigi.ai API key. Must be prefixed with vk_.

Request Body

agent_name
string
required
Agent name (1-100 characters).
agent_type
string
required
Agent type: INBOUND or OUTBOUND.
stt
object
required
Speech-to-Text configuration.
llm
object
required
Large Language Model configuration.
tts
object
required
Text-to-Speech configuration.
sts
object
Speech-to-Speech configuration for realtime voice generation.
agent_description
string
Agent description (max 500 characters).
agent_category
string
default:"other"
Agent category (e.g., Customer Service, Sales, Healthcare, etc.).
agent_tips
array
Array of usage tip strings for the agent.
agent_mobile_number
array
Mobile numbers to associate with the agent.
prompt_content
string
Inline prompt content. Auto-creates an internal prompt for the agent.
prompt
object
Reference to an existing prompt (alternative to prompt_content).
call_analysis_prompt
object
Optional call analysis prompt configuration.
call_analysis_enabled
boolean
Toggle call analysis on or off for the agent. Set this to true only when you want call analysis to run. If true, provide call_analysis_prompt as well.
call_analysis_schema
object
Optional schema describing the structured JSON output expected from call analysis.
first_message_prompt
string
Agent’s greeting message displayed when a chat session starts.
tools
object
Configure agent tools. Each tool can be true (enable), false (disable), or an object with configuration.Available tools: end_call, transfer_call, schedule_call, set_language, background_audio, user_idle.
widget_config
object
Widget configuration for chat interface customization.

Response

Returns the complete agent object with all configurations, id, and timestamps.

Authorizations

X-API-Key
string
header
required

API key for authentication. Get your API key from the eigi.ai Dashboard under Settings → API Keys.

Body

application/json
agent_name
string
required

Agent name (1-100 characters)

Required string length: 1 - 100
Example:

"Customer Support Agent"

agent_type
enum<string>
required

Agent type

Available options:
INBOUND,
OUTBOUND
stt
object
required
llm
object
required

LLM configuration. Use provider_name to choose a standard provider or CUSTOM_LLM. For standard providers, only params.temperature applies. For CUSTOM_LLM, use params.base_url, params.api_key, and optional params.API_TYPE.

tts
object
required
agent_description
string

Agent description (max 500 characters)

Maximum string length: 500
agent_category
enum<string>
default:other

Agent category

Available options:
Customer Service,
Sales,
Scheduling,
Research,
Healthcare,
Customer Success,
Education,
Finance,
HR,
Legal,
Productivity,
Creative,
IT/DevOps,
E-commerce,
Entertainment,
Travel,
Wellness,
Anime,
Cartoon,
Gaming,
Lifestyle,
other
agent_tips
string[]

Usage tips for the agent

agent_mobile_number
string[]

Mobile numbers associated with the agent

call_analysis_prompt
object

Optional call analysis prompt reference. Provide custom_prompt to create a new analysis prompt version before linking it to the agent.

call_analysis_enabled
boolean

Toggle call analysis on or off for the agent. Set to true only when you want call analysis to run; when true, provide call_analysis_prompt as well.

call_analysis_schema
object

Optional schema for structured call analysis output, keyed by field name.

Example:
{
"summary": { "type": "str" },
"customer_intent": { "type": "Optional[str]" },
"follow_up_required": { "type": "bool" }
}
prompt_content
string

Inline prompt content — auto-creates an internal prompt for the agent

prompt
object

Reference to an existing prompt (alternative to prompt_content)

first_message_prompt
string

Agent's greeting message shown when chat starts

tools
object

Configure agent tools. Each tool can be true (enable), false (disable), or an object with configuration.

widget_config
object

Widget configuration for chat interface customization

Response

Agent created successfully

id
string

Agent ID

agent_name
string

Agent name

agent_description
string

Agent description

agent_type
enum<string>

Agent type

Available options:
INBOUND,
OUTBOUND
agent_category
string

Agent category

agent_tips
string[]

Usage tips

agent_mobile_number
string[]

Associated mobile numbers

stt
object

STT configuration

llm
object

LLM configuration

tts
object

TTS configuration

sts
object

STS configuration (if set)

call_analysis_enabled
boolean

Whether call analysis is enabled for the agent

prompt
object

Prompt reference

first_message_prompt
string

Agent's greeting message

dynamic_variables
string[]

Dynamic variables in the prompt

tools
object

Configured tools

widget_config
object

Widget configuration

MediaFiles
object[]

Media files associated with the agent

created_at
string<date-time>

Creation timestamp

updated_at
string<date-time>

Last update timestamp