curl --request POST \
--url http://localhost:3000/api/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Customer Support Agent",
"instructions": "You are a helpful customer support agent...",
"description": "An AI agent that helps customers with their inquiries",
"policy": "Refunds are only allowed within 30 days of purchase. Escalate complaints about billing errors to a human agent.",
"modelConfig": {
"model": "openai/gpt-4o",
"modelSettings": {
"temperature": 0.7
}
},
"voiceConfig": {
"pipelineMode": "batch",
"voiceId": "EXAVITQdyfvLewQXW32eyLI"
},
"memoryConfig": {
"enabled": true,
"lastMessages": 20
},
"metadata": {
"category": "support"
},
"knowledgeBaseConfig": {
"knowledgeBaseId": "550e8400-e29b-41d4-a716-446655440000",
"topK": 5,
"similarityThreshold": 0.7
},
"resolutionCriteria": [
{
"label": "Payment confirmed",
"description": "Customer confirms the payment date and amount"
}
]
}
'import requests
url = "http://localhost:3000/api/agents"
payload = {
"name": "Customer Support Agent",
"instructions": "You are a helpful customer support agent...",
"description": "An AI agent that helps customers with their inquiries",
"policy": "Refunds are only allowed within 30 days of purchase. Escalate complaints about billing errors to a human agent.",
"modelConfig": {
"model": "openai/gpt-4o",
"modelSettings": { "temperature": 0.7 }
},
"voiceConfig": {
"pipelineMode": "batch",
"voiceId": "EXAVITQdyfvLewQXW32eyLI"
},
"memoryConfig": {
"enabled": True,
"lastMessages": 20
},
"metadata": { "category": "support" },
"knowledgeBaseConfig": {
"knowledgeBaseId": "550e8400-e29b-41d4-a716-446655440000",
"topK": 5,
"similarityThreshold": 0.7
},
"resolutionCriteria": [
{
"label": "Payment confirmed",
"description": "Customer confirms the payment date and amount"
}
]
}
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: 'Customer Support Agent',
instructions: 'You are a helpful customer support agent...',
description: 'An AI agent that helps customers with their inquiries',
policy: 'Refunds are only allowed within 30 days of purchase. Escalate complaints about billing errors to a human agent.',
modelConfig: {model: 'openai/gpt-4o', modelSettings: {temperature: 0.7}},
voiceConfig: {pipelineMode: 'batch', voiceId: 'EXAVITQdyfvLewQXW32eyLI'},
memoryConfig: {enabled: true, lastMessages: 20},
metadata: {category: 'support'},
knowledgeBaseConfig: {
knowledgeBaseId: '550e8400-e29b-41d4-a716-446655440000',
topK: 5,
similarityThreshold: 0.7
},
resolutionCriteria: [
{
label: 'Payment confirmed',
description: 'Customer confirms the payment date and amount'
}
]
})
};
fetch('http://localhost:3000/api/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_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/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([
'name' => 'Customer Support Agent',
'instructions' => 'You are a helpful customer support agent...',
'description' => 'An AI agent that helps customers with their inquiries',
'policy' => 'Refunds are only allowed within 30 days of purchase. Escalate complaints about billing errors to a human agent.',
'modelConfig' => [
'model' => 'openai/gpt-4o',
'modelSettings' => [
'temperature' => 0.7
]
],
'voiceConfig' => [
'pipelineMode' => 'batch',
'voiceId' => 'EXAVITQdyfvLewQXW32eyLI'
],
'memoryConfig' => [
'enabled' => true,
'lastMessages' => 20
],
'metadata' => [
'category' => 'support'
],
'knowledgeBaseConfig' => [
'knowledgeBaseId' => '550e8400-e29b-41d4-a716-446655440000',
'topK' => 5,
'similarityThreshold' => 0.7
],
'resolutionCriteria' => [
[
'label' => 'Payment confirmed',
'description' => 'Customer confirms the payment date and amount'
]
]
]),
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 := "http://localhost:3000/api/agents"
payload := strings.NewReader("{\n \"name\": \"Customer Support Agent\",\n \"instructions\": \"You are a helpful customer support agent...\",\n \"description\": \"An AI agent that helps customers with their inquiries\",\n \"policy\": \"Refunds are only allowed within 30 days of purchase. Escalate complaints about billing errors to a human agent.\",\n \"modelConfig\": {\n \"model\": \"openai/gpt-4o\",\n \"modelSettings\": {\n \"temperature\": 0.7\n }\n },\n \"voiceConfig\": {\n \"pipelineMode\": \"batch\",\n \"voiceId\": \"EXAVITQdyfvLewQXW32eyLI\"\n },\n \"memoryConfig\": {\n \"enabled\": true,\n \"lastMessages\": 20\n },\n \"metadata\": {\n \"category\": \"support\"\n },\n \"knowledgeBaseConfig\": {\n \"knowledgeBaseId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"topK\": 5,\n \"similarityThreshold\": 0.7\n },\n \"resolutionCriteria\": [\n {\n \"label\": \"Payment confirmed\",\n \"description\": \"Customer confirms the payment date and amount\"\n }\n ]\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("http://localhost:3000/api/agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Customer Support Agent\",\n \"instructions\": \"You are a helpful customer support agent...\",\n \"description\": \"An AI agent that helps customers with their inquiries\",\n \"policy\": \"Refunds are only allowed within 30 days of purchase. Escalate complaints about billing errors to a human agent.\",\n \"modelConfig\": {\n \"model\": \"openai/gpt-4o\",\n \"modelSettings\": {\n \"temperature\": 0.7\n }\n },\n \"voiceConfig\": {\n \"pipelineMode\": \"batch\",\n \"voiceId\": \"EXAVITQdyfvLewQXW32eyLI\"\n },\n \"memoryConfig\": {\n \"enabled\": true,\n \"lastMessages\": 20\n },\n \"metadata\": {\n \"category\": \"support\"\n },\n \"knowledgeBaseConfig\": {\n \"knowledgeBaseId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"topK\": 5,\n \"similarityThreshold\": 0.7\n },\n \"resolutionCriteria\": [\n {\n \"label\": \"Payment confirmed\",\n \"description\": \"Customer confirms the payment date and amount\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/agents")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Customer Support Agent\",\n \"instructions\": \"You are a helpful customer support agent...\",\n \"description\": \"An AI agent that helps customers with their inquiries\",\n \"policy\": \"Refunds are only allowed within 30 days of purchase. Escalate complaints about billing errors to a human agent.\",\n \"modelConfig\": {\n \"model\": \"openai/gpt-4o\",\n \"modelSettings\": {\n \"temperature\": 0.7\n }\n },\n \"voiceConfig\": {\n \"pipelineMode\": \"batch\",\n \"voiceId\": \"EXAVITQdyfvLewQXW32eyLI\"\n },\n \"memoryConfig\": {\n \"enabled\": true,\n \"lastMessages\": 20\n },\n \"metadata\": {\n \"category\": \"support\"\n },\n \"knowledgeBaseConfig\": {\n \"knowledgeBaseId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"topK\": 5,\n \"similarityThreshold\": 0.7\n },\n \"resolutionCriteria\": [\n {\n \"label\": \"Payment confirmed\",\n \"description\": \"Customer confirms the payment date and amount\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"organizationId": "<string>",
"name": "Customer Support Agent",
"instructions": "<string>",
"version": 123,
"modelConfig": {
"model": "openai/gpt-4o",
"modelSettings": {},
"providerOptions": {}
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"policy": "<string>",
"voiceConfig": {
"pipelineMode": "batch",
"voiceId": "EXAVITQdyfvLewQXW32eyLI",
"stsProvider": "openai"
},
"memoryConfig": {
"enabled": true,
"lastMessages": 20,
"semanticRecall": false
},
"metadata": {},
"knowledgeBaseConfig": {},
"createdBy": "<string>"
}Create a new agent
curl --request POST \
--url http://localhost:3000/api/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Customer Support Agent",
"instructions": "You are a helpful customer support agent...",
"description": "An AI agent that helps customers with their inquiries",
"policy": "Refunds are only allowed within 30 days of purchase. Escalate complaints about billing errors to a human agent.",
"modelConfig": {
"model": "openai/gpt-4o",
"modelSettings": {
"temperature": 0.7
}
},
"voiceConfig": {
"pipelineMode": "batch",
"voiceId": "EXAVITQdyfvLewQXW32eyLI"
},
"memoryConfig": {
"enabled": true,
"lastMessages": 20
},
"metadata": {
"category": "support"
},
"knowledgeBaseConfig": {
"knowledgeBaseId": "550e8400-e29b-41d4-a716-446655440000",
"topK": 5,
"similarityThreshold": 0.7
},
"resolutionCriteria": [
{
"label": "Payment confirmed",
"description": "Customer confirms the payment date and amount"
}
]
}
'import requests
url = "http://localhost:3000/api/agents"
payload = {
"name": "Customer Support Agent",
"instructions": "You are a helpful customer support agent...",
"description": "An AI agent that helps customers with their inquiries",
"policy": "Refunds are only allowed within 30 days of purchase. Escalate complaints about billing errors to a human agent.",
"modelConfig": {
"model": "openai/gpt-4o",
"modelSettings": { "temperature": 0.7 }
},
"voiceConfig": {
"pipelineMode": "batch",
"voiceId": "EXAVITQdyfvLewQXW32eyLI"
},
"memoryConfig": {
"enabled": True,
"lastMessages": 20
},
"metadata": { "category": "support" },
"knowledgeBaseConfig": {
"knowledgeBaseId": "550e8400-e29b-41d4-a716-446655440000",
"topK": 5,
"similarityThreshold": 0.7
},
"resolutionCriteria": [
{
"label": "Payment confirmed",
"description": "Customer confirms the payment date and amount"
}
]
}
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: 'Customer Support Agent',
instructions: 'You are a helpful customer support agent...',
description: 'An AI agent that helps customers with their inquiries',
policy: 'Refunds are only allowed within 30 days of purchase. Escalate complaints about billing errors to a human agent.',
modelConfig: {model: 'openai/gpt-4o', modelSettings: {temperature: 0.7}},
voiceConfig: {pipelineMode: 'batch', voiceId: 'EXAVITQdyfvLewQXW32eyLI'},
memoryConfig: {enabled: true, lastMessages: 20},
metadata: {category: 'support'},
knowledgeBaseConfig: {
knowledgeBaseId: '550e8400-e29b-41d4-a716-446655440000',
topK: 5,
similarityThreshold: 0.7
},
resolutionCriteria: [
{
label: 'Payment confirmed',
description: 'Customer confirms the payment date and amount'
}
]
})
};
fetch('http://localhost:3000/api/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_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/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([
'name' => 'Customer Support Agent',
'instructions' => 'You are a helpful customer support agent...',
'description' => 'An AI agent that helps customers with their inquiries',
'policy' => 'Refunds are only allowed within 30 days of purchase. Escalate complaints about billing errors to a human agent.',
'modelConfig' => [
'model' => 'openai/gpt-4o',
'modelSettings' => [
'temperature' => 0.7
]
],
'voiceConfig' => [
'pipelineMode' => 'batch',
'voiceId' => 'EXAVITQdyfvLewQXW32eyLI'
],
'memoryConfig' => [
'enabled' => true,
'lastMessages' => 20
],
'metadata' => [
'category' => 'support'
],
'knowledgeBaseConfig' => [
'knowledgeBaseId' => '550e8400-e29b-41d4-a716-446655440000',
'topK' => 5,
'similarityThreshold' => 0.7
],
'resolutionCriteria' => [
[
'label' => 'Payment confirmed',
'description' => 'Customer confirms the payment date and amount'
]
]
]),
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 := "http://localhost:3000/api/agents"
payload := strings.NewReader("{\n \"name\": \"Customer Support Agent\",\n \"instructions\": \"You are a helpful customer support agent...\",\n \"description\": \"An AI agent that helps customers with their inquiries\",\n \"policy\": \"Refunds are only allowed within 30 days of purchase. Escalate complaints about billing errors to a human agent.\",\n \"modelConfig\": {\n \"model\": \"openai/gpt-4o\",\n \"modelSettings\": {\n \"temperature\": 0.7\n }\n },\n \"voiceConfig\": {\n \"pipelineMode\": \"batch\",\n \"voiceId\": \"EXAVITQdyfvLewQXW32eyLI\"\n },\n \"memoryConfig\": {\n \"enabled\": true,\n \"lastMessages\": 20\n },\n \"metadata\": {\n \"category\": \"support\"\n },\n \"knowledgeBaseConfig\": {\n \"knowledgeBaseId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"topK\": 5,\n \"similarityThreshold\": 0.7\n },\n \"resolutionCriteria\": [\n {\n \"label\": \"Payment confirmed\",\n \"description\": \"Customer confirms the payment date and amount\"\n }\n ]\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("http://localhost:3000/api/agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Customer Support Agent\",\n \"instructions\": \"You are a helpful customer support agent...\",\n \"description\": \"An AI agent that helps customers with their inquiries\",\n \"policy\": \"Refunds are only allowed within 30 days of purchase. Escalate complaints about billing errors to a human agent.\",\n \"modelConfig\": {\n \"model\": \"openai/gpt-4o\",\n \"modelSettings\": {\n \"temperature\": 0.7\n }\n },\n \"voiceConfig\": {\n \"pipelineMode\": \"batch\",\n \"voiceId\": \"EXAVITQdyfvLewQXW32eyLI\"\n },\n \"memoryConfig\": {\n \"enabled\": true,\n \"lastMessages\": 20\n },\n \"metadata\": {\n \"category\": \"support\"\n },\n \"knowledgeBaseConfig\": {\n \"knowledgeBaseId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"topK\": 5,\n \"similarityThreshold\": 0.7\n },\n \"resolutionCriteria\": [\n {\n \"label\": \"Payment confirmed\",\n \"description\": \"Customer confirms the payment date and amount\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/agents")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Customer Support Agent\",\n \"instructions\": \"You are a helpful customer support agent...\",\n \"description\": \"An AI agent that helps customers with their inquiries\",\n \"policy\": \"Refunds are only allowed within 30 days of purchase. Escalate complaints about billing errors to a human agent.\",\n \"modelConfig\": {\n \"model\": \"openai/gpt-4o\",\n \"modelSettings\": {\n \"temperature\": 0.7\n }\n },\n \"voiceConfig\": {\n \"pipelineMode\": \"batch\",\n \"voiceId\": \"EXAVITQdyfvLewQXW32eyLI\"\n },\n \"memoryConfig\": {\n \"enabled\": true,\n \"lastMessages\": 20\n },\n \"metadata\": {\n \"category\": \"support\"\n },\n \"knowledgeBaseConfig\": {\n \"knowledgeBaseId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"topK\": 5,\n \"similarityThreshold\": 0.7\n },\n \"resolutionCriteria\": [\n {\n \"label\": \"Payment confirmed\",\n \"description\": \"Customer confirms the payment date and amount\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"organizationId": "<string>",
"name": "Customer Support Agent",
"instructions": "<string>",
"version": 123,
"modelConfig": {
"model": "openai/gpt-4o",
"modelSettings": {},
"providerOptions": {}
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"policy": "<string>",
"voiceConfig": {
"pipelineMode": "batch",
"voiceId": "EXAVITQdyfvLewQXW32eyLI",
"stsProvider": "openai"
},
"memoryConfig": {
"enabled": true,
"lastMessages": 20,
"semanticRecall": false
},
"metadata": {},
"knowledgeBaseConfig": {},
"createdBy": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Agent name
1 - 128"Customer Support Agent"
Agent instructions (system prompt)
10000"You are a helpful customer support agent..."
Agent description
2000"An AI agent that helps customers with their inquiries"
Agent policy — business rules auto-injected into the prompt (hidden from callers)
10000"Refunds are only allowed within 30 days of purchase. Escalate complaints about billing errors to a human agent."
Model configuration
Show child attributes
Show child attributes
{
"model": "openai/gpt-4o",
"modelSettings": { "temperature": 0.7 }
}
Voice pipeline configuration
Show child attributes
Show child attributes
{
"pipelineMode": "batch",
"voiceId": "EXAVITQdyfvLewQXW32eyLI"
}
Memory configuration
Show child attributes
Show child attributes
{ "enabled": true, "lastMessages": 20 }
Additional metadata
{ "category": "support" }
Knowledge base configuration for RAG
Show child attributes
Show child attributes
{
"knowledgeBaseId": "550e8400-e29b-41d4-a716-446655440000",
"topK": 5,
"similarityThreshold": 0.7
}
Resolution criteria for evaluating conversation outcomes (max 5)
Show child attributes
Show child attributes
[
{
"label": "Payment confirmed",
"description": "Customer confirms the payment date and amount"
}
]
Response
Agent created successfully
Agent ID
Organization ID
Agent name
"Customer Support Agent"
Agent instructions
Agent status
draft, active, archived Agent version
Model configuration
Show child attributes
Show child attributes
Created at timestamp
Updated at timestamp
Agent description
Agent policy (business rules)
Voice configuration
Show child attributes
Show child attributes
Memory configuration
Show child attributes
Show child attributes
Additional metadata
Knowledge base configuration for RAG
Created by user ID