Skip to main content
POST
/
api
/
agent
/
create_new_agent
Create New Agent
curl --request POST \
  --url https://voiceagent.infers.co/api/agent/create_new_agent \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "initial_text": "Welcome to our service. I am an AI voice agent, how can I assist you today?",
  "prompt": "You are a virtual assistant speaking with Infer who can answer queries about any topic.",
  "llm_options": "openai",
  "responsiveness": 0.9,
  "voice_id": "Katy (female)",
  "voice_agent_expressiveness": 0.28,
  "telephony_providers": {
    "twilio_config": {
      "auth_token": "<TOKEN>",
      "account_sid": "<SID>",
      "standard_key_sid": "<STANDARD_KEY_SID>",
      "number": "+<COUNTRY_CODE><NUMBER>",
      "update_webhook": false,
      "record": true
    },
    "plivo_config": {
      "number": "+<COUNTRY_CODE><NUMBER>",
      "update_webhook": false,
      "record": true
    }
  },
  "re_engage_config": {
    "time": 15,
    "message": "I'\''m sorry... were you speaking? I didn'\''t hear anything. Are you still there?"
  },
  "filler_audio": {
    "noise": "typing-audio",
    "silence_threshold_seconds": 2
  },
  "actions": {
    "transfer_calls": {
      "number_dict": {
        "default": "<DEFAULT_PHONE_NUMBER>",
        "john": "<THIER_PHONE_NUMBER>"
      }
    },
    "hangup_call": true,
    "extract_data_from_call": {
      "fields_or_questions": [
        "Question 1",
        "Question 2"
      ]
    },
    "external_api_calls": [
      {
        "name": "action_post_products",
        "description": "Add a product with user provided details",
        "url": "https://fakestoreapi.com/products",
        "input_schema": "{\"type\": \"object\", \"properties\": {\"title\": {\"type\": \"string\"}, \"price\": {\"type\": \"number\"}, \"description\": {\"type\": \"string\"}, \"image\": {\"type\": \"string\", \"format\": \"uri\"}, \"category\": {\"type\": \"string\"}}}"
      },
      {
        "name": "action_get_products",
        "description": "Gather all product details",
        "url": "https://fakestoreapi.com/products",
        "input_schema": "{\"type\": \"object\", \"properties\": {}}"
      }
    ]
  },
  "keywords": {
    "keywords_to_include": [
      "systrom",
      "krieger"
    ]
  }
}'
{
  "voice_agent_id": "<string>",
  "inbound_webhook_url": "<string>",
  "agent_name": "<string>"
}

Authorizations

Authorization
string
header
required

API key for authentication. Email vaibhav@infer.so to get your API key

Body

application/json
voice_id
required

Select the voice for your voice agent and give it a character

Available options:
Jennifer (female),
Katy (female),
Alice (female),
Kayla (female),
Amanda (female),
Liz (female),
Alex (male),
Armand (male),
Dan (male),
Nevin (male),
Kale (male),
Jake (male),
tanya (female),
Dakota H,
John Beamer,
Mark (Young and Calm),
Alisha,
Vijay,
Jordan,
Raju,
Saanu,
Priya,
Sagar,
Monika Sogam,
Vikrant,
Vidhi
Examples:

"Alice (female)"

telephony_providers
object
required

A object containing your telephony provider information

agent_name
string
initial_text
default:""

If set, this will be the first greeting message that will be said by the voice agent. If unspecified, the voice agent will wait for the human to speak.

Note: Always end the initial text with a question, preferably the first question mentioned in the prompt.

Examples:

"Welcome to our service. I am an AI voice agent, how can I assist you today?"

prompt
default:You are a virtual assistant speaking with Infer who can answer queries about any topic.

If set, the voice agent will use this prompt to guide the conversation with the human. You can also use prompt templating with variables here like: You're a voice assistant called Infer talking to {customer_name}. You can pass in the values to the variables when initiating or receiving the call. If unspecified, it will use the default value.

Examples:

"You are a virtual assistant speaking with Infer who can answer queries about any topic."

llm_options
enum<string>
default:openai

Specifies the language model to be used by the voice agent. Options are 'openai' for OpenAI's language model and 'claude' for Anthropic's Claude model. Defaults to 'openai'.

Available options:
openai,
claude
responsiveness
number
default:0.2

Adjusts how quickly the agent will respond when human stops talking, with a value that can vary from 0.1 to 1. A higher value results in a less responsive agent, taking more time to respond. This is helpful in use cases where user takes lot of pauses to think and answer. Conversely, a lower value increases the agent's responsiveness, leading to quicker interactions and responses whenever possible. This is helpful in cases when you're expecting short responses from the human. If unspecified, it defaults to a value of 0, ensuring very quick agent responsiveness.

Required range: 0 < x <= 1
Examples:

0.2

voice_model
enum<string>
default:APEX

Select the voice model for your voice agent (Nexus for better quality but higher latency and Apex for faster response but lower quality)

Available options:
NEXUS,
APEX
Examples:

"APEX"

voice_agent_expressiveness
number
default:0.28

If set, the voice agent will use this value to determine how expressive its tone is. The lower the number, the more expressive the voice is but can also become highly unstable. Values between 0.24 to 0.40 recommended. If unspecified, it will use

Required range: 0 <= x <= 1
Examples:

0.28

event_webhook_url
string

Webhook URL to receive events related to the voice agent. This is optional and can be set later.

Examples:

"https://example.com/webhook"

custom_llm
object

If enabled will use a external URL for LLM calls

language
enum<string>
default:EN

Language of the bot

Available options:
EN,
HI,
te-IN
filler_audio
object

If enabled will use a external URL for LLM calls

re_engage_config
object
actions
object
keywords
object

Response

Successful Response

voice_agent_id
string
required

A unique Id for a voice agent

inbound_webhook_url
string
required

A webhook url for twilio

agent_name
string
required

Name of the agent