Create a new agent
curl --request POST \
--url https://api.iwy.ai/v1/agent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Customer Service Bot",
"publish_status": "draft",
"configuration": {
"llm": {
"model": "gemini-2.0-flash",
"provider": "google",
"system_prompt": "You are a helpful customer service assistant",
"first_message": "Hello! How can I help you today?",
"cost_per_minute": 0.001532
},
"stt": {
"model": "nova-3-general",
"provider": "deepgram",
"cost_per_minute": 0.01
},
"tts": {
"provider": "elevenlabs",
"voice_id": "21m00Tcm4TlvDq8ikWAM",
"cost_per_minute": 0.03
},
"video": {
"provider": "binary",
"character_id": "0001",
"cost_per_minute": 0
},
"version": "1.0",
"tool_calling": {
"selected_tool_ids": []
},
"end_of_conversation": {
"callback_url": "",
"send_data_on_end": false
}
}
}
'import requests
url = "https://api.iwy.ai/v1/agent"
payload = {
"name": "Customer Service Bot",
"publish_status": "draft",
"configuration": {
"llm": {
"model": "gemini-2.0-flash",
"provider": "google",
"system_prompt": "You are a helpful customer service assistant",
"first_message": "Hello! How can I help you today?",
"cost_per_minute": 0.001532
},
"stt": {
"model": "nova-3-general",
"provider": "deepgram",
"cost_per_minute": 0.01
},
"tts": {
"provider": "elevenlabs",
"voice_id": "21m00Tcm4TlvDq8ikWAM",
"cost_per_minute": 0.03
},
"video": {
"provider": "binary",
"character_id": "0001",
"cost_per_minute": 0
},
"version": "1.0",
"tool_calling": { "selected_tool_ids": [] },
"end_of_conversation": {
"callback_url": "",
"send_data_on_end": False
}
}
}
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 Service Bot',
publish_status: 'draft',
configuration: {
llm: {
model: 'gemini-2.0-flash',
provider: 'google',
system_prompt: 'You are a helpful customer service assistant',
first_message: 'Hello! How can I help you today?',
cost_per_minute: 0.001532
},
stt: {model: 'nova-3-general', provider: 'deepgram', cost_per_minute: 0.01},
tts: {
provider: 'elevenlabs',
voice_id: '21m00Tcm4TlvDq8ikWAM',
cost_per_minute: 0.03
},
video: {provider: 'binary', character_id: '0001', cost_per_minute: 0},
version: '1.0',
tool_calling: {selected_tool_ids: []},
end_of_conversation: {callback_url: '', send_data_on_end: false}
}
})
};
fetch('https://api.iwy.ai/v1/agent', 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.iwy.ai/v1/agent",
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 Service Bot',
'publish_status' => 'draft',
'configuration' => [
'llm' => [
'model' => 'gemini-2.0-flash',
'provider' => 'google',
'system_prompt' => 'You are a helpful customer service assistant',
'first_message' => 'Hello! How can I help you today?',
'cost_per_minute' => 0.001532
],
'stt' => [
'model' => 'nova-3-general',
'provider' => 'deepgram',
'cost_per_minute' => 0.01
],
'tts' => [
'provider' => 'elevenlabs',
'voice_id' => '21m00Tcm4TlvDq8ikWAM',
'cost_per_minute' => 0.03
],
'video' => [
'provider' => 'binary',
'character_id' => '0001',
'cost_per_minute' => 0
],
'version' => '1.0',
'tool_calling' => [
'selected_tool_ids' => [
]
],
'end_of_conversation' => [
'callback_url' => '',
'send_data_on_end' => false
]
]
]),
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.iwy.ai/v1/agent"
payload := strings.NewReader("{\n \"name\": \"Customer Service Bot\",\n \"publish_status\": \"draft\",\n \"configuration\": {\n \"llm\": {\n \"model\": \"gemini-2.0-flash\",\n \"provider\": \"google\",\n \"system_prompt\": \"You are a helpful customer service assistant\",\n \"first_message\": \"Hello! How can I help you today?\",\n \"cost_per_minute\": 0.001532\n },\n \"stt\": {\n \"model\": \"nova-3-general\",\n \"provider\": \"deepgram\",\n \"cost_per_minute\": 0.01\n },\n \"tts\": {\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"21m00Tcm4TlvDq8ikWAM\",\n \"cost_per_minute\": 0.03\n },\n \"video\": {\n \"provider\": \"binary\",\n \"character_id\": \"0001\",\n \"cost_per_minute\": 0\n },\n \"version\": \"1.0\",\n \"tool_calling\": {\n \"selected_tool_ids\": []\n },\n \"end_of_conversation\": {\n \"callback_url\": \"\",\n \"send_data_on_end\": false\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("https://api.iwy.ai/v1/agent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Customer Service Bot\",\n \"publish_status\": \"draft\",\n \"configuration\": {\n \"llm\": {\n \"model\": \"gemini-2.0-flash\",\n \"provider\": \"google\",\n \"system_prompt\": \"You are a helpful customer service assistant\",\n \"first_message\": \"Hello! How can I help you today?\",\n \"cost_per_minute\": 0.001532\n },\n \"stt\": {\n \"model\": \"nova-3-general\",\n \"provider\": \"deepgram\",\n \"cost_per_minute\": 0.01\n },\n \"tts\": {\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"21m00Tcm4TlvDq8ikWAM\",\n \"cost_per_minute\": 0.03\n },\n \"video\": {\n \"provider\": \"binary\",\n \"character_id\": \"0001\",\n \"cost_per_minute\": 0\n },\n \"version\": \"1.0\",\n \"tool_calling\": {\n \"selected_tool_ids\": []\n },\n \"end_of_conversation\": {\n \"callback_url\": \"\",\n \"send_data_on_end\": false\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.iwy.ai/v1/agent")
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\": \"Customer Service Bot\",\n \"publish_status\": \"draft\",\n \"configuration\": {\n \"llm\": {\n \"model\": \"gemini-2.0-flash\",\n \"provider\": \"google\",\n \"system_prompt\": \"You are a helpful customer service assistant\",\n \"first_message\": \"Hello! How can I help you today?\",\n \"cost_per_minute\": 0.001532\n },\n \"stt\": {\n \"model\": \"nova-3-general\",\n \"provider\": \"deepgram\",\n \"cost_per_minute\": 0.01\n },\n \"tts\": {\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"21m00Tcm4TlvDq8ikWAM\",\n \"cost_per_minute\": 0.03\n },\n \"video\": {\n \"provider\": \"binary\",\n \"character_id\": \"0001\",\n \"cost_per_minute\": 0\n },\n \"version\": \"1.0\",\n \"tool_calling\": {\n \"selected_tool_ids\": []\n },\n \"end_of_conversation\": {\n \"callback_url\": \"\",\n \"send_data_on_end\": false\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"configuration": {
"llm": {
"model": "gemini-2.0-flash",
"provider": "google",
"system_prompt": "You are a helpful customer service assistant",
"first_message": "Hello! How can I help you today?",
"voice": "<string>",
"custom_url": "<string>",
"cost_per_minute": 0.001532
},
"stt": {
"model": "nova-3-general",
"provider": "deepgram",
"cost_per_minute": 0.01
},
"tts": {
"provider": "elevenlabs",
"voice_id": "21m00Tcm4TlvDq8ikWAM",
"cost_per_minute": 0.03
},
"video": {
"provider": "binary",
"character_id": "0001",
"cost_per_minute": 0
},
"tool_calling": {
"selected_tool_ids": [
"dcfae097-1b37-4444-bb0c-1a6abb0320fd"
]
},
"end_of_conversation": {
"callback_url": "<string>",
"send_data_on_end": false
}
},
"publish_status": "draft",
"metadata": {}
}{
"success": false,
"error": "Bad request",
"details": "Missing required field: name"
}{
"success": false,
"error": "Unauthorized",
"details": "Invalid or missing API key"
}{
"success": false,
"error": "Internal server error",
"details": "An unexpected error occurred"
}Permanent Agents
Create a new agent
Creates a new agent with the specified configuration. The agent will be linked to your account and can be used immediately.
POST
/
agent
Create a new agent
curl --request POST \
--url https://api.iwy.ai/v1/agent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Customer Service Bot",
"publish_status": "draft",
"configuration": {
"llm": {
"model": "gemini-2.0-flash",
"provider": "google",
"system_prompt": "You are a helpful customer service assistant",
"first_message": "Hello! How can I help you today?",
"cost_per_minute": 0.001532
},
"stt": {
"model": "nova-3-general",
"provider": "deepgram",
"cost_per_minute": 0.01
},
"tts": {
"provider": "elevenlabs",
"voice_id": "21m00Tcm4TlvDq8ikWAM",
"cost_per_minute": 0.03
},
"video": {
"provider": "binary",
"character_id": "0001",
"cost_per_minute": 0
},
"version": "1.0",
"tool_calling": {
"selected_tool_ids": []
},
"end_of_conversation": {
"callback_url": "",
"send_data_on_end": false
}
}
}
'import requests
url = "https://api.iwy.ai/v1/agent"
payload = {
"name": "Customer Service Bot",
"publish_status": "draft",
"configuration": {
"llm": {
"model": "gemini-2.0-flash",
"provider": "google",
"system_prompt": "You are a helpful customer service assistant",
"first_message": "Hello! How can I help you today?",
"cost_per_minute": 0.001532
},
"stt": {
"model": "nova-3-general",
"provider": "deepgram",
"cost_per_minute": 0.01
},
"tts": {
"provider": "elevenlabs",
"voice_id": "21m00Tcm4TlvDq8ikWAM",
"cost_per_minute": 0.03
},
"video": {
"provider": "binary",
"character_id": "0001",
"cost_per_minute": 0
},
"version": "1.0",
"tool_calling": { "selected_tool_ids": [] },
"end_of_conversation": {
"callback_url": "",
"send_data_on_end": False
}
}
}
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 Service Bot',
publish_status: 'draft',
configuration: {
llm: {
model: 'gemini-2.0-flash',
provider: 'google',
system_prompt: 'You are a helpful customer service assistant',
first_message: 'Hello! How can I help you today?',
cost_per_minute: 0.001532
},
stt: {model: 'nova-3-general', provider: 'deepgram', cost_per_minute: 0.01},
tts: {
provider: 'elevenlabs',
voice_id: '21m00Tcm4TlvDq8ikWAM',
cost_per_minute: 0.03
},
video: {provider: 'binary', character_id: '0001', cost_per_minute: 0},
version: '1.0',
tool_calling: {selected_tool_ids: []},
end_of_conversation: {callback_url: '', send_data_on_end: false}
}
})
};
fetch('https://api.iwy.ai/v1/agent', 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.iwy.ai/v1/agent",
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 Service Bot',
'publish_status' => 'draft',
'configuration' => [
'llm' => [
'model' => 'gemini-2.0-flash',
'provider' => 'google',
'system_prompt' => 'You are a helpful customer service assistant',
'first_message' => 'Hello! How can I help you today?',
'cost_per_minute' => 0.001532
],
'stt' => [
'model' => 'nova-3-general',
'provider' => 'deepgram',
'cost_per_minute' => 0.01
],
'tts' => [
'provider' => 'elevenlabs',
'voice_id' => '21m00Tcm4TlvDq8ikWAM',
'cost_per_minute' => 0.03
],
'video' => [
'provider' => 'binary',
'character_id' => '0001',
'cost_per_minute' => 0
],
'version' => '1.0',
'tool_calling' => [
'selected_tool_ids' => [
]
],
'end_of_conversation' => [
'callback_url' => '',
'send_data_on_end' => false
]
]
]),
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.iwy.ai/v1/agent"
payload := strings.NewReader("{\n \"name\": \"Customer Service Bot\",\n \"publish_status\": \"draft\",\n \"configuration\": {\n \"llm\": {\n \"model\": \"gemini-2.0-flash\",\n \"provider\": \"google\",\n \"system_prompt\": \"You are a helpful customer service assistant\",\n \"first_message\": \"Hello! How can I help you today?\",\n \"cost_per_minute\": 0.001532\n },\n \"stt\": {\n \"model\": \"nova-3-general\",\n \"provider\": \"deepgram\",\n \"cost_per_minute\": 0.01\n },\n \"tts\": {\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"21m00Tcm4TlvDq8ikWAM\",\n \"cost_per_minute\": 0.03\n },\n \"video\": {\n \"provider\": \"binary\",\n \"character_id\": \"0001\",\n \"cost_per_minute\": 0\n },\n \"version\": \"1.0\",\n \"tool_calling\": {\n \"selected_tool_ids\": []\n },\n \"end_of_conversation\": {\n \"callback_url\": \"\",\n \"send_data_on_end\": false\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("https://api.iwy.ai/v1/agent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Customer Service Bot\",\n \"publish_status\": \"draft\",\n \"configuration\": {\n \"llm\": {\n \"model\": \"gemini-2.0-flash\",\n \"provider\": \"google\",\n \"system_prompt\": \"You are a helpful customer service assistant\",\n \"first_message\": \"Hello! How can I help you today?\",\n \"cost_per_minute\": 0.001532\n },\n \"stt\": {\n \"model\": \"nova-3-general\",\n \"provider\": \"deepgram\",\n \"cost_per_minute\": 0.01\n },\n \"tts\": {\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"21m00Tcm4TlvDq8ikWAM\",\n \"cost_per_minute\": 0.03\n },\n \"video\": {\n \"provider\": \"binary\",\n \"character_id\": \"0001\",\n \"cost_per_minute\": 0\n },\n \"version\": \"1.0\",\n \"tool_calling\": {\n \"selected_tool_ids\": []\n },\n \"end_of_conversation\": {\n \"callback_url\": \"\",\n \"send_data_on_end\": false\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.iwy.ai/v1/agent")
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\": \"Customer Service Bot\",\n \"publish_status\": \"draft\",\n \"configuration\": {\n \"llm\": {\n \"model\": \"gemini-2.0-flash\",\n \"provider\": \"google\",\n \"system_prompt\": \"You are a helpful customer service assistant\",\n \"first_message\": \"Hello! How can I help you today?\",\n \"cost_per_minute\": 0.001532\n },\n \"stt\": {\n \"model\": \"nova-3-general\",\n \"provider\": \"deepgram\",\n \"cost_per_minute\": 0.01\n },\n \"tts\": {\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"21m00Tcm4TlvDq8ikWAM\",\n \"cost_per_minute\": 0.03\n },\n \"video\": {\n \"provider\": \"binary\",\n \"character_id\": \"0001\",\n \"cost_per_minute\": 0\n },\n \"version\": \"1.0\",\n \"tool_calling\": {\n \"selected_tool_ids\": []\n },\n \"end_of_conversation\": {\n \"callback_url\": \"\",\n \"send_data_on_end\": false\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"configuration": {
"llm": {
"model": "gemini-2.0-flash",
"provider": "google",
"system_prompt": "You are a helpful customer service assistant",
"first_message": "Hello! How can I help you today?",
"voice": "<string>",
"custom_url": "<string>",
"cost_per_minute": 0.001532
},
"stt": {
"model": "nova-3-general",
"provider": "deepgram",
"cost_per_minute": 0.01
},
"tts": {
"provider": "elevenlabs",
"voice_id": "21m00Tcm4TlvDq8ikWAM",
"cost_per_minute": 0.03
},
"video": {
"provider": "binary",
"character_id": "0001",
"cost_per_minute": 0
},
"tool_calling": {
"selected_tool_ids": [
"dcfae097-1b37-4444-bb0c-1a6abb0320fd"
]
},
"end_of_conversation": {
"callback_url": "<string>",
"send_data_on_end": false
}
},
"publish_status": "draft",
"metadata": {}
}{
"success": false,
"error": "Bad request",
"details": "Missing required field: name"
}{
"success": false,
"error": "Unauthorized",
"details": "Invalid or missing API key"
}{
"success": false,
"error": "Internal server error",
"details": "An unexpected error occurred"
}Authorizations
Your iwy Service API Key. Find it at app.iwy.ai/settings.
Include it in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Body
application/json
Human-readable name for the agent
Example:
"Customer Service Bot"
Agent behavior and capabilities configuration
Show child attributes
Show child attributes
Initial visibility status
Available options:
draft, private, public Additional metadata
Response
Agent created successfully
Complete agent configuration
Unique identifier for the agent
ID of the user who owns this agent
Human-readable name of the agent
Agent behavior and capabilities configuration
Show child attributes
Show child attributes
Visibility and accessibility status:
draft: In development, not accessibleprivate: Active but not publicly discoverablepublic: Fully active and discoverable
Available options:
draft, private, public Additional metadata for internal use
⌘I