curl --request POST \
--url https://api.trugen.ai/v2/vision \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"livekit_url": "wss://your-livekit-domain.livekit.cloud",
"access_token": "eyJhbGciOi...",
"max_duration": 10,
"participant": "auto",
"callback_url": "wss://your-callback-endpoint.example.com/vision",
"modules": {
"face_pose_detection": [
"Looking Left",
"Looking Right"
],
"emotion_recognition": [
"angry",
"sad",
"happy"
],
"eyegaze_tracking": [
"Looking left",
"Looking right"
],
"face_count": [
"2"
],
"face_out_of_focus": [
"out_of_frame"
]
}
}
'import requests
url = "https://api.trugen.ai/v2/vision"
payload = {
"livekit_url": "wss://your-livekit-domain.livekit.cloud",
"access_token": "eyJhbGciOi...",
"max_duration": 10,
"participant": "auto",
"callback_url": "wss://your-callback-endpoint.example.com/vision",
"modules": {
"face_pose_detection": ["Looking Left", "Looking Right"],
"emotion_recognition": ["angry", "sad", "happy"],
"eyegaze_tracking": ["Looking left", "Looking right"],
"face_count": ["2"],
"face_out_of_focus": ["out_of_frame"]
}
}
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({
livekit_url: 'wss://your-livekit-domain.livekit.cloud',
access_token: 'eyJhbGciOi...',
max_duration: 10,
participant: 'auto',
callback_url: 'wss://your-callback-endpoint.example.com/vision',
modules: {
face_pose_detection: ['Looking Left', 'Looking Right'],
emotion_recognition: ['angry', 'sad', 'happy'],
eyegaze_tracking: ['Looking left', 'Looking right'],
face_count: ['2'],
face_out_of_focus: ['out_of_frame']
}
})
};
fetch('https://api.trugen.ai/v2/vision', 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.trugen.ai/v2/vision",
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([
'livekit_url' => 'wss://your-livekit-domain.livekit.cloud',
'access_token' => 'eyJhbGciOi...',
'max_duration' => 10,
'participant' => 'auto',
'callback_url' => 'wss://your-callback-endpoint.example.com/vision',
'modules' => [
'face_pose_detection' => [
'Looking Left',
'Looking Right'
],
'emotion_recognition' => [
'angry',
'sad',
'happy'
],
'eyegaze_tracking' => [
'Looking left',
'Looking right'
],
'face_count' => [
'2'
],
'face_out_of_focus' => [
'out_of_frame'
]
]
]),
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.trugen.ai/v2/vision"
payload := strings.NewReader("{\n \"livekit_url\": \"wss://your-livekit-domain.livekit.cloud\",\n \"access_token\": \"eyJhbGciOi...\",\n \"max_duration\": 10,\n \"participant\": \"auto\",\n \"callback_url\": \"wss://your-callback-endpoint.example.com/vision\",\n \"modules\": {\n \"face_pose_detection\": [\n \"Looking Left\",\n \"Looking Right\"\n ],\n \"emotion_recognition\": [\n \"angry\",\n \"sad\",\n \"happy\"\n ],\n \"eyegaze_tracking\": [\n \"Looking left\",\n \"Looking right\"\n ],\n \"face_count\": [\n \"2\"\n ],\n \"face_out_of_focus\": [\n \"out_of_frame\"\n ]\n }\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.trugen.ai/v2/vision")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"livekit_url\": \"wss://your-livekit-domain.livekit.cloud\",\n \"access_token\": \"eyJhbGciOi...\",\n \"max_duration\": 10,\n \"participant\": \"auto\",\n \"callback_url\": \"wss://your-callback-endpoint.example.com/vision\",\n \"modules\": {\n \"face_pose_detection\": [\n \"Looking Left\",\n \"Looking Right\"\n ],\n \"emotion_recognition\": [\n \"angry\",\n \"sad\",\n \"happy\"\n ],\n \"eyegaze_tracking\": [\n \"Looking left\",\n \"Looking right\"\n ],\n \"face_count\": [\n \"2\"\n ],\n \"face_out_of_focus\": [\n \"out_of_frame\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trugen.ai/v2/vision")
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 \"livekit_url\": \"wss://your-livekit-domain.livekit.cloud\",\n \"access_token\": \"eyJhbGciOi...\",\n \"max_duration\": 10,\n \"participant\": \"auto\",\n \"callback_url\": \"wss://your-callback-endpoint.example.com/vision\",\n \"modules\": {\n \"face_pose_detection\": [\n \"Looking Left\",\n \"Looking Right\"\n ],\n \"emotion_recognition\": [\n \"angry\",\n \"sad\",\n \"happy\"\n ],\n \"eyegaze_tracking\": [\n \"Looking left\",\n \"Looking right\"\n ],\n \"face_count\": [\n \"2\"\n ],\n \"face_out_of_focus\": [\n \"out_of_frame\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"session_id": "8f2a1e5b-4c9d-4a3f-9c11-2c07be7d1c22",
"status": "IN_QUEUE",
"max_duration": 10,
"modules": [
"emotion_recognition",
"eyegaze_tracking",
"face_count",
"face_out_of_focus",
"face_pose_detection"
]
}Start Vision Session
Attach Hawkeye-1 to a LiveKit room and begin real-time video analysis. Hawkeye joins as a subscriber, analyses the target participant’s video, and streams alerts to your callback URL whenever a chosen class is detected. Billed at 1¢/minute. Requires x-api-key authentication.
curl --request POST \
--url https://api.trugen.ai/v2/vision \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"livekit_url": "wss://your-livekit-domain.livekit.cloud",
"access_token": "eyJhbGciOi...",
"max_duration": 10,
"participant": "auto",
"callback_url": "wss://your-callback-endpoint.example.com/vision",
"modules": {
"face_pose_detection": [
"Looking Left",
"Looking Right"
],
"emotion_recognition": [
"angry",
"sad",
"happy"
],
"eyegaze_tracking": [
"Looking left",
"Looking right"
],
"face_count": [
"2"
],
"face_out_of_focus": [
"out_of_frame"
]
}
}
'import requests
url = "https://api.trugen.ai/v2/vision"
payload = {
"livekit_url": "wss://your-livekit-domain.livekit.cloud",
"access_token": "eyJhbGciOi...",
"max_duration": 10,
"participant": "auto",
"callback_url": "wss://your-callback-endpoint.example.com/vision",
"modules": {
"face_pose_detection": ["Looking Left", "Looking Right"],
"emotion_recognition": ["angry", "sad", "happy"],
"eyegaze_tracking": ["Looking left", "Looking right"],
"face_count": ["2"],
"face_out_of_focus": ["out_of_frame"]
}
}
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({
livekit_url: 'wss://your-livekit-domain.livekit.cloud',
access_token: 'eyJhbGciOi...',
max_duration: 10,
participant: 'auto',
callback_url: 'wss://your-callback-endpoint.example.com/vision',
modules: {
face_pose_detection: ['Looking Left', 'Looking Right'],
emotion_recognition: ['angry', 'sad', 'happy'],
eyegaze_tracking: ['Looking left', 'Looking right'],
face_count: ['2'],
face_out_of_focus: ['out_of_frame']
}
})
};
fetch('https://api.trugen.ai/v2/vision', 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.trugen.ai/v2/vision",
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([
'livekit_url' => 'wss://your-livekit-domain.livekit.cloud',
'access_token' => 'eyJhbGciOi...',
'max_duration' => 10,
'participant' => 'auto',
'callback_url' => 'wss://your-callback-endpoint.example.com/vision',
'modules' => [
'face_pose_detection' => [
'Looking Left',
'Looking Right'
],
'emotion_recognition' => [
'angry',
'sad',
'happy'
],
'eyegaze_tracking' => [
'Looking left',
'Looking right'
],
'face_count' => [
'2'
],
'face_out_of_focus' => [
'out_of_frame'
]
]
]),
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.trugen.ai/v2/vision"
payload := strings.NewReader("{\n \"livekit_url\": \"wss://your-livekit-domain.livekit.cloud\",\n \"access_token\": \"eyJhbGciOi...\",\n \"max_duration\": 10,\n \"participant\": \"auto\",\n \"callback_url\": \"wss://your-callback-endpoint.example.com/vision\",\n \"modules\": {\n \"face_pose_detection\": [\n \"Looking Left\",\n \"Looking Right\"\n ],\n \"emotion_recognition\": [\n \"angry\",\n \"sad\",\n \"happy\"\n ],\n \"eyegaze_tracking\": [\n \"Looking left\",\n \"Looking right\"\n ],\n \"face_count\": [\n \"2\"\n ],\n \"face_out_of_focus\": [\n \"out_of_frame\"\n ]\n }\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.trugen.ai/v2/vision")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"livekit_url\": \"wss://your-livekit-domain.livekit.cloud\",\n \"access_token\": \"eyJhbGciOi...\",\n \"max_duration\": 10,\n \"participant\": \"auto\",\n \"callback_url\": \"wss://your-callback-endpoint.example.com/vision\",\n \"modules\": {\n \"face_pose_detection\": [\n \"Looking Left\",\n \"Looking Right\"\n ],\n \"emotion_recognition\": [\n \"angry\",\n \"sad\",\n \"happy\"\n ],\n \"eyegaze_tracking\": [\n \"Looking left\",\n \"Looking right\"\n ],\n \"face_count\": [\n \"2\"\n ],\n \"face_out_of_focus\": [\n \"out_of_frame\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trugen.ai/v2/vision")
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 \"livekit_url\": \"wss://your-livekit-domain.livekit.cloud\",\n \"access_token\": \"eyJhbGciOi...\",\n \"max_duration\": 10,\n \"participant\": \"auto\",\n \"callback_url\": \"wss://your-callback-endpoint.example.com/vision\",\n \"modules\": {\n \"face_pose_detection\": [\n \"Looking Left\",\n \"Looking Right\"\n ],\n \"emotion_recognition\": [\n \"angry\",\n \"sad\",\n \"happy\"\n ],\n \"eyegaze_tracking\": [\n \"Looking left\",\n \"Looking right\"\n ],\n \"face_count\": [\n \"2\"\n ],\n \"face_out_of_focus\": [\n \"out_of_frame\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"session_id": "8f2a1e5b-4c9d-4a3f-9c11-2c07be7d1c22",
"status": "IN_QUEUE",
"max_duration": 10,
"modules": [
"emotion_recognition",
"eyegaze_tracking",
"face_count",
"face_out_of_focus",
"face_pose_detection"
]
}Authorizations
Body
wss:// URL of the LiveKit room Hawkeye should join.
"wss://your-livekit-domain.livekit.cloud"
LiveKit access token with roomJoin: true for that room.
"eyJhbGciOi..."
Session cap in minutes. Hawkeye disconnects when reached.
10
Participant identity to analyse. Defaults to "auto" (first non-agent participant).
"auto"
WebSocket URL to receive real-time class-detection alerts.
"wss://your-callback-endpoint.example.com/vision"
Modules to enable. Each key is a module name; each value is the list of classes to alert on. Pass an empty array to enable a module with all its default classes. Omit modules entirely for all defaults.
Show child attributes
Show child attributes
{
"face_pose_detection": ["Looking Left", "Looking Right"],
"emotion_recognition": ["angry", "sad", "happy"],
"eyegaze_tracking": ["Looking left", "Looking right"],
"face_count": ["2"],
"face_out_of_focus": ["out_of_frame"]
}
Was this page helpful?