curl --request POST \
--url https://api.example.com/v2/ai-agents/ \
--header 'Content-Type: application/json' \
--data '
{
"agent_name": "<string>",
"llm": {
"llm_type": "simple",
"model_name": "<string>",
"system_prompt": "<string>",
"model_temperature": 0,
"required_dynamic_data": [
"<string>"
],
"tools": [
{}
],
"llm_name": "<string>",
"llm_description": "<string>",
"base_url": "<string>",
"api_key": "<string>",
"max_token": 123
},
"tts": {
"voice_id": "<string>",
"provider": "elevenlabs",
"voice_name": "<string>",
"voice_temperature": 0.2
},
"stt": {
"provider": "deepgram"
},
"language_code": "en-US",
"knowledge_base_id": "<string>",
"enable_user_interruptions": true,
"minimum_speech_duration_for_interruptions": 0.5,
"minimum_words_before_interruption": 0,
"wait_time_before_detecting_end_of_speech": 0.5,
"ambient_sound": "none",
"ambient_sound_volume": 1,
"webhook_url": "<string>",
"end_call_after_silence_seconds": 10,
"max_call_duration_seconds": 1800,
"welcome_message": "<string>",
"voicemail_detection_timeout_seconds": 90,
"dynamic_data_config": [
{
"url": "<string>",
"response_data": [
{
"name": "<string>",
"data": "<string>",
"context": "<string>"
}
],
"method": "GET",
"timeout": 2000,
"headers": {},
"body": {},
"query": {},
"cache": true
}
],
"post_call_analysis": [
{
"name": "<string>",
"description": "<string>",
"system_prompt": "<string>",
"type": "string",
"examples": [
"<string>"
]
}
]
}
'import requests
url = "https://api.example.com/v2/ai-agents/"
payload = {
"agent_name": "<string>",
"llm": {
"llm_type": "simple",
"model_name": "<string>",
"system_prompt": "<string>",
"model_temperature": 0,
"required_dynamic_data": ["<string>"],
"tools": [{}],
"llm_name": "<string>",
"llm_description": "<string>",
"base_url": "<string>",
"api_key": "<string>",
"max_token": 123
},
"tts": {
"voice_id": "<string>",
"provider": "elevenlabs",
"voice_name": "<string>",
"voice_temperature": 0.2
},
"stt": { "provider": "deepgram" },
"language_code": "en-US",
"knowledge_base_id": "<string>",
"enable_user_interruptions": True,
"minimum_speech_duration_for_interruptions": 0.5,
"minimum_words_before_interruption": 0,
"wait_time_before_detecting_end_of_speech": 0.5,
"ambient_sound": "none",
"ambient_sound_volume": 1,
"webhook_url": "<string>",
"end_call_after_silence_seconds": 10,
"max_call_duration_seconds": 1800,
"welcome_message": "<string>",
"voicemail_detection_timeout_seconds": 90,
"dynamic_data_config": [
{
"url": "<string>",
"response_data": [
{
"name": "<string>",
"data": "<string>",
"context": "<string>"
}
],
"method": "GET",
"timeout": 2000,
"headers": {},
"body": {},
"query": {},
"cache": True
}
],
"post_call_analysis": [
{
"name": "<string>",
"description": "<string>",
"system_prompt": "<string>",
"type": "string",
"examples": ["<string>"]
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
agent_name: '<string>',
llm: {
llm_type: 'simple',
model_name: '<string>',
system_prompt: '<string>',
model_temperature: 0,
required_dynamic_data: ['<string>'],
tools: [{}],
llm_name: '<string>',
llm_description: '<string>',
base_url: '<string>',
api_key: '<string>',
max_token: 123
},
tts: {
voice_id: '<string>',
provider: 'elevenlabs',
voice_name: '<string>',
voice_temperature: 0.2
},
stt: {provider: 'deepgram'},
language_code: 'en-US',
knowledge_base_id: '<string>',
enable_user_interruptions: true,
minimum_speech_duration_for_interruptions: 0.5,
minimum_words_before_interruption: 0,
wait_time_before_detecting_end_of_speech: 0.5,
ambient_sound: 'none',
ambient_sound_volume: 1,
webhook_url: '<string>',
end_call_after_silence_seconds: 10,
max_call_duration_seconds: 1800,
welcome_message: '<string>',
voicemail_detection_timeout_seconds: 90,
dynamic_data_config: [
{
url: '<string>',
response_data: [{name: '<string>', data: '<string>', context: '<string>'}],
method: 'GET',
timeout: 2000,
headers: {},
body: JSON.stringify({}),
query: {},
cache: true
}
],
post_call_analysis: [
{
name: '<string>',
description: '<string>',
system_prompt: '<string>',
type: 'string',
examples: ['<string>']
}
]
})
};
fetch('https://api.example.com/v2/ai-agents/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v2/ai-agents/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_name' => '<string>',
'llm' => [
'llm_type' => 'simple',
'model_name' => '<string>',
'system_prompt' => '<string>',
'model_temperature' => 0,
'required_dynamic_data' => [
'<string>'
],
'tools' => [
[
]
],
'llm_name' => '<string>',
'llm_description' => '<string>',
'base_url' => '<string>',
'api_key' => '<string>',
'max_token' => 123
],
'tts' => [
'voice_id' => '<string>',
'provider' => 'elevenlabs',
'voice_name' => '<string>',
'voice_temperature' => 0.2
],
'stt' => [
'provider' => 'deepgram'
],
'language_code' => 'en-US',
'knowledge_base_id' => '<string>',
'enable_user_interruptions' => true,
'minimum_speech_duration_for_interruptions' => 0.5,
'minimum_words_before_interruption' => 0,
'wait_time_before_detecting_end_of_speech' => 0.5,
'ambient_sound' => 'none',
'ambient_sound_volume' => 1,
'webhook_url' => '<string>',
'end_call_after_silence_seconds' => 10,
'max_call_duration_seconds' => 1800,
'welcome_message' => '<string>',
'voicemail_detection_timeout_seconds' => 90,
'dynamic_data_config' => [
[
'url' => '<string>',
'response_data' => [
[
'name' => '<string>',
'data' => '<string>',
'context' => '<string>'
]
],
'method' => 'GET',
'timeout' => 2000,
'headers' => [
],
'body' => [
],
'query' => [
],
'cache' => true
]
],
'post_call_analysis' => [
[
'name' => '<string>',
'description' => '<string>',
'system_prompt' => '<string>',
'type' => 'string',
'examples' => [
'<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v2/ai-agents/"
payload := strings.NewReader("{\n \"agent_name\": \"<string>\",\n \"llm\": {\n \"llm_type\": \"simple\",\n \"model_name\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"model_temperature\": 0,\n \"required_dynamic_data\": [\n \"<string>\"\n ],\n \"tools\": [\n {}\n ],\n \"llm_name\": \"<string>\",\n \"llm_description\": \"<string>\",\n \"base_url\": \"<string>\",\n \"api_key\": \"<string>\",\n \"max_token\": 123\n },\n \"tts\": {\n \"voice_id\": \"<string>\",\n \"provider\": \"elevenlabs\",\n \"voice_name\": \"<string>\",\n \"voice_temperature\": 0.2\n },\n \"stt\": {\n \"provider\": \"deepgram\"\n },\n \"language_code\": \"en-US\",\n \"knowledge_base_id\": \"<string>\",\n \"enable_user_interruptions\": true,\n \"minimum_speech_duration_for_interruptions\": 0.5,\n \"minimum_words_before_interruption\": 0,\n \"wait_time_before_detecting_end_of_speech\": 0.5,\n \"ambient_sound\": \"none\",\n \"ambient_sound_volume\": 1,\n \"webhook_url\": \"<string>\",\n \"end_call_after_silence_seconds\": 10,\n \"max_call_duration_seconds\": 1800,\n \"welcome_message\": \"<string>\",\n \"voicemail_detection_timeout_seconds\": 90,\n \"dynamic_data_config\": [\n {\n \"url\": \"<string>\",\n \"response_data\": [\n {\n \"name\": \"<string>\",\n \"data\": \"<string>\",\n \"context\": \"<string>\"\n }\n ],\n \"method\": \"GET\",\n \"timeout\": 2000,\n \"headers\": {},\n \"body\": {},\n \"query\": {},\n \"cache\": true\n }\n ],\n \"post_call_analysis\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"type\": \"string\",\n \"examples\": [\n \"<string>\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v2/ai-agents/")
.header("Content-Type", "application/json")
.body("{\n \"agent_name\": \"<string>\",\n \"llm\": {\n \"llm_type\": \"simple\",\n \"model_name\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"model_temperature\": 0,\n \"required_dynamic_data\": [\n \"<string>\"\n ],\n \"tools\": [\n {}\n ],\n \"llm_name\": \"<string>\",\n \"llm_description\": \"<string>\",\n \"base_url\": \"<string>\",\n \"api_key\": \"<string>\",\n \"max_token\": 123\n },\n \"tts\": {\n \"voice_id\": \"<string>\",\n \"provider\": \"elevenlabs\",\n \"voice_name\": \"<string>\",\n \"voice_temperature\": 0.2\n },\n \"stt\": {\n \"provider\": \"deepgram\"\n },\n \"language_code\": \"en-US\",\n \"knowledge_base_id\": \"<string>\",\n \"enable_user_interruptions\": true,\n \"minimum_speech_duration_for_interruptions\": 0.5,\n \"minimum_words_before_interruption\": 0,\n \"wait_time_before_detecting_end_of_speech\": 0.5,\n \"ambient_sound\": \"none\",\n \"ambient_sound_volume\": 1,\n \"webhook_url\": \"<string>\",\n \"end_call_after_silence_seconds\": 10,\n \"max_call_duration_seconds\": 1800,\n \"welcome_message\": \"<string>\",\n \"voicemail_detection_timeout_seconds\": 90,\n \"dynamic_data_config\": [\n {\n \"url\": \"<string>\",\n \"response_data\": [\n {\n \"name\": \"<string>\",\n \"data\": \"<string>\",\n \"context\": \"<string>\"\n }\n ],\n \"method\": \"GET\",\n \"timeout\": 2000,\n \"headers\": {},\n \"body\": {},\n \"query\": {},\n \"cache\": true\n }\n ],\n \"post_call_analysis\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"type\": \"string\",\n \"examples\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v2/ai-agents/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_name\": \"<string>\",\n \"llm\": {\n \"llm_type\": \"simple\",\n \"model_name\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"model_temperature\": 0,\n \"required_dynamic_data\": [\n \"<string>\"\n ],\n \"tools\": [\n {}\n ],\n \"llm_name\": \"<string>\",\n \"llm_description\": \"<string>\",\n \"base_url\": \"<string>\",\n \"api_key\": \"<string>\",\n \"max_token\": 123\n },\n \"tts\": {\n \"voice_id\": \"<string>\",\n \"provider\": \"elevenlabs\",\n \"voice_name\": \"<string>\",\n \"voice_temperature\": 0.2\n },\n \"stt\": {\n \"provider\": \"deepgram\"\n },\n \"language_code\": \"en-US\",\n \"knowledge_base_id\": \"<string>\",\n \"enable_user_interruptions\": true,\n \"minimum_speech_duration_for_interruptions\": 0.5,\n \"minimum_words_before_interruption\": 0,\n \"wait_time_before_detecting_end_of_speech\": 0.5,\n \"ambient_sound\": \"none\",\n \"ambient_sound_volume\": 1,\n \"webhook_url\": \"<string>\",\n \"end_call_after_silence_seconds\": 10,\n \"max_call_duration_seconds\": 1800,\n \"welcome_message\": \"<string>\",\n \"voicemail_detection_timeout_seconds\": 90,\n \"dynamic_data_config\": [\n {\n \"url\": \"<string>\",\n \"response_data\": [\n {\n \"name\": \"<string>\",\n \"data\": \"<string>\",\n \"context\": \"<string>\"\n }\n ],\n \"method\": \"GET\",\n \"timeout\": 2000,\n \"headers\": {},\n \"body\": {},\n \"query\": {},\n \"cache\": true\n }\n ],\n \"post_call_analysis\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"type\": \"string\",\n \"examples\": [\n \"<string>\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"ai_agent_id": "<string>",
"agent_name": "<string>",
"llm": {
"llm_id": "<string>",
"llm_type": "simple",
"model_provider": "openai",
"model_name": "<string>",
"system_prompt": "<string>",
"model_temperature": 0,
"llm_name": "<string>",
"llm_description": "<string>",
"base_url": "<string>",
"api_key": "<string>",
"max_tokens": 123,
"required_dynamic_data": [
"<string>"
],
"tools": [
{}
]
},
"stt": {
"provider": "deepgram",
"model": "nova-2-general"
},
"tts": {
"provider": "elevenlabs",
"voice_id": "<string>",
"voice_name": "<string>",
"model_name": "eleven_turbo_v2_5",
"voice_temperature": 0.2
},
"created_by_user_id": "<string>",
"language_code": "en-US",
"knowledge_base_id": "<string>",
"enable_user_interruptions": true,
"minimum_speech_duration_for_interruptions": 0.5,
"minimum_words_before_interruption": 0,
"wait_time_before_detecting_end_of_speech": 0.5,
"ambient_sound": "none",
"ambient_sound_volume": 1,
"webhook_url": "<string>",
"end_call_after_silence_seconds": 10,
"max_call_duration_seconds": 1800,
"welcome_message": "<string>",
"voicemail_detection_timeout_seconds": 90,
"dynamic_data_config": [
{
"url": "<string>",
"method": "<string>",
"timeout": 123,
"headers": {},
"body": {},
"query": {},
"cache": true,
"response_data": [
{
"name": "<string>",
"data": "<string>",
"context": "<string>"
}
]
}
],
"post_call_analysis": [
{
"type": "string",
"name": "<string>",
"description": "<string>",
"system_prompt": "<string>",
"examples": [
"<string>"
]
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create AI Agent
Create a new AI agent with the provided configuration.
curl --request POST \
--url https://api.example.com/v2/ai-agents/ \
--header 'Content-Type: application/json' \
--data '
{
"agent_name": "<string>",
"llm": {
"llm_type": "simple",
"model_name": "<string>",
"system_prompt": "<string>",
"model_temperature": 0,
"required_dynamic_data": [
"<string>"
],
"tools": [
{}
],
"llm_name": "<string>",
"llm_description": "<string>",
"base_url": "<string>",
"api_key": "<string>",
"max_token": 123
},
"tts": {
"voice_id": "<string>",
"provider": "elevenlabs",
"voice_name": "<string>",
"voice_temperature": 0.2
},
"stt": {
"provider": "deepgram"
},
"language_code": "en-US",
"knowledge_base_id": "<string>",
"enable_user_interruptions": true,
"minimum_speech_duration_for_interruptions": 0.5,
"minimum_words_before_interruption": 0,
"wait_time_before_detecting_end_of_speech": 0.5,
"ambient_sound": "none",
"ambient_sound_volume": 1,
"webhook_url": "<string>",
"end_call_after_silence_seconds": 10,
"max_call_duration_seconds": 1800,
"welcome_message": "<string>",
"voicemail_detection_timeout_seconds": 90,
"dynamic_data_config": [
{
"url": "<string>",
"response_data": [
{
"name": "<string>",
"data": "<string>",
"context": "<string>"
}
],
"method": "GET",
"timeout": 2000,
"headers": {},
"body": {},
"query": {},
"cache": true
}
],
"post_call_analysis": [
{
"name": "<string>",
"description": "<string>",
"system_prompt": "<string>",
"type": "string",
"examples": [
"<string>"
]
}
]
}
'import requests
url = "https://api.example.com/v2/ai-agents/"
payload = {
"agent_name": "<string>",
"llm": {
"llm_type": "simple",
"model_name": "<string>",
"system_prompt": "<string>",
"model_temperature": 0,
"required_dynamic_data": ["<string>"],
"tools": [{}],
"llm_name": "<string>",
"llm_description": "<string>",
"base_url": "<string>",
"api_key": "<string>",
"max_token": 123
},
"tts": {
"voice_id": "<string>",
"provider": "elevenlabs",
"voice_name": "<string>",
"voice_temperature": 0.2
},
"stt": { "provider": "deepgram" },
"language_code": "en-US",
"knowledge_base_id": "<string>",
"enable_user_interruptions": True,
"minimum_speech_duration_for_interruptions": 0.5,
"minimum_words_before_interruption": 0,
"wait_time_before_detecting_end_of_speech": 0.5,
"ambient_sound": "none",
"ambient_sound_volume": 1,
"webhook_url": "<string>",
"end_call_after_silence_seconds": 10,
"max_call_duration_seconds": 1800,
"welcome_message": "<string>",
"voicemail_detection_timeout_seconds": 90,
"dynamic_data_config": [
{
"url": "<string>",
"response_data": [
{
"name": "<string>",
"data": "<string>",
"context": "<string>"
}
],
"method": "GET",
"timeout": 2000,
"headers": {},
"body": {},
"query": {},
"cache": True
}
],
"post_call_analysis": [
{
"name": "<string>",
"description": "<string>",
"system_prompt": "<string>",
"type": "string",
"examples": ["<string>"]
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
agent_name: '<string>',
llm: {
llm_type: 'simple',
model_name: '<string>',
system_prompt: '<string>',
model_temperature: 0,
required_dynamic_data: ['<string>'],
tools: [{}],
llm_name: '<string>',
llm_description: '<string>',
base_url: '<string>',
api_key: '<string>',
max_token: 123
},
tts: {
voice_id: '<string>',
provider: 'elevenlabs',
voice_name: '<string>',
voice_temperature: 0.2
},
stt: {provider: 'deepgram'},
language_code: 'en-US',
knowledge_base_id: '<string>',
enable_user_interruptions: true,
minimum_speech_duration_for_interruptions: 0.5,
minimum_words_before_interruption: 0,
wait_time_before_detecting_end_of_speech: 0.5,
ambient_sound: 'none',
ambient_sound_volume: 1,
webhook_url: '<string>',
end_call_after_silence_seconds: 10,
max_call_duration_seconds: 1800,
welcome_message: '<string>',
voicemail_detection_timeout_seconds: 90,
dynamic_data_config: [
{
url: '<string>',
response_data: [{name: '<string>', data: '<string>', context: '<string>'}],
method: 'GET',
timeout: 2000,
headers: {},
body: JSON.stringify({}),
query: {},
cache: true
}
],
post_call_analysis: [
{
name: '<string>',
description: '<string>',
system_prompt: '<string>',
type: 'string',
examples: ['<string>']
}
]
})
};
fetch('https://api.example.com/v2/ai-agents/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v2/ai-agents/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_name' => '<string>',
'llm' => [
'llm_type' => 'simple',
'model_name' => '<string>',
'system_prompt' => '<string>',
'model_temperature' => 0,
'required_dynamic_data' => [
'<string>'
],
'tools' => [
[
]
],
'llm_name' => '<string>',
'llm_description' => '<string>',
'base_url' => '<string>',
'api_key' => '<string>',
'max_token' => 123
],
'tts' => [
'voice_id' => '<string>',
'provider' => 'elevenlabs',
'voice_name' => '<string>',
'voice_temperature' => 0.2
],
'stt' => [
'provider' => 'deepgram'
],
'language_code' => 'en-US',
'knowledge_base_id' => '<string>',
'enable_user_interruptions' => true,
'minimum_speech_duration_for_interruptions' => 0.5,
'minimum_words_before_interruption' => 0,
'wait_time_before_detecting_end_of_speech' => 0.5,
'ambient_sound' => 'none',
'ambient_sound_volume' => 1,
'webhook_url' => '<string>',
'end_call_after_silence_seconds' => 10,
'max_call_duration_seconds' => 1800,
'welcome_message' => '<string>',
'voicemail_detection_timeout_seconds' => 90,
'dynamic_data_config' => [
[
'url' => '<string>',
'response_data' => [
[
'name' => '<string>',
'data' => '<string>',
'context' => '<string>'
]
],
'method' => 'GET',
'timeout' => 2000,
'headers' => [
],
'body' => [
],
'query' => [
],
'cache' => true
]
],
'post_call_analysis' => [
[
'name' => '<string>',
'description' => '<string>',
'system_prompt' => '<string>',
'type' => 'string',
'examples' => [
'<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v2/ai-agents/"
payload := strings.NewReader("{\n \"agent_name\": \"<string>\",\n \"llm\": {\n \"llm_type\": \"simple\",\n \"model_name\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"model_temperature\": 0,\n \"required_dynamic_data\": [\n \"<string>\"\n ],\n \"tools\": [\n {}\n ],\n \"llm_name\": \"<string>\",\n \"llm_description\": \"<string>\",\n \"base_url\": \"<string>\",\n \"api_key\": \"<string>\",\n \"max_token\": 123\n },\n \"tts\": {\n \"voice_id\": \"<string>\",\n \"provider\": \"elevenlabs\",\n \"voice_name\": \"<string>\",\n \"voice_temperature\": 0.2\n },\n \"stt\": {\n \"provider\": \"deepgram\"\n },\n \"language_code\": \"en-US\",\n \"knowledge_base_id\": \"<string>\",\n \"enable_user_interruptions\": true,\n \"minimum_speech_duration_for_interruptions\": 0.5,\n \"minimum_words_before_interruption\": 0,\n \"wait_time_before_detecting_end_of_speech\": 0.5,\n \"ambient_sound\": \"none\",\n \"ambient_sound_volume\": 1,\n \"webhook_url\": \"<string>\",\n \"end_call_after_silence_seconds\": 10,\n \"max_call_duration_seconds\": 1800,\n \"welcome_message\": \"<string>\",\n \"voicemail_detection_timeout_seconds\": 90,\n \"dynamic_data_config\": [\n {\n \"url\": \"<string>\",\n \"response_data\": [\n {\n \"name\": \"<string>\",\n \"data\": \"<string>\",\n \"context\": \"<string>\"\n }\n ],\n \"method\": \"GET\",\n \"timeout\": 2000,\n \"headers\": {},\n \"body\": {},\n \"query\": {},\n \"cache\": true\n }\n ],\n \"post_call_analysis\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"type\": \"string\",\n \"examples\": [\n \"<string>\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v2/ai-agents/")
.header("Content-Type", "application/json")
.body("{\n \"agent_name\": \"<string>\",\n \"llm\": {\n \"llm_type\": \"simple\",\n \"model_name\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"model_temperature\": 0,\n \"required_dynamic_data\": [\n \"<string>\"\n ],\n \"tools\": [\n {}\n ],\n \"llm_name\": \"<string>\",\n \"llm_description\": \"<string>\",\n \"base_url\": \"<string>\",\n \"api_key\": \"<string>\",\n \"max_token\": 123\n },\n \"tts\": {\n \"voice_id\": \"<string>\",\n \"provider\": \"elevenlabs\",\n \"voice_name\": \"<string>\",\n \"voice_temperature\": 0.2\n },\n \"stt\": {\n \"provider\": \"deepgram\"\n },\n \"language_code\": \"en-US\",\n \"knowledge_base_id\": \"<string>\",\n \"enable_user_interruptions\": true,\n \"minimum_speech_duration_for_interruptions\": 0.5,\n \"minimum_words_before_interruption\": 0,\n \"wait_time_before_detecting_end_of_speech\": 0.5,\n \"ambient_sound\": \"none\",\n \"ambient_sound_volume\": 1,\n \"webhook_url\": \"<string>\",\n \"end_call_after_silence_seconds\": 10,\n \"max_call_duration_seconds\": 1800,\n \"welcome_message\": \"<string>\",\n \"voicemail_detection_timeout_seconds\": 90,\n \"dynamic_data_config\": [\n {\n \"url\": \"<string>\",\n \"response_data\": [\n {\n \"name\": \"<string>\",\n \"data\": \"<string>\",\n \"context\": \"<string>\"\n }\n ],\n \"method\": \"GET\",\n \"timeout\": 2000,\n \"headers\": {},\n \"body\": {},\n \"query\": {},\n \"cache\": true\n }\n ],\n \"post_call_analysis\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"type\": \"string\",\n \"examples\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v2/ai-agents/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_name\": \"<string>\",\n \"llm\": {\n \"llm_type\": \"simple\",\n \"model_name\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"model_temperature\": 0,\n \"required_dynamic_data\": [\n \"<string>\"\n ],\n \"tools\": [\n {}\n ],\n \"llm_name\": \"<string>\",\n \"llm_description\": \"<string>\",\n \"base_url\": \"<string>\",\n \"api_key\": \"<string>\",\n \"max_token\": 123\n },\n \"tts\": {\n \"voice_id\": \"<string>\",\n \"provider\": \"elevenlabs\",\n \"voice_name\": \"<string>\",\n \"voice_temperature\": 0.2\n },\n \"stt\": {\n \"provider\": \"deepgram\"\n },\n \"language_code\": \"en-US\",\n \"knowledge_base_id\": \"<string>\",\n \"enable_user_interruptions\": true,\n \"minimum_speech_duration_for_interruptions\": 0.5,\n \"minimum_words_before_interruption\": 0,\n \"wait_time_before_detecting_end_of_speech\": 0.5,\n \"ambient_sound\": \"none\",\n \"ambient_sound_volume\": 1,\n \"webhook_url\": \"<string>\",\n \"end_call_after_silence_seconds\": 10,\n \"max_call_duration_seconds\": 1800,\n \"welcome_message\": \"<string>\",\n \"voicemail_detection_timeout_seconds\": 90,\n \"dynamic_data_config\": [\n {\n \"url\": \"<string>\",\n \"response_data\": [\n {\n \"name\": \"<string>\",\n \"data\": \"<string>\",\n \"context\": \"<string>\"\n }\n ],\n \"method\": \"GET\",\n \"timeout\": 2000,\n \"headers\": {},\n \"body\": {},\n \"query\": {},\n \"cache\": true\n }\n ],\n \"post_call_analysis\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"type\": \"string\",\n \"examples\": [\n \"<string>\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"ai_agent_id": "<string>",
"agent_name": "<string>",
"llm": {
"llm_id": "<string>",
"llm_type": "simple",
"model_provider": "openai",
"model_name": "<string>",
"system_prompt": "<string>",
"model_temperature": 0,
"llm_name": "<string>",
"llm_description": "<string>",
"base_url": "<string>",
"api_key": "<string>",
"max_tokens": 123,
"required_dynamic_data": [
"<string>"
],
"tools": [
{}
]
},
"stt": {
"provider": "deepgram",
"model": "nova-2-general"
},
"tts": {
"provider": "elevenlabs",
"voice_id": "<string>",
"voice_name": "<string>",
"model_name": "eleven_turbo_v2_5",
"voice_temperature": 0.2
},
"created_by_user_id": "<string>",
"language_code": "en-US",
"knowledge_base_id": "<string>",
"enable_user_interruptions": true,
"minimum_speech_duration_for_interruptions": 0.5,
"minimum_words_before_interruption": 0,
"wait_time_before_detecting_end_of_speech": 0.5,
"ambient_sound": "none",
"ambient_sound_volume": 1,
"webhook_url": "<string>",
"end_call_after_silence_seconds": 10,
"max_call_duration_seconds": 1800,
"welcome_message": "<string>",
"voicemail_detection_timeout_seconds": 90,
"dynamic_data_config": [
{
"url": "<string>",
"method": "<string>",
"timeout": 123,
"headers": {},
"body": {},
"query": {},
"cache": true,
"response_data": [
{
"name": "<string>",
"data": "<string>",
"context": "<string>"
}
]
}
],
"post_call_analysis": [
{
"type": "string",
"name": "<string>",
"description": "<string>",
"system_prompt": "<string>",
"examples": [
"<string>"
]
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Body
Name identifier for the AI agent
Language model configuration for the agent
- CreateSimplePiaLLMRequest
- CreateAgenticPiaLLMRequest
- CreateCustomPiaLLMRequest
Show child attributes
Show child attributes
Text-to-Speech configuration for voice synthesis
- CreateElevenLabsTTSRequest
- CreateGoogleTTSRequest
- CreateAzureTTSRequest
- CreateCartesiaTTSRequest
- CreatePiaTTSRequest
Show child attributes
Show child attributes
Speech-to-Text configuration for voice recognition
- CreateDeepgramSTTRequest
- CreateGoogleSTTRequest
- CreatePiaSTTRequest
Show child attributes
Show child attributes
Language code for the agent (e.g., 'en-US' for US English)
ID of the knowledge base to use for enhanced responses
Whether to allow users to interrupt the agent while speaking
Minimum duration (in seconds) of speech before allowing interruption
0 <= x <= 15Minimum number of words spoken before allowing interruption
0 <= x <= 5Time to wait before detecting end of speech
0 <= x <= 15Type of ambient background sound to add to the call
office, cafe, restaurant, park, street, home, library, airport, train_station, beach, none Volume level for ambient sound (0-2, where 1 is normal volume)
0 <= x <= 2URL to receive webhook notifications about call events
Number of seconds of silence before automatically ending the call
10 <= x <= 30Maximum duration of the call in seconds (30-3600)
30 <= x <= 3600Custom message to be spoken when the call begins
Time to wait for detecting voicemail before taking action
x >= 0Configuration for dynamic data sources used by the agent
Show child attributes
Show child attributes
Configuration for analysis items to be processed after the call
- CreateStringPostCallAnalysisItemRequest
- CreateEnumPostCallAnalysisItemRequest
- CreateBooleanPostCallAnalysisItemRequest
- CreateNumberPostCallAnalysisItemRequest
Show child attributes
Show child attributes
Response
Successful Response
Unique identifier for the AI agent
Name of the AI agent
Language model configuration for the AI agent
- SimplePiaLLMResponse
- AgenticPiaLLMResponse
- CustomPiaLLMResponse
Show child attributes
Show child attributes
Speech-to-text configuration for the AI agent
- DeepgramSTTResponse
- GoogleSTTResponse
- PiaSTTResponse
Show child attributes
Show child attributes
Text-to-speech configuration for the AI agent
- ElevenLabsTTSResponse
- GoogleTTSResponse
- AzureTTSResponse
- CartesiaTTSResponse
- PiaTTSResponse
Show child attributes
Show child attributes
ID of the user who created this AI agent
Language code for the AI agent in BCP-47 format
ID of the associated knowledge base, if any
Whether to allow users to interrupt the AI agent while speaking
Minimum duration of speech in seconds before interruptions are allowed
0 <= x <= 15Minimum number of words that must be spoken before interruption is allowed
0 <= x <= 5Time in seconds to wait before considering speech has ended
0 <= x <= 15Type of ambient background sound to use during calls
office, cafe, restaurant, park, street, home, library, airport, train_station, beach, none Volume level for ambient sound, from 0 (muted) to 2 (loud)
0 <= x <= 2URL to send webhook notifications about call events
Number of seconds of silence before automatically ending the call
10 <= x <= 30Maximum duration of a call in seconds
30 <= x <= 3600Custom welcome message to play at the start of calls
Time in seconds to wait for voicemail detection
x >= 0Configuration for dynamic data sources that can be used during calls
Show child attributes
Show child attributes
Configuration for analysis items to be processed after calls
- StringPostCallAnalysisItemResponse
- EnumPostCallAnalysisItemResponse
- BooleanPostCallAnalysisItemResponse
- NumberPostCallAnalysisItemResponse
Show child attributes
Show child attributes

