Preview Avatar
curl --request POST \
--url https://api.agenthuman.com/v1/avatars/preview \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"avatar_id": "<string>"
}
'import requests
url = "https://api.agenthuman.com/v1/avatars/preview"
payload = { "avatar_id": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({avatar_id: '<string>'})
};
fetch('https://api.agenthuman.com/v1/avatars/preview', 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.agenthuman.com/v1/avatars/preview",
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([
'avatar_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.agenthuman.com/v1/avatars/preview"
payload := strings.NewReader("{\n \"avatar_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.agenthuman.com/v1/avatars/preview")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"avatar_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agenthuman.com/v1/avatars/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"avatar_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"url": "https://links.agenthuman.com/lnk_01J8ZK4R2N5M6P7Q8W4T"
}
{
"success": false,
"error": {
"message": "avatar_id is required"
}
}
{
"success": false,
"error": {
"message": "Unauthorized"
}
}
Avatars
Preview Avatar
Generate a short-lived preview link to see an avatar in a live session
POST
/
v1
/
avatars
/
preview
Preview Avatar
curl --request POST \
--url https://api.agenthuman.com/v1/avatars/preview \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"avatar_id": "<string>"
}
'import requests
url = "https://api.agenthuman.com/v1/avatars/preview"
payload = { "avatar_id": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({avatar_id: '<string>'})
};
fetch('https://api.agenthuman.com/v1/avatars/preview', 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.agenthuman.com/v1/avatars/preview",
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([
'avatar_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.agenthuman.com/v1/avatars/preview"
payload := strings.NewReader("{\n \"avatar_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.agenthuman.com/v1/avatars/preview")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"avatar_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agenthuman.com/v1/avatars/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"avatar_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"url": "https://links.agenthuman.com/lnk_01J8ZK4R2N5M6P7Q8W4T"
}
{
"success": false,
"error": {
"message": "avatar_id is required"
}
}
{
"success": false,
"error": {
"message": "Unauthorized"
}
}
What This Does: Creates a temporary agent and a one-time preview link that expires in 5 minutes. Opening the returned URL launches a live video session using the specified avatar, so you can see exactly how it will look and behave before using it in production.
Body
string
required
The avatar ID to preview (format:
avat_<ULID> or a pre-built avatar ID such as PUBLIC/Avatars/sara-office). Returned by Upload Face Avatar or found via List Avatars.Response
boolean
Whether the preview link was created successfully.
string
A one-time preview URL (expires in 5 minutes, single-use). Open this in a browser to start a live video session with the avatar.
{
"success": true,
"url": "https://links.agenthuman.com/lnk_01J8ZK4R2N5M6P7Q8W4T"
}
{
"success": false,
"error": {
"message": "avatar_id is required"
}
}
{
"success": false,
"error": {
"message": "Unauthorized"
}
}
⌘I