curl --request POST \
--url https://api.iwy.ai/v1/ephemeral-agent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"configuration": {
"llm": {
"model": "gemini-2.0-flash",
"provider": "google",
"system_prompt": "You are a helpful assistant for a product demo",
"first_message": "Welcome to the demo! How can I help you today?"
},
"tts": {
"provider": "elevenlabs",
"voice_id": "21m00Tcm4TlvDq8ikWAM"
},
"video": {
"provider": "binary",
"character_id": "0001"
}
}
}
'import requests
url = "https://api.iwy.ai/v1/ephemeral-agent"
payload = { "configuration": {
"llm": {
"model": "gemini-2.0-flash",
"provider": "google",
"system_prompt": "You are a helpful assistant for a product demo",
"first_message": "Welcome to the demo! How can I help you today?"
},
"tts": {
"provider": "elevenlabs",
"voice_id": "21m00Tcm4TlvDq8ikWAM"
},
"video": {
"provider": "binary",
"character_id": "0001"
}
} }
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({
configuration: {
llm: {
model: 'gemini-2.0-flash',
provider: 'google',
system_prompt: 'You are a helpful assistant for a product demo',
first_message: 'Welcome to the demo! How can I help you today?'
},
tts: {provider: 'elevenlabs', voice_id: '21m00Tcm4TlvDq8ikWAM'},
video: {provider: 'binary', character_id: '0001'}
}
})
};
fetch('https://api.iwy.ai/v1/ephemeral-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/ephemeral-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([
'configuration' => [
'llm' => [
'model' => 'gemini-2.0-flash',
'provider' => 'google',
'system_prompt' => 'You are a helpful assistant for a product demo',
'first_message' => 'Welcome to the demo! How can I help you today?'
],
'tts' => [
'provider' => 'elevenlabs',
'voice_id' => '21m00Tcm4TlvDq8ikWAM'
],
'video' => [
'provider' => 'binary',
'character_id' => '0001'
]
]
]),
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/ephemeral-agent"
payload := strings.NewReader("{\n \"configuration\": {\n \"llm\": {\n \"model\": \"gemini-2.0-flash\",\n \"provider\": \"google\",\n \"system_prompt\": \"You are a helpful assistant for a product demo\",\n \"first_message\": \"Welcome to the demo! How can I help you today?\"\n },\n \"tts\": {\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"21m00Tcm4TlvDq8ikWAM\"\n },\n \"video\": {\n \"provider\": \"binary\",\n \"character_id\": \"0001\"\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/ephemeral-agent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"configuration\": {\n \"llm\": {\n \"model\": \"gemini-2.0-flash\",\n \"provider\": \"google\",\n \"system_prompt\": \"You are a helpful assistant for a product demo\",\n \"first_message\": \"Welcome to the demo! How can I help you today?\"\n },\n \"tts\": {\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"21m00Tcm4TlvDq8ikWAM\"\n },\n \"video\": {\n \"provider\": \"binary\",\n \"character_id\": \"0001\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.iwy.ai/v1/ephemeral-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 \"configuration\": {\n \"llm\": {\n \"model\": \"gemini-2.0-flash\",\n \"provider\": \"google\",\n \"system_prompt\": \"You are a helpful assistant for a product demo\",\n \"first_message\": \"Welcome to the demo! How can I help you today?\"\n },\n \"tts\": {\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"21m00Tcm4TlvDq8ikWAM\"\n },\n \"video\": {\n \"provider\": \"binary\",\n \"character_id\": \"0001\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"agent": {
"id": "550e8400-e29b-41d4-a716-446655440099",
"expires_at": "2025-01-15T10:30:00.000Z",
"created_at": "2025-01-15T10:20:00.000Z"
}
}{
"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"
}Create ephemeral agent
Creates a one-time use agent with automatic expiration.
Ephemeral agents are more appropiate for use cases where you want to spin up an customized agent without persisting it long-term in the iwy dashboard. Ephemeral agents won’t appear in the dashboard. The agent will automatically expire after a specified time to live (TTL).
curl --request POST \
--url https://api.iwy.ai/v1/ephemeral-agent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"configuration": {
"llm": {
"model": "gemini-2.0-flash",
"provider": "google",
"system_prompt": "You are a helpful assistant for a product demo",
"first_message": "Welcome to the demo! How can I help you today?"
},
"tts": {
"provider": "elevenlabs",
"voice_id": "21m00Tcm4TlvDq8ikWAM"
},
"video": {
"provider": "binary",
"character_id": "0001"
}
}
}
'import requests
url = "https://api.iwy.ai/v1/ephemeral-agent"
payload = { "configuration": {
"llm": {
"model": "gemini-2.0-flash",
"provider": "google",
"system_prompt": "You are a helpful assistant for a product demo",
"first_message": "Welcome to the demo! How can I help you today?"
},
"tts": {
"provider": "elevenlabs",
"voice_id": "21m00Tcm4TlvDq8ikWAM"
},
"video": {
"provider": "binary",
"character_id": "0001"
}
} }
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({
configuration: {
llm: {
model: 'gemini-2.0-flash',
provider: 'google',
system_prompt: 'You are a helpful assistant for a product demo',
first_message: 'Welcome to the demo! How can I help you today?'
},
tts: {provider: 'elevenlabs', voice_id: '21m00Tcm4TlvDq8ikWAM'},
video: {provider: 'binary', character_id: '0001'}
}
})
};
fetch('https://api.iwy.ai/v1/ephemeral-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/ephemeral-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([
'configuration' => [
'llm' => [
'model' => 'gemini-2.0-flash',
'provider' => 'google',
'system_prompt' => 'You are a helpful assistant for a product demo',
'first_message' => 'Welcome to the demo! How can I help you today?'
],
'tts' => [
'provider' => 'elevenlabs',
'voice_id' => '21m00Tcm4TlvDq8ikWAM'
],
'video' => [
'provider' => 'binary',
'character_id' => '0001'
]
]
]),
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/ephemeral-agent"
payload := strings.NewReader("{\n \"configuration\": {\n \"llm\": {\n \"model\": \"gemini-2.0-flash\",\n \"provider\": \"google\",\n \"system_prompt\": \"You are a helpful assistant for a product demo\",\n \"first_message\": \"Welcome to the demo! How can I help you today?\"\n },\n \"tts\": {\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"21m00Tcm4TlvDq8ikWAM\"\n },\n \"video\": {\n \"provider\": \"binary\",\n \"character_id\": \"0001\"\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/ephemeral-agent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"configuration\": {\n \"llm\": {\n \"model\": \"gemini-2.0-flash\",\n \"provider\": \"google\",\n \"system_prompt\": \"You are a helpful assistant for a product demo\",\n \"first_message\": \"Welcome to the demo! How can I help you today?\"\n },\n \"tts\": {\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"21m00Tcm4TlvDq8ikWAM\"\n },\n \"video\": {\n \"provider\": \"binary\",\n \"character_id\": \"0001\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.iwy.ai/v1/ephemeral-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 \"configuration\": {\n \"llm\": {\n \"model\": \"gemini-2.0-flash\",\n \"provider\": \"google\",\n \"system_prompt\": \"You are a helpful assistant for a product demo\",\n \"first_message\": \"Welcome to the demo! How can I help you today?\"\n },\n \"tts\": {\n \"provider\": \"elevenlabs\",\n \"voice_id\": \"21m00Tcm4TlvDq8ikWAM\"\n },\n \"video\": {\n \"provider\": \"binary\",\n \"character_id\": \"0001\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"agent": {
"id": "550e8400-e29b-41d4-a716-446655440099",
"expires_at": "2025-01-15T10:30:00.000Z",
"created_at": "2025-01-15T10:20:00.000Z"
}
}{
"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
Request to create a one-time use ephemeral agent
Agent configuration (same as regular agents)
Show child attributes
Show child attributes
Time-to-live in seconds. The agent will expire after this duration.
60 <= x <= 86400600
Optional metadata for tracking or internal use
{
"purpose": "product_demo",
"campaign": "summer_2025"
}
Response
Ephemeral agent created successfully
Response containing the created ephemeral agent details
The created ephemeral agent
Show child attributes
Show child attributes