curl --request POST \
--url https://api.example.com/api/v1/assistants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "<string>",
"description": "<string>",
"llm_provider": "openai",
"llm_provider_config": {
"api_key": "<string>",
"base_url": "<string>",
"model": "gpt-4o-mini",
"custom_config": {}
},
"openai_api_key": "<string>",
"custom_llm_url": "<string>",
"deepgram_api_key": "<string>",
"elevenlabs_api_key": "<string>",
"twilio_config": {
"account_sid": "<string>",
"auth_token": "<string>"
},
"twilio_account_sid": "<string>",
"twilio_auth_token": "<string>",
"llm_settings": {
"temperature": 0.5,
"max_tokens": 1000,
"system_prompt": "You are a helpful assistant that can answer questions and help with tasks.",
"welcome_message": "<string>",
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0,
"stop_sequences": [
"<string>"
]
},
"webhook_url": "<string>",
"interruption_settings": {
"interruption_threshold": 3,
"min_speaking_time": 0.5,
"interruption_cooldown": 2
},
"tts_settings": {
"provider": "elevenlabs",
"voice_id": "rachel",
"model_id": "turbo",
"latency": 1,
"stability": 0.5,
"similarity_boost": 0.75,
"style": 0,
"use_speaker_boost": true,
"provider_config": {}
},
"stt_settings": {
"model": "nova-2",
"language": "en-US",
"punctuate": true,
"interim_results": true,
"endpointing": {
"silence_threshold": 500,
"min_silence_duration": 500
},
"utterance_end_ms": 1000,
"vad_turnoff": 500,
"smart_format": true,
"keywords": [
{
"keyword": "<string>",
"intensifier": 1
}
],
"keyterms": [
"<string>"
],
"audio_denoising": false
},
"end_call_message": "<string>",
"transfer_call_message": "<string>",
"idle_message": "Are you still there? I'm here to help if you need anything.",
"max_idle_messages": 123,
"idle_timeout": 123,
"tools_settings": {
"enabled_tools": [
"<string>"
],
"end_call": {
"enabled": false,
"scenarios": [
"<string>"
],
"custom_message": "<string>"
},
"transfer_call": {
"enabled": false,
"scenarios": [
"<string>"
],
"transfer_numbers": [
"<string>"
],
"custom_message": "<string>"
},
"custom_tools": [
{}
]
},
"rag_settings": {
"enabled": false,
"search_limit": 3,
"similarity_threshold": 0.7,
"embedding_model": "text-embedding-3-small",
"chunking_strategy": "recursive",
"chunk_size": 1000,
"chunk_overlap": 200,
"auto_process": true,
"include_metadata": true,
"context_window_tokens": 4000
},
"llm_fallback_providers": {
"enabled": false,
"fallbacks": [
{
"provider": "<string>",
"api_key": "<string>",
"base_url": "<string>",
"model": "<string>"
}
]
},
"custom_settings": {},
"is_active": true
}
EOFimport requests
url = "https://api.example.com/api/v1/assistants"
payload = {
"name": "<string>",
"description": "<string>",
"llm_provider": "openai",
"llm_provider_config": {
"api_key": "<string>",
"base_url": "<string>",
"model": "gpt-4o-mini",
"custom_config": {}
},
"openai_api_key": "<string>",
"custom_llm_url": "<string>",
"deepgram_api_key": "<string>",
"elevenlabs_api_key": "<string>",
"twilio_config": {
"account_sid": "<string>",
"auth_token": "<string>"
},
"twilio_account_sid": "<string>",
"twilio_auth_token": "<string>",
"llm_settings": {
"temperature": 0.5,
"max_tokens": 1000,
"system_prompt": "You are a helpful assistant that can answer questions and help with tasks.",
"welcome_message": "<string>",
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0,
"stop_sequences": ["<string>"]
},
"webhook_url": "<string>",
"interruption_settings": {
"interruption_threshold": 3,
"min_speaking_time": 0.5,
"interruption_cooldown": 2
},
"tts_settings": {
"provider": "elevenlabs",
"voice_id": "rachel",
"model_id": "turbo",
"latency": 1,
"stability": 0.5,
"similarity_boost": 0.75,
"style": 0,
"use_speaker_boost": True,
"provider_config": {}
},
"stt_settings": {
"model": "nova-2",
"language": "en-US",
"punctuate": True,
"interim_results": True,
"endpointing": {
"silence_threshold": 500,
"min_silence_duration": 500
},
"utterance_end_ms": 1000,
"vad_turnoff": 500,
"smart_format": True,
"keywords": [
{
"keyword": "<string>",
"intensifier": 1
}
],
"keyterms": ["<string>"],
"audio_denoising": False
},
"end_call_message": "<string>",
"transfer_call_message": "<string>",
"idle_message": "Are you still there? I'm here to help if you need anything.",
"max_idle_messages": 123,
"idle_timeout": 123,
"tools_settings": {
"enabled_tools": ["<string>"],
"end_call": {
"enabled": False,
"scenarios": ["<string>"],
"custom_message": "<string>"
},
"transfer_call": {
"enabled": False,
"scenarios": ["<string>"],
"transfer_numbers": ["<string>"],
"custom_message": "<string>"
},
"custom_tools": [{}]
},
"rag_settings": {
"enabled": False,
"search_limit": 3,
"similarity_threshold": 0.7,
"embedding_model": "text-embedding-3-small",
"chunking_strategy": "recursive",
"chunk_size": 1000,
"chunk_overlap": 200,
"auto_process": True,
"include_metadata": True,
"context_window_tokens": 4000
},
"llm_fallback_providers": {
"enabled": False,
"fallbacks": [
{
"provider": "<string>",
"api_key": "<string>",
"base_url": "<string>",
"model": "<string>"
}
]
},
"custom_settings": {},
"is_active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
llm_provider: 'openai',
llm_provider_config: {
api_key: '<string>',
base_url: '<string>',
model: 'gpt-4o-mini',
custom_config: {}
},
openai_api_key: '<string>',
custom_llm_url: '<string>',
deepgram_api_key: '<string>',
elevenlabs_api_key: '<string>',
twilio_config: {account_sid: '<string>', auth_token: '<string>'},
twilio_account_sid: '<string>',
twilio_auth_token: '<string>',
llm_settings: {
temperature: 0.5,
max_tokens: 1000,
system_prompt: 'You are a helpful assistant that can answer questions and help with tasks.',
welcome_message: '<string>',
top_p: 1,
frequency_penalty: 0,
presence_penalty: 0,
stop_sequences: ['<string>']
},
webhook_url: '<string>',
interruption_settings: {interruption_threshold: 3, min_speaking_time: 0.5, interruption_cooldown: 2},
tts_settings: {
provider: 'elevenlabs',
voice_id: 'rachel',
model_id: 'turbo',
latency: 1,
stability: 0.5,
similarity_boost: 0.75,
style: 0,
use_speaker_boost: true,
provider_config: {}
},
stt_settings: {
model: 'nova-2',
language: 'en-US',
punctuate: true,
interim_results: true,
endpointing: {silence_threshold: 500, min_silence_duration: 500},
utterance_end_ms: 1000,
vad_turnoff: 500,
smart_format: true,
keywords: [{keyword: '<string>', intensifier: 1}],
keyterms: ['<string>'],
audio_denoising: false
},
end_call_message: '<string>',
transfer_call_message: '<string>',
idle_message: 'Are you still there? I\'m here to help if you need anything.',
max_idle_messages: 123,
idle_timeout: 123,
tools_settings: {
enabled_tools: ['<string>'],
end_call: {enabled: false, scenarios: ['<string>'], custom_message: '<string>'},
transfer_call: {
enabled: false,
scenarios: ['<string>'],
transfer_numbers: ['<string>'],
custom_message: '<string>'
},
custom_tools: [{}]
},
rag_settings: {
enabled: false,
search_limit: 3,
similarity_threshold: 0.7,
embedding_model: 'text-embedding-3-small',
chunking_strategy: 'recursive',
chunk_size: 1000,
chunk_overlap: 200,
auto_process: true,
include_metadata: true,
context_window_tokens: 4000
},
llm_fallback_providers: {
enabled: false,
fallbacks: [
{
provider: '<string>',
api_key: '<string>',
base_url: '<string>',
model: '<string>'
}
]
},
custom_settings: {},
is_active: true
})
};
fetch('https://api.example.com/api/v1/assistants', 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/api/v1/assistants",
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([
'name' => '<string>',
'description' => '<string>',
'llm_provider' => 'openai',
'llm_provider_config' => [
'api_key' => '<string>',
'base_url' => '<string>',
'model' => 'gpt-4o-mini',
'custom_config' => [
]
],
'openai_api_key' => '<string>',
'custom_llm_url' => '<string>',
'deepgram_api_key' => '<string>',
'elevenlabs_api_key' => '<string>',
'twilio_config' => [
'account_sid' => '<string>',
'auth_token' => '<string>'
],
'twilio_account_sid' => '<string>',
'twilio_auth_token' => '<string>',
'llm_settings' => [
'temperature' => 0.5,
'max_tokens' => 1000,
'system_prompt' => 'You are a helpful assistant that can answer questions and help with tasks.',
'welcome_message' => '<string>',
'top_p' => 1,
'frequency_penalty' => 0,
'presence_penalty' => 0,
'stop_sequences' => [
'<string>'
]
],
'webhook_url' => '<string>',
'interruption_settings' => [
'interruption_threshold' => 3,
'min_speaking_time' => 0.5,
'interruption_cooldown' => 2
],
'tts_settings' => [
'provider' => 'elevenlabs',
'voice_id' => 'rachel',
'model_id' => 'turbo',
'latency' => 1,
'stability' => 0.5,
'similarity_boost' => 0.75,
'style' => 0,
'use_speaker_boost' => true,
'provider_config' => [
]
],
'stt_settings' => [
'model' => 'nova-2',
'language' => 'en-US',
'punctuate' => true,
'interim_results' => true,
'endpointing' => [
'silence_threshold' => 500,
'min_silence_duration' => 500
],
'utterance_end_ms' => 1000,
'vad_turnoff' => 500,
'smart_format' => true,
'keywords' => [
[
'keyword' => '<string>',
'intensifier' => 1
]
],
'keyterms' => [
'<string>'
],
'audio_denoising' => false
],
'end_call_message' => '<string>',
'transfer_call_message' => '<string>',
'idle_message' => 'Are you still there? I\'m here to help if you need anything.',
'max_idle_messages' => 123,
'idle_timeout' => 123,
'tools_settings' => [
'enabled_tools' => [
'<string>'
],
'end_call' => [
'enabled' => false,
'scenarios' => [
'<string>'
],
'custom_message' => '<string>'
],
'transfer_call' => [
'enabled' => false,
'scenarios' => [
'<string>'
],
'transfer_numbers' => [
'<string>'
],
'custom_message' => '<string>'
],
'custom_tools' => [
[
]
]
],
'rag_settings' => [
'enabled' => false,
'search_limit' => 3,
'similarity_threshold' => 0.7,
'embedding_model' => 'text-embedding-3-small',
'chunking_strategy' => 'recursive',
'chunk_size' => 1000,
'chunk_overlap' => 200,
'auto_process' => true,
'include_metadata' => true,
'context_window_tokens' => 4000
],
'llm_fallback_providers' => [
'enabled' => false,
'fallbacks' => [
[
'provider' => '<string>',
'api_key' => '<string>',
'base_url' => '<string>',
'model' => '<string>'
]
]
],
'custom_settings' => [
],
'is_active' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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/api/v1/assistants"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"llm_provider\": \"openai\",\n \"llm_provider_config\": {\n \"api_key\": \"<string>\",\n \"base_url\": \"<string>\",\n \"model\": \"gpt-4o-mini\",\n \"custom_config\": {}\n },\n \"openai_api_key\": \"<string>\",\n \"custom_llm_url\": \"<string>\",\n \"deepgram_api_key\": \"<string>\",\n \"elevenlabs_api_key\": \"<string>\",\n \"twilio_config\": {\n \"account_sid\": \"<string>\",\n \"auth_token\": \"<string>\"\n },\n \"twilio_account_sid\": \"<string>\",\n \"twilio_auth_token\": \"<string>\",\n \"llm_settings\": {\n \"temperature\": 0.5,\n \"max_tokens\": 1000,\n \"system_prompt\": \"You are a helpful assistant that can answer questions and help with tasks.\",\n \"welcome_message\": \"<string>\",\n \"top_p\": 1,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"stop_sequences\": [\n \"<string>\"\n ]\n },\n \"webhook_url\": \"<string>\",\n \"interruption_settings\": {\n \"interruption_threshold\": 3,\n \"min_speaking_time\": 0.5,\n \"interruption_cooldown\": 2\n },\n \"tts_settings\": {\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"rachel\",\n \"model_id\": \"turbo\",\n \"latency\": 1,\n \"stability\": 0.5,\n \"similarity_boost\": 0.75,\n \"style\": 0,\n \"use_speaker_boost\": true,\n \"provider_config\": {}\n },\n \"stt_settings\": {\n \"model\": \"nova-2\",\n \"language\": \"en-US\",\n \"punctuate\": true,\n \"interim_results\": true,\n \"endpointing\": {\n \"silence_threshold\": 500,\n \"min_silence_duration\": 500\n },\n \"utterance_end_ms\": 1000,\n \"vad_turnoff\": 500,\n \"smart_format\": true,\n \"keywords\": [\n {\n \"keyword\": \"<string>\",\n \"intensifier\": 1\n }\n ],\n \"keyterms\": [\n \"<string>\"\n ],\n \"audio_denoising\": false\n },\n \"end_call_message\": \"<string>\",\n \"transfer_call_message\": \"<string>\",\n \"idle_message\": \"Are you still there? I'm here to help if you need anything.\",\n \"max_idle_messages\": 123,\n \"idle_timeout\": 123,\n \"tools_settings\": {\n \"enabled_tools\": [\n \"<string>\"\n ],\n \"end_call\": {\n \"enabled\": false,\n \"scenarios\": [\n \"<string>\"\n ],\n \"custom_message\": \"<string>\"\n },\n \"transfer_call\": {\n \"enabled\": false,\n \"scenarios\": [\n \"<string>\"\n ],\n \"transfer_numbers\": [\n \"<string>\"\n ],\n \"custom_message\": \"<string>\"\n },\n \"custom_tools\": [\n {}\n ]\n },\n \"rag_settings\": {\n \"enabled\": false,\n \"search_limit\": 3,\n \"similarity_threshold\": 0.7,\n \"embedding_model\": \"text-embedding-3-small\",\n \"chunking_strategy\": \"recursive\",\n \"chunk_size\": 1000,\n \"chunk_overlap\": 200,\n \"auto_process\": true,\n \"include_metadata\": true,\n \"context_window_tokens\": 4000\n },\n \"llm_fallback_providers\": {\n \"enabled\": false,\n \"fallbacks\": [\n {\n \"provider\": \"<string>\",\n \"api_key\": \"<string>\",\n \"base_url\": \"<string>\",\n \"model\": \"<string>\"\n }\n ]\n },\n \"custom_settings\": {},\n \"is_active\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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/api/v1/assistants")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"llm_provider\": \"openai\",\n \"llm_provider_config\": {\n \"api_key\": \"<string>\",\n \"base_url\": \"<string>\",\n \"model\": \"gpt-4o-mini\",\n \"custom_config\": {}\n },\n \"openai_api_key\": \"<string>\",\n \"custom_llm_url\": \"<string>\",\n \"deepgram_api_key\": \"<string>\",\n \"elevenlabs_api_key\": \"<string>\",\n \"twilio_config\": {\n \"account_sid\": \"<string>\",\n \"auth_token\": \"<string>\"\n },\n \"twilio_account_sid\": \"<string>\",\n \"twilio_auth_token\": \"<string>\",\n \"llm_settings\": {\n \"temperature\": 0.5,\n \"max_tokens\": 1000,\n \"system_prompt\": \"You are a helpful assistant that can answer questions and help with tasks.\",\n \"welcome_message\": \"<string>\",\n \"top_p\": 1,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"stop_sequences\": [\n \"<string>\"\n ]\n },\n \"webhook_url\": \"<string>\",\n \"interruption_settings\": {\n \"interruption_threshold\": 3,\n \"min_speaking_time\": 0.5,\n \"interruption_cooldown\": 2\n },\n \"tts_settings\": {\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"rachel\",\n \"model_id\": \"turbo\",\n \"latency\": 1,\n \"stability\": 0.5,\n \"similarity_boost\": 0.75,\n \"style\": 0,\n \"use_speaker_boost\": true,\n \"provider_config\": {}\n },\n \"stt_settings\": {\n \"model\": \"nova-2\",\n \"language\": \"en-US\",\n \"punctuate\": true,\n \"interim_results\": true,\n \"endpointing\": {\n \"silence_threshold\": 500,\n \"min_silence_duration\": 500\n },\n \"utterance_end_ms\": 1000,\n \"vad_turnoff\": 500,\n \"smart_format\": true,\n \"keywords\": [\n {\n \"keyword\": \"<string>\",\n \"intensifier\": 1\n }\n ],\n \"keyterms\": [\n \"<string>\"\n ],\n \"audio_denoising\": false\n },\n \"end_call_message\": \"<string>\",\n \"transfer_call_message\": \"<string>\",\n \"idle_message\": \"Are you still there? I'm here to help if you need anything.\",\n \"max_idle_messages\": 123,\n \"idle_timeout\": 123,\n \"tools_settings\": {\n \"enabled_tools\": [\n \"<string>\"\n ],\n \"end_call\": {\n \"enabled\": false,\n \"scenarios\": [\n \"<string>\"\n ],\n \"custom_message\": \"<string>\"\n },\n \"transfer_call\": {\n \"enabled\": false,\n \"scenarios\": [\n \"<string>\"\n ],\n \"transfer_numbers\": [\n \"<string>\"\n ],\n \"custom_message\": \"<string>\"\n },\n \"custom_tools\": [\n {}\n ]\n },\n \"rag_settings\": {\n \"enabled\": false,\n \"search_limit\": 3,\n \"similarity_threshold\": 0.7,\n \"embedding_model\": \"text-embedding-3-small\",\n \"chunking_strategy\": \"recursive\",\n \"chunk_size\": 1000,\n \"chunk_overlap\": 200,\n \"auto_process\": true,\n \"include_metadata\": true,\n \"context_window_tokens\": 4000\n },\n \"llm_fallback_providers\": {\n \"enabled\": false,\n \"fallbacks\": [\n {\n \"provider\": \"<string>\",\n \"api_key\": \"<string>\",\n \"base_url\": \"<string>\",\n \"model\": \"<string>\"\n }\n ]\n },\n \"custom_settings\": {},\n \"is_active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/assistants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"llm_provider\": \"openai\",\n \"llm_provider_config\": {\n \"api_key\": \"<string>\",\n \"base_url\": \"<string>\",\n \"model\": \"gpt-4o-mini\",\n \"custom_config\": {}\n },\n \"openai_api_key\": \"<string>\",\n \"custom_llm_url\": \"<string>\",\n \"deepgram_api_key\": \"<string>\",\n \"elevenlabs_api_key\": \"<string>\",\n \"twilio_config\": {\n \"account_sid\": \"<string>\",\n \"auth_token\": \"<string>\"\n },\n \"twilio_account_sid\": \"<string>\",\n \"twilio_auth_token\": \"<string>\",\n \"llm_settings\": {\n \"temperature\": 0.5,\n \"max_tokens\": 1000,\n \"system_prompt\": \"You are a helpful assistant that can answer questions and help with tasks.\",\n \"welcome_message\": \"<string>\",\n \"top_p\": 1,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"stop_sequences\": [\n \"<string>\"\n ]\n },\n \"webhook_url\": \"<string>\",\n \"interruption_settings\": {\n \"interruption_threshold\": 3,\n \"min_speaking_time\": 0.5,\n \"interruption_cooldown\": 2\n },\n \"tts_settings\": {\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"rachel\",\n \"model_id\": \"turbo\",\n \"latency\": 1,\n \"stability\": 0.5,\n \"similarity_boost\": 0.75,\n \"style\": 0,\n \"use_speaker_boost\": true,\n \"provider_config\": {}\n },\n \"stt_settings\": {\n \"model\": \"nova-2\",\n \"language\": \"en-US\",\n \"punctuate\": true,\n \"interim_results\": true,\n \"endpointing\": {\n \"silence_threshold\": 500,\n \"min_silence_duration\": 500\n },\n \"utterance_end_ms\": 1000,\n \"vad_turnoff\": 500,\n \"smart_format\": true,\n \"keywords\": [\n {\n \"keyword\": \"<string>\",\n \"intensifier\": 1\n }\n ],\n \"keyterms\": [\n \"<string>\"\n ],\n \"audio_denoising\": false\n },\n \"end_call_message\": \"<string>\",\n \"transfer_call_message\": \"<string>\",\n \"idle_message\": \"Are you still there? I'm here to help if you need anything.\",\n \"max_idle_messages\": 123,\n \"idle_timeout\": 123,\n \"tools_settings\": {\n \"enabled_tools\": [\n \"<string>\"\n ],\n \"end_call\": {\n \"enabled\": false,\n \"scenarios\": [\n \"<string>\"\n ],\n \"custom_message\": \"<string>\"\n },\n \"transfer_call\": {\n \"enabled\": false,\n \"scenarios\": [\n \"<string>\"\n ],\n \"transfer_numbers\": [\n \"<string>\"\n ],\n \"custom_message\": \"<string>\"\n },\n \"custom_tools\": [\n {}\n ]\n },\n \"rag_settings\": {\n \"enabled\": false,\n \"search_limit\": 3,\n \"similarity_threshold\": 0.7,\n \"embedding_model\": \"text-embedding-3-small\",\n \"chunking_strategy\": \"recursive\",\n \"chunk_size\": 1000,\n \"chunk_overlap\": 200,\n \"auto_process\": true,\n \"include_metadata\": true,\n \"context_window_tokens\": 4000\n },\n \"llm_fallback_providers\": {\n \"enabled\": false,\n \"fallbacks\": [\n {\n \"provider\": \"<string>\",\n \"api_key\": \"<string>\",\n \"base_url\": \"<string>\",\n \"model\": \"<string>\"\n }\n ]\n },\n \"custom_settings\": {},\n \"is_active\": true\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"id": 123,
"organization_id": 123,
"user_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"llm_provider": "openai",
"llm_provider_config": {
"api_key": "<string>",
"base_url": "<string>",
"model": "gpt-4o-mini",
"custom_config": {}
},
"twilio_config": {
"account_sid": "<string>",
"auth_token": "<string>"
},
"llm_settings": {
"temperature": 0.5,
"max_tokens": 1000,
"system_prompt": "You are a helpful assistant that can answer questions and help with tasks.",
"welcome_message": "<string>",
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0,
"stop_sequences": [
"<string>"
]
},
"webhook_url": "<string>",
"interruption_settings": {
"interruption_threshold": 3,
"min_speaking_time": 0.5,
"interruption_cooldown": 2
},
"tts_settings": {
"provider": "elevenlabs",
"voice_id": "rachel",
"model_id": "turbo",
"latency": 1,
"stability": 0.5,
"similarity_boost": 0.75,
"style": 0,
"use_speaker_boost": true,
"provider_config": {}
},
"stt_settings": {
"model": "nova-2",
"language": "en-US",
"punctuate": true,
"interim_results": true,
"endpointing": {
"silence_threshold": 500,
"min_silence_duration": 500
},
"utterance_end_ms": 1000,
"vad_turnoff": 500,
"smart_format": true,
"keywords": [
{
"keyword": "<string>",
"intensifier": 1
}
],
"keyterms": [
"<string>"
],
"audio_denoising": false
},
"end_call_message": "<string>",
"transfer_call_message": "<string>",
"idle_message": "Are you still there? I'm here to help if you need anything.",
"max_idle_messages": 123,
"idle_timeout": 123,
"tools_settings": {
"enabled_tools": [
"<string>"
],
"end_call": {
"enabled": false,
"scenarios": [
"<string>"
],
"custom_message": "<string>"
},
"transfer_call": {
"enabled": false,
"scenarios": [
"<string>"
],
"transfer_numbers": [
"<string>"
],
"custom_message": "<string>"
},
"custom_tools": [
{}
]
},
"rag_settings": {
"enabled": false,
"search_limit": 3,
"similarity_threshold": 0.7,
"embedding_model": "text-embedding-3-small",
"chunking_strategy": "recursive",
"chunk_size": 1000,
"chunk_overlap": 200,
"auto_process": true,
"include_metadata": true,
"context_window_tokens": 4000
},
"llm_fallback_providers": {
"enabled": false,
"fallbacks": [
{
"provider": "<string>",
"api_key": "<string>",
"base_url": "<string>",
"model": "<string>"
}
]
},
"custom_settings": {},
"is_active": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create Assistant
Create a new assistant.
Creates a new voice assistant with the specified configuration. The assistant will be associated with the authenticated user’s organization.
curl --request POST \
--url https://api.example.com/api/v1/assistants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "<string>",
"description": "<string>",
"llm_provider": "openai",
"llm_provider_config": {
"api_key": "<string>",
"base_url": "<string>",
"model": "gpt-4o-mini",
"custom_config": {}
},
"openai_api_key": "<string>",
"custom_llm_url": "<string>",
"deepgram_api_key": "<string>",
"elevenlabs_api_key": "<string>",
"twilio_config": {
"account_sid": "<string>",
"auth_token": "<string>"
},
"twilio_account_sid": "<string>",
"twilio_auth_token": "<string>",
"llm_settings": {
"temperature": 0.5,
"max_tokens": 1000,
"system_prompt": "You are a helpful assistant that can answer questions and help with tasks.",
"welcome_message": "<string>",
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0,
"stop_sequences": [
"<string>"
]
},
"webhook_url": "<string>",
"interruption_settings": {
"interruption_threshold": 3,
"min_speaking_time": 0.5,
"interruption_cooldown": 2
},
"tts_settings": {
"provider": "elevenlabs",
"voice_id": "rachel",
"model_id": "turbo",
"latency": 1,
"stability": 0.5,
"similarity_boost": 0.75,
"style": 0,
"use_speaker_boost": true,
"provider_config": {}
},
"stt_settings": {
"model": "nova-2",
"language": "en-US",
"punctuate": true,
"interim_results": true,
"endpointing": {
"silence_threshold": 500,
"min_silence_duration": 500
},
"utterance_end_ms": 1000,
"vad_turnoff": 500,
"smart_format": true,
"keywords": [
{
"keyword": "<string>",
"intensifier": 1
}
],
"keyterms": [
"<string>"
],
"audio_denoising": false
},
"end_call_message": "<string>",
"transfer_call_message": "<string>",
"idle_message": "Are you still there? I'm here to help if you need anything.",
"max_idle_messages": 123,
"idle_timeout": 123,
"tools_settings": {
"enabled_tools": [
"<string>"
],
"end_call": {
"enabled": false,
"scenarios": [
"<string>"
],
"custom_message": "<string>"
},
"transfer_call": {
"enabled": false,
"scenarios": [
"<string>"
],
"transfer_numbers": [
"<string>"
],
"custom_message": "<string>"
},
"custom_tools": [
{}
]
},
"rag_settings": {
"enabled": false,
"search_limit": 3,
"similarity_threshold": 0.7,
"embedding_model": "text-embedding-3-small",
"chunking_strategy": "recursive",
"chunk_size": 1000,
"chunk_overlap": 200,
"auto_process": true,
"include_metadata": true,
"context_window_tokens": 4000
},
"llm_fallback_providers": {
"enabled": false,
"fallbacks": [
{
"provider": "<string>",
"api_key": "<string>",
"base_url": "<string>",
"model": "<string>"
}
]
},
"custom_settings": {},
"is_active": true
}
EOFimport requests
url = "https://api.example.com/api/v1/assistants"
payload = {
"name": "<string>",
"description": "<string>",
"llm_provider": "openai",
"llm_provider_config": {
"api_key": "<string>",
"base_url": "<string>",
"model": "gpt-4o-mini",
"custom_config": {}
},
"openai_api_key": "<string>",
"custom_llm_url": "<string>",
"deepgram_api_key": "<string>",
"elevenlabs_api_key": "<string>",
"twilio_config": {
"account_sid": "<string>",
"auth_token": "<string>"
},
"twilio_account_sid": "<string>",
"twilio_auth_token": "<string>",
"llm_settings": {
"temperature": 0.5,
"max_tokens": 1000,
"system_prompt": "You are a helpful assistant that can answer questions and help with tasks.",
"welcome_message": "<string>",
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0,
"stop_sequences": ["<string>"]
},
"webhook_url": "<string>",
"interruption_settings": {
"interruption_threshold": 3,
"min_speaking_time": 0.5,
"interruption_cooldown": 2
},
"tts_settings": {
"provider": "elevenlabs",
"voice_id": "rachel",
"model_id": "turbo",
"latency": 1,
"stability": 0.5,
"similarity_boost": 0.75,
"style": 0,
"use_speaker_boost": True,
"provider_config": {}
},
"stt_settings": {
"model": "nova-2",
"language": "en-US",
"punctuate": True,
"interim_results": True,
"endpointing": {
"silence_threshold": 500,
"min_silence_duration": 500
},
"utterance_end_ms": 1000,
"vad_turnoff": 500,
"smart_format": True,
"keywords": [
{
"keyword": "<string>",
"intensifier": 1
}
],
"keyterms": ["<string>"],
"audio_denoising": False
},
"end_call_message": "<string>",
"transfer_call_message": "<string>",
"idle_message": "Are you still there? I'm here to help if you need anything.",
"max_idle_messages": 123,
"idle_timeout": 123,
"tools_settings": {
"enabled_tools": ["<string>"],
"end_call": {
"enabled": False,
"scenarios": ["<string>"],
"custom_message": "<string>"
},
"transfer_call": {
"enabled": False,
"scenarios": ["<string>"],
"transfer_numbers": ["<string>"],
"custom_message": "<string>"
},
"custom_tools": [{}]
},
"rag_settings": {
"enabled": False,
"search_limit": 3,
"similarity_threshold": 0.7,
"embedding_model": "text-embedding-3-small",
"chunking_strategy": "recursive",
"chunk_size": 1000,
"chunk_overlap": 200,
"auto_process": True,
"include_metadata": True,
"context_window_tokens": 4000
},
"llm_fallback_providers": {
"enabled": False,
"fallbacks": [
{
"provider": "<string>",
"api_key": "<string>",
"base_url": "<string>",
"model": "<string>"
}
]
},
"custom_settings": {},
"is_active": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
llm_provider: 'openai',
llm_provider_config: {
api_key: '<string>',
base_url: '<string>',
model: 'gpt-4o-mini',
custom_config: {}
},
openai_api_key: '<string>',
custom_llm_url: '<string>',
deepgram_api_key: '<string>',
elevenlabs_api_key: '<string>',
twilio_config: {account_sid: '<string>', auth_token: '<string>'},
twilio_account_sid: '<string>',
twilio_auth_token: '<string>',
llm_settings: {
temperature: 0.5,
max_tokens: 1000,
system_prompt: 'You are a helpful assistant that can answer questions and help with tasks.',
welcome_message: '<string>',
top_p: 1,
frequency_penalty: 0,
presence_penalty: 0,
stop_sequences: ['<string>']
},
webhook_url: '<string>',
interruption_settings: {interruption_threshold: 3, min_speaking_time: 0.5, interruption_cooldown: 2},
tts_settings: {
provider: 'elevenlabs',
voice_id: 'rachel',
model_id: 'turbo',
latency: 1,
stability: 0.5,
similarity_boost: 0.75,
style: 0,
use_speaker_boost: true,
provider_config: {}
},
stt_settings: {
model: 'nova-2',
language: 'en-US',
punctuate: true,
interim_results: true,
endpointing: {silence_threshold: 500, min_silence_duration: 500},
utterance_end_ms: 1000,
vad_turnoff: 500,
smart_format: true,
keywords: [{keyword: '<string>', intensifier: 1}],
keyterms: ['<string>'],
audio_denoising: false
},
end_call_message: '<string>',
transfer_call_message: '<string>',
idle_message: 'Are you still there? I\'m here to help if you need anything.',
max_idle_messages: 123,
idle_timeout: 123,
tools_settings: {
enabled_tools: ['<string>'],
end_call: {enabled: false, scenarios: ['<string>'], custom_message: '<string>'},
transfer_call: {
enabled: false,
scenarios: ['<string>'],
transfer_numbers: ['<string>'],
custom_message: '<string>'
},
custom_tools: [{}]
},
rag_settings: {
enabled: false,
search_limit: 3,
similarity_threshold: 0.7,
embedding_model: 'text-embedding-3-small',
chunking_strategy: 'recursive',
chunk_size: 1000,
chunk_overlap: 200,
auto_process: true,
include_metadata: true,
context_window_tokens: 4000
},
llm_fallback_providers: {
enabled: false,
fallbacks: [
{
provider: '<string>',
api_key: '<string>',
base_url: '<string>',
model: '<string>'
}
]
},
custom_settings: {},
is_active: true
})
};
fetch('https://api.example.com/api/v1/assistants', 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/api/v1/assistants",
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([
'name' => '<string>',
'description' => '<string>',
'llm_provider' => 'openai',
'llm_provider_config' => [
'api_key' => '<string>',
'base_url' => '<string>',
'model' => 'gpt-4o-mini',
'custom_config' => [
]
],
'openai_api_key' => '<string>',
'custom_llm_url' => '<string>',
'deepgram_api_key' => '<string>',
'elevenlabs_api_key' => '<string>',
'twilio_config' => [
'account_sid' => '<string>',
'auth_token' => '<string>'
],
'twilio_account_sid' => '<string>',
'twilio_auth_token' => '<string>',
'llm_settings' => [
'temperature' => 0.5,
'max_tokens' => 1000,
'system_prompt' => 'You are a helpful assistant that can answer questions and help with tasks.',
'welcome_message' => '<string>',
'top_p' => 1,
'frequency_penalty' => 0,
'presence_penalty' => 0,
'stop_sequences' => [
'<string>'
]
],
'webhook_url' => '<string>',
'interruption_settings' => [
'interruption_threshold' => 3,
'min_speaking_time' => 0.5,
'interruption_cooldown' => 2
],
'tts_settings' => [
'provider' => 'elevenlabs',
'voice_id' => 'rachel',
'model_id' => 'turbo',
'latency' => 1,
'stability' => 0.5,
'similarity_boost' => 0.75,
'style' => 0,
'use_speaker_boost' => true,
'provider_config' => [
]
],
'stt_settings' => [
'model' => 'nova-2',
'language' => 'en-US',
'punctuate' => true,
'interim_results' => true,
'endpointing' => [
'silence_threshold' => 500,
'min_silence_duration' => 500
],
'utterance_end_ms' => 1000,
'vad_turnoff' => 500,
'smart_format' => true,
'keywords' => [
[
'keyword' => '<string>',
'intensifier' => 1
]
],
'keyterms' => [
'<string>'
],
'audio_denoising' => false
],
'end_call_message' => '<string>',
'transfer_call_message' => '<string>',
'idle_message' => 'Are you still there? I\'m here to help if you need anything.',
'max_idle_messages' => 123,
'idle_timeout' => 123,
'tools_settings' => [
'enabled_tools' => [
'<string>'
],
'end_call' => [
'enabled' => false,
'scenarios' => [
'<string>'
],
'custom_message' => '<string>'
],
'transfer_call' => [
'enabled' => false,
'scenarios' => [
'<string>'
],
'transfer_numbers' => [
'<string>'
],
'custom_message' => '<string>'
],
'custom_tools' => [
[
]
]
],
'rag_settings' => [
'enabled' => false,
'search_limit' => 3,
'similarity_threshold' => 0.7,
'embedding_model' => 'text-embedding-3-small',
'chunking_strategy' => 'recursive',
'chunk_size' => 1000,
'chunk_overlap' => 200,
'auto_process' => true,
'include_metadata' => true,
'context_window_tokens' => 4000
],
'llm_fallback_providers' => [
'enabled' => false,
'fallbacks' => [
[
'provider' => '<string>',
'api_key' => '<string>',
'base_url' => '<string>',
'model' => '<string>'
]
]
],
'custom_settings' => [
],
'is_active' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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/api/v1/assistants"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"llm_provider\": \"openai\",\n \"llm_provider_config\": {\n \"api_key\": \"<string>\",\n \"base_url\": \"<string>\",\n \"model\": \"gpt-4o-mini\",\n \"custom_config\": {}\n },\n \"openai_api_key\": \"<string>\",\n \"custom_llm_url\": \"<string>\",\n \"deepgram_api_key\": \"<string>\",\n \"elevenlabs_api_key\": \"<string>\",\n \"twilio_config\": {\n \"account_sid\": \"<string>\",\n \"auth_token\": \"<string>\"\n },\n \"twilio_account_sid\": \"<string>\",\n \"twilio_auth_token\": \"<string>\",\n \"llm_settings\": {\n \"temperature\": 0.5,\n \"max_tokens\": 1000,\n \"system_prompt\": \"You are a helpful assistant that can answer questions and help with tasks.\",\n \"welcome_message\": \"<string>\",\n \"top_p\": 1,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"stop_sequences\": [\n \"<string>\"\n ]\n },\n \"webhook_url\": \"<string>\",\n \"interruption_settings\": {\n \"interruption_threshold\": 3,\n \"min_speaking_time\": 0.5,\n \"interruption_cooldown\": 2\n },\n \"tts_settings\": {\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"rachel\",\n \"model_id\": \"turbo\",\n \"latency\": 1,\n \"stability\": 0.5,\n \"similarity_boost\": 0.75,\n \"style\": 0,\n \"use_speaker_boost\": true,\n \"provider_config\": {}\n },\n \"stt_settings\": {\n \"model\": \"nova-2\",\n \"language\": \"en-US\",\n \"punctuate\": true,\n \"interim_results\": true,\n \"endpointing\": {\n \"silence_threshold\": 500,\n \"min_silence_duration\": 500\n },\n \"utterance_end_ms\": 1000,\n \"vad_turnoff\": 500,\n \"smart_format\": true,\n \"keywords\": [\n {\n \"keyword\": \"<string>\",\n \"intensifier\": 1\n }\n ],\n \"keyterms\": [\n \"<string>\"\n ],\n \"audio_denoising\": false\n },\n \"end_call_message\": \"<string>\",\n \"transfer_call_message\": \"<string>\",\n \"idle_message\": \"Are you still there? I'm here to help if you need anything.\",\n \"max_idle_messages\": 123,\n \"idle_timeout\": 123,\n \"tools_settings\": {\n \"enabled_tools\": [\n \"<string>\"\n ],\n \"end_call\": {\n \"enabled\": false,\n \"scenarios\": [\n \"<string>\"\n ],\n \"custom_message\": \"<string>\"\n },\n \"transfer_call\": {\n \"enabled\": false,\n \"scenarios\": [\n \"<string>\"\n ],\n \"transfer_numbers\": [\n \"<string>\"\n ],\n \"custom_message\": \"<string>\"\n },\n \"custom_tools\": [\n {}\n ]\n },\n \"rag_settings\": {\n \"enabled\": false,\n \"search_limit\": 3,\n \"similarity_threshold\": 0.7,\n \"embedding_model\": \"text-embedding-3-small\",\n \"chunking_strategy\": \"recursive\",\n \"chunk_size\": 1000,\n \"chunk_overlap\": 200,\n \"auto_process\": true,\n \"include_metadata\": true,\n \"context_window_tokens\": 4000\n },\n \"llm_fallback_providers\": {\n \"enabled\": false,\n \"fallbacks\": [\n {\n \"provider\": \"<string>\",\n \"api_key\": \"<string>\",\n \"base_url\": \"<string>\",\n \"model\": \"<string>\"\n }\n ]\n },\n \"custom_settings\": {},\n \"is_active\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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/api/v1/assistants")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"llm_provider\": \"openai\",\n \"llm_provider_config\": {\n \"api_key\": \"<string>\",\n \"base_url\": \"<string>\",\n \"model\": \"gpt-4o-mini\",\n \"custom_config\": {}\n },\n \"openai_api_key\": \"<string>\",\n \"custom_llm_url\": \"<string>\",\n \"deepgram_api_key\": \"<string>\",\n \"elevenlabs_api_key\": \"<string>\",\n \"twilio_config\": {\n \"account_sid\": \"<string>\",\n \"auth_token\": \"<string>\"\n },\n \"twilio_account_sid\": \"<string>\",\n \"twilio_auth_token\": \"<string>\",\n \"llm_settings\": {\n \"temperature\": 0.5,\n \"max_tokens\": 1000,\n \"system_prompt\": \"You are a helpful assistant that can answer questions and help with tasks.\",\n \"welcome_message\": \"<string>\",\n \"top_p\": 1,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"stop_sequences\": [\n \"<string>\"\n ]\n },\n \"webhook_url\": \"<string>\",\n \"interruption_settings\": {\n \"interruption_threshold\": 3,\n \"min_speaking_time\": 0.5,\n \"interruption_cooldown\": 2\n },\n \"tts_settings\": {\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"rachel\",\n \"model_id\": \"turbo\",\n \"latency\": 1,\n \"stability\": 0.5,\n \"similarity_boost\": 0.75,\n \"style\": 0,\n \"use_speaker_boost\": true,\n \"provider_config\": {}\n },\n \"stt_settings\": {\n \"model\": \"nova-2\",\n \"language\": \"en-US\",\n \"punctuate\": true,\n \"interim_results\": true,\n \"endpointing\": {\n \"silence_threshold\": 500,\n \"min_silence_duration\": 500\n },\n \"utterance_end_ms\": 1000,\n \"vad_turnoff\": 500,\n \"smart_format\": true,\n \"keywords\": [\n {\n \"keyword\": \"<string>\",\n \"intensifier\": 1\n }\n ],\n \"keyterms\": [\n \"<string>\"\n ],\n \"audio_denoising\": false\n },\n \"end_call_message\": \"<string>\",\n \"transfer_call_message\": \"<string>\",\n \"idle_message\": \"Are you still there? I'm here to help if you need anything.\",\n \"max_idle_messages\": 123,\n \"idle_timeout\": 123,\n \"tools_settings\": {\n \"enabled_tools\": [\n \"<string>\"\n ],\n \"end_call\": {\n \"enabled\": false,\n \"scenarios\": [\n \"<string>\"\n ],\n \"custom_message\": \"<string>\"\n },\n \"transfer_call\": {\n \"enabled\": false,\n \"scenarios\": [\n \"<string>\"\n ],\n \"transfer_numbers\": [\n \"<string>\"\n ],\n \"custom_message\": \"<string>\"\n },\n \"custom_tools\": [\n {}\n ]\n },\n \"rag_settings\": {\n \"enabled\": false,\n \"search_limit\": 3,\n \"similarity_threshold\": 0.7,\n \"embedding_model\": \"text-embedding-3-small\",\n \"chunking_strategy\": \"recursive\",\n \"chunk_size\": 1000,\n \"chunk_overlap\": 200,\n \"auto_process\": true,\n \"include_metadata\": true,\n \"context_window_tokens\": 4000\n },\n \"llm_fallback_providers\": {\n \"enabled\": false,\n \"fallbacks\": [\n {\n \"provider\": \"<string>\",\n \"api_key\": \"<string>\",\n \"base_url\": \"<string>\",\n \"model\": \"<string>\"\n }\n ]\n },\n \"custom_settings\": {},\n \"is_active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/assistants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"llm_provider\": \"openai\",\n \"llm_provider_config\": {\n \"api_key\": \"<string>\",\n \"base_url\": \"<string>\",\n \"model\": \"gpt-4o-mini\",\n \"custom_config\": {}\n },\n \"openai_api_key\": \"<string>\",\n \"custom_llm_url\": \"<string>\",\n \"deepgram_api_key\": \"<string>\",\n \"elevenlabs_api_key\": \"<string>\",\n \"twilio_config\": {\n \"account_sid\": \"<string>\",\n \"auth_token\": \"<string>\"\n },\n \"twilio_account_sid\": \"<string>\",\n \"twilio_auth_token\": \"<string>\",\n \"llm_settings\": {\n \"temperature\": 0.5,\n \"max_tokens\": 1000,\n \"system_prompt\": \"You are a helpful assistant that can answer questions and help with tasks.\",\n \"welcome_message\": \"<string>\",\n \"top_p\": 1,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"stop_sequences\": [\n \"<string>\"\n ]\n },\n \"webhook_url\": \"<string>\",\n \"interruption_settings\": {\n \"interruption_threshold\": 3,\n \"min_speaking_time\": 0.5,\n \"interruption_cooldown\": 2\n },\n \"tts_settings\": {\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"rachel\",\n \"model_id\": \"turbo\",\n \"latency\": 1,\n \"stability\": 0.5,\n \"similarity_boost\": 0.75,\n \"style\": 0,\n \"use_speaker_boost\": true,\n \"provider_config\": {}\n },\n \"stt_settings\": {\n \"model\": \"nova-2\",\n \"language\": \"en-US\",\n \"punctuate\": true,\n \"interim_results\": true,\n \"endpointing\": {\n \"silence_threshold\": 500,\n \"min_silence_duration\": 500\n },\n \"utterance_end_ms\": 1000,\n \"vad_turnoff\": 500,\n \"smart_format\": true,\n \"keywords\": [\n {\n \"keyword\": \"<string>\",\n \"intensifier\": 1\n }\n ],\n \"keyterms\": [\n \"<string>\"\n ],\n \"audio_denoising\": false\n },\n \"end_call_message\": \"<string>\",\n \"transfer_call_message\": \"<string>\",\n \"idle_message\": \"Are you still there? I'm here to help if you need anything.\",\n \"max_idle_messages\": 123,\n \"idle_timeout\": 123,\n \"tools_settings\": {\n \"enabled_tools\": [\n \"<string>\"\n ],\n \"end_call\": {\n \"enabled\": false,\n \"scenarios\": [\n \"<string>\"\n ],\n \"custom_message\": \"<string>\"\n },\n \"transfer_call\": {\n \"enabled\": false,\n \"scenarios\": [\n \"<string>\"\n ],\n \"transfer_numbers\": [\n \"<string>\"\n ],\n \"custom_message\": \"<string>\"\n },\n \"custom_tools\": [\n {}\n ]\n },\n \"rag_settings\": {\n \"enabled\": false,\n \"search_limit\": 3,\n \"similarity_threshold\": 0.7,\n \"embedding_model\": \"text-embedding-3-small\",\n \"chunking_strategy\": \"recursive\",\n \"chunk_size\": 1000,\n \"chunk_overlap\": 200,\n \"auto_process\": true,\n \"include_metadata\": true,\n \"context_window_tokens\": 4000\n },\n \"llm_fallback_providers\": {\n \"enabled\": false,\n \"fallbacks\": [\n {\n \"provider\": \"<string>\",\n \"api_key\": \"<string>\",\n \"base_url\": \"<string>\",\n \"model\": \"<string>\"\n }\n ]\n },\n \"custom_settings\": {},\n \"is_active\": true\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"id": 123,
"organization_id": 123,
"user_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"llm_provider": "openai",
"llm_provider_config": {
"api_key": "<string>",
"base_url": "<string>",
"model": "gpt-4o-mini",
"custom_config": {}
},
"twilio_config": {
"account_sid": "<string>",
"auth_token": "<string>"
},
"llm_settings": {
"temperature": 0.5,
"max_tokens": 1000,
"system_prompt": "You are a helpful assistant that can answer questions and help with tasks.",
"welcome_message": "<string>",
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0,
"stop_sequences": [
"<string>"
]
},
"webhook_url": "<string>",
"interruption_settings": {
"interruption_threshold": 3,
"min_speaking_time": 0.5,
"interruption_cooldown": 2
},
"tts_settings": {
"provider": "elevenlabs",
"voice_id": "rachel",
"model_id": "turbo",
"latency": 1,
"stability": 0.5,
"similarity_boost": 0.75,
"style": 0,
"use_speaker_boost": true,
"provider_config": {}
},
"stt_settings": {
"model": "nova-2",
"language": "en-US",
"punctuate": true,
"interim_results": true,
"endpointing": {
"silence_threshold": 500,
"min_silence_duration": 500
},
"utterance_end_ms": 1000,
"vad_turnoff": 500,
"smart_format": true,
"keywords": [
{
"keyword": "<string>",
"intensifier": 1
}
],
"keyterms": [
"<string>"
],
"audio_denoising": false
},
"end_call_message": "<string>",
"transfer_call_message": "<string>",
"idle_message": "Are you still there? I'm here to help if you need anything.",
"max_idle_messages": 123,
"idle_timeout": 123,
"tools_settings": {
"enabled_tools": [
"<string>"
],
"end_call": {
"enabled": false,
"scenarios": [
"<string>"
],
"custom_message": "<string>"
},
"transfer_call": {
"enabled": false,
"scenarios": [
"<string>"
],
"transfer_numbers": [
"<string>"
],
"custom_message": "<string>"
},
"custom_tools": [
{}
]
},
"rag_settings": {
"enabled": false,
"search_limit": 3,
"similarity_threshold": 0.7,
"embedding_model": "text-embedding-3-small",
"chunking_strategy": "recursive",
"chunk_size": 1000,
"chunk_overlap": 200,
"auto_process": true,
"include_metadata": true,
"context_window_tokens": 4000
},
"llm_fallback_providers": {
"enabled": false,
"fallbacks": [
{
"provider": "<string>",
"api_key": "<string>",
"base_url": "<string>",
"model": "<string>"
}
]
},
"custom_settings": {},
"is_active": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Request Body
The request body is a JSON object containing the assistant’s configuration. The parameters are organized into logical groups that mirror the sections in the UI. Many parameters are conditional based on the provider or options you select.Basic Information
Basic Information
name(string, required): A unique name for your assistant.description(string, optional): A brief description of the assistant’s purpose.is_active(boolean, optional): Set totrueto allow the assistant to handle calls. Defaults totrue.
AI Configuration
AI Configuration
llm_provider(string): The language model provider.- Enum:
"openai","anthropic","gemini","groq","xai","custom". Defaults toopenai.
- Enum:
llm_provider_config(object): Provider-specific configuration.api_key(string, required): The API key for the selected provider.model(string, optional): The specific model to use (e.g.,gpt-4o-mini).base_url(string, optional): A custom API base URL. Required ifllm_provideriscustom.
llm_settings(object): General parameters for the language model.temperature(number): Controls creativity. Defaults to0.7.max_tokens(integer): Max length of the AI’s response in tokens. Defaults to1000.system_prompt(string): The AI’s personality and instructions.welcome_message(string): The first thing the assistant says to the caller.
llm_fallback_providers(object, optional): Configure backup LLM providers.enabled(boolean): Set totrueto enable fallbacks.fallbacks(array of objects): An ordered list of fallback providers. Each object containsprovider,model,api_key, andbase_url.
tts_settings(object):provider(string): The TTS provider. Enum:"elevenlabs","deepgram","inworld","resemble".voice_id(string): The specific voice character to use (e.g.,rachel).model_id(string, optional): The voice model (e.g.,eleven_flash_v2_5).- Conditional Fields:
- If
provideriselevenlabs:stability(number): Voice consistency.similarity_boost(number): Voice accuracy.style(number): Speaking style variation.use_speaker_boost(boolean): Enhances audio quality.
- If
providerisresemble:provider_config.project_uuid(string): Your Resemble AI project UUID.
- If
providerisinworld:provider_config.language(string): Language code (e.g.,en).
- If
stt_settings(object):model(string): The STT model (e.g.,nova-2,nova-3).language(string): Language code (e.g.,en-US).keywords(array of objects, optional): An array of keywords to boost. Each object should have akeyword(string) and an optionalintensifier(float). Fornova-2and older models.keyterms(array of strings, optional): An array of key terms to boost. Fornova-3model only.
Call & Interruption Management
Call & Interruption Management
interruption_settings(object):interruption_threshold(integer): Number of words a user must speak to interrupt.min_speaking_time(number): How long the assistant must speak before being interruptible (in seconds).interruption_cooldown(number): Cooldown period after an interruption (in seconds).
idle_message(string, optional): Message sent when the caller is silent.max_idle_messages(integer, optional): How many idle messages to send before ending the call.idle_timeout(integer, optional): Seconds of silence before sending an idle message.
Tools
Tools
tools_settings(object): Configure built-in tools.end_call(object, optional):enabled(boolean): Enable/disable the tool.scenarios(array of strings): Phrases that will trigger ending the call.
transfer_call(object, optional):enabled(boolean): Enable/disable the tool.scenarios(array of strings): Phrases that will trigger a transfer.transfer_numbers(array of strings): Phone numbers where calls can be transferred.
Advanced & Integration
Advanced & Integration
custom_settings(object, optional): For advanced data extraction.structured_data_prompt(string): Custom instructions for the AI on how to extract data.structured_data_schema(object): A JSON schema defining the data to be extracted.
twilio_config(object, optional): Bring your own Twilio credentials.account_sid(string): Your Twilio Account SID.auth_token(string): Your Twilio Auth Token.
webhook_url(string, optional): A URL to send call event webhooks to.
Example Request
Here is an example payload that mirrors the fields available in the UI to create a sophisticated customer service assistant. Note that fields likescenarios and transfer_numbers expect a JSON array of strings.
{
"name": "ServiceBot 5000",
"description": "Handles initial customer service questions and escalations.",
"is_active": true,
"llm_provider": "openai",
"llm_provider_config": {
"model": "gpt-4o-mini",
"api_key": "sk-your-openai-api-key"
},
"llm_settings": {
"temperature": 0.7,
"max_tokens": 1000,
"system_prompt": "You are a friendly and efficient customer support agent. Your goal is to help with common questions and transfer to a human when requested.",
"welcome_message": "Hello! Thanks for calling support. How can I assist you today?"
},
"tts_settings": {
"provider": "elevenlabs",
"voice_id": "rachel",
"model_id": "eleven_flash_v2_5",
"stability": 0.5,
"similarity_boost": 0.75,
"style": 0.0,
"use_speaker_boost": true
},
"stt_settings": {
"model": "nova-2",
"language": "en-US",
"keywords": [
{"keyword": "agent", "intensifier": 1.5},
{"keyword": "human"},
{"keyword": "representative"}
]
},
"interruption_settings": {
"interruption_threshold": 3,
"min_speaking_time": 0.5,
"interruption_cooldown": 2.0
},
"idle_message": "Are you still there? I'm here to help if you need anything.",
"max_idle_messages": 2,
"idle_timeout": 20,
"tools_settings": {
"transfer_call": {
"enabled": true,
"scenarios": [
"speak to an agent",
"talk to a human",
"transfer me to a representative"
],
"transfer_numbers": [
"+18005551212"
]
}
},
"webhook_url": "https://yourapi.com/webhooks/call-events"
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Schema for creating a new assistant.
LLM provider: openai, anthropic, gemini, xai, groq, custom
Configuration for the selected LLM provider.
Show child attributes
Show child attributes
Twilio account configuration.
Show child attributes
Show child attributes
Settings for the Large Language Model.
Show child attributes
Show child attributes
Settings for call interruption behavior.
Show child attributes
Show child attributes
Settings for Text-to-Speech (TTS) service.
Show child attributes
Show child attributes
Settings for Speech-to-Text (STT) service.
Show child attributes
Show child attributes
Settings for integrated tools.
Show child attributes
Show child attributes
Settings for Retrieval-Augmented Generation (RAG).
Show child attributes
Show child attributes
Settings for LLM fallback providers.
Show child attributes
Show child attributes
Response
Successful Response
Schema for assistant response.
LLM provider: openai, anthropic, gemini, xai, groq, custom
Configuration for the selected LLM provider.
Show child attributes
Show child attributes
Twilio account configuration.
Show child attributes
Show child attributes
Settings for the Large Language Model.
Show child attributes
Show child attributes
Settings for call interruption behavior.
Show child attributes
Show child attributes
Settings for Text-to-Speech (TTS) service.
Show child attributes
Show child attributes
Settings for Speech-to-Text (STT) service.
Show child attributes
Show child attributes
Settings for integrated tools.
Show child attributes
Show child attributes
Settings for Retrieval-Augmented Generation (RAG).
Show child attributes
Show child attributes
Settings for LLM fallback providers.
Show child attributes
Show child attributes