API Reference
Create Event
POST
/
api
/
v1
/
events
Create Event
curl --request POST \
--url https://evals.voker.ai/api/v1/api/v1/events \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"agent": "customer-support-agent",
"agent_version": "v1",
"event_name": "llm",
"fingerprint_id": "123",
"person": "user_123",
"properties": {
"api": "openai-chat-completions",
"inputs": {
"messages": [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Can you help me?",
"role": "user"
}
],
"model": "gpt-4o"
},
"output": {
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "Hello! How can I assist you today?",
"role": "assistant"
}
}
],
"id": "chatcmpl-123",
"model": "gpt-4o-2024-08-06",
"usage": {
"completion_tokens": 9,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0
},
"prompt_tokens": 99,
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0
},
"total_tokens": 108
}
}
},
"session": "session_456"
}
'import requests
url = "https://evals.voker.ai/api/v1/api/v1/events"
payload = {
"agent": "customer-support-agent",
"agent_version": "v1",
"event_name": "llm",
"fingerprint_id": "123",
"person": "user_123",
"properties": {
"api": "openai-chat-completions",
"inputs": {
"messages": [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Can you help me?",
"role": "user"
}
],
"model": "gpt-4o"
},
"output": {
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "Hello! How can I assist you today?",
"role": "assistant"
}
}
],
"id": "chatcmpl-123",
"model": "gpt-4o-2024-08-06",
"usage": {
"completion_tokens": 9,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0
},
"prompt_tokens": 99,
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0
},
"total_tokens": 108
}
}
},
"session": "session_456"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent: 'customer-support-agent',
agent_version: 'v1',
event_name: 'llm',
fingerprint_id: '123',
person: 'user_123',
properties: {
api: 'openai-chat-completions',
inputs: {
messages: [
{content: 'You are a helpful assistant.', role: 'system'},
{content: 'Can you help me?', role: 'user'}
],
model: 'gpt-4o'
},
output: {
choices: [
{
finish_reason: 'stop',
index: 0,
message: {content: 'Hello! How can I assist you today?', role: 'assistant'}
}
],
id: 'chatcmpl-123',
model: 'gpt-4o-2024-08-06',
usage: {
completion_tokens: 9,
completion_tokens_details: {
accepted_prediction_tokens: 0,
audio_tokens: 0,
reasoning_tokens: 0,
rejected_prediction_tokens: 0
},
prompt_tokens: 99,
prompt_tokens_details: {audio_tokens: 0, cached_tokens: 0},
total_tokens: 108
}
}
},
session: 'session_456'
})
};
fetch('https://evals.voker.ai/api/v1/api/v1/events', 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://evals.voker.ai/api/v1/api/v1/events",
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([
'agent' => 'customer-support-agent',
'agent_version' => 'v1',
'event_name' => 'llm',
'fingerprint_id' => '123',
'person' => 'user_123',
'properties' => [
'api' => 'openai-chat-completions',
'inputs' => [
'messages' => [
[
'content' => 'You are a helpful assistant.',
'role' => 'system'
],
[
'content' => 'Can you help me?',
'role' => 'user'
]
],
'model' => 'gpt-4o'
],
'output' => [
'choices' => [
[
'finish_reason' => 'stop',
'index' => 0,
'message' => [
'content' => 'Hello! How can I assist you today?',
'role' => 'assistant'
]
]
],
'id' => 'chatcmpl-123',
'model' => 'gpt-4o-2024-08-06',
'usage' => [
'completion_tokens' => 9,
'completion_tokens_details' => [
'accepted_prediction_tokens' => 0,
'audio_tokens' => 0,
'reasoning_tokens' => 0,
'rejected_prediction_tokens' => 0
],
'prompt_tokens' => 99,
'prompt_tokens_details' => [
'audio_tokens' => 0,
'cached_tokens' => 0
],
'total_tokens' => 108
]
]
],
'session' => 'session_456'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://evals.voker.ai/api/v1/api/v1/events"
payload := strings.NewReader("{\n \"agent\": \"customer-support-agent\",\n \"agent_version\": \"v1\",\n \"event_name\": \"llm\",\n \"fingerprint_id\": \"123\",\n \"person\": \"user_123\",\n \"properties\": {\n \"api\": \"openai-chat-completions\",\n \"inputs\": {\n \"messages\": [\n {\n \"content\": \"You are a helpful assistant.\",\n \"role\": \"system\"\n },\n {\n \"content\": \"Can you help me?\",\n \"role\": \"user\"\n }\n ],\n \"model\": \"gpt-4o\"\n },\n \"output\": {\n \"choices\": [\n {\n \"finish_reason\": \"stop\",\n \"index\": 0,\n \"message\": {\n \"content\": \"Hello! How can I assist you today?\",\n \"role\": \"assistant\"\n }\n }\n ],\n \"id\": \"chatcmpl-123\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"usage\": {\n \"completion_tokens\": 9,\n \"completion_tokens_details\": {\n \"accepted_prediction_tokens\": 0,\n \"audio_tokens\": 0,\n \"reasoning_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n },\n \"prompt_tokens\": 99,\n \"prompt_tokens_details\": {\n \"audio_tokens\": 0,\n \"cached_tokens\": 0\n },\n \"total_tokens\": 108\n }\n }\n },\n \"session\": \"session_456\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://evals.voker.ai/api/v1/api/v1/events")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"agent\": \"customer-support-agent\",\n \"agent_version\": \"v1\",\n \"event_name\": \"llm\",\n \"fingerprint_id\": \"123\",\n \"person\": \"user_123\",\n \"properties\": {\n \"api\": \"openai-chat-completions\",\n \"inputs\": {\n \"messages\": [\n {\n \"content\": \"You are a helpful assistant.\",\n \"role\": \"system\"\n },\n {\n \"content\": \"Can you help me?\",\n \"role\": \"user\"\n }\n ],\n \"model\": \"gpt-4o\"\n },\n \"output\": {\n \"choices\": [\n {\n \"finish_reason\": \"stop\",\n \"index\": 0,\n \"message\": {\n \"content\": \"Hello! How can I assist you today?\",\n \"role\": \"assistant\"\n }\n }\n ],\n \"id\": \"chatcmpl-123\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"usage\": {\n \"completion_tokens\": 9,\n \"completion_tokens_details\": {\n \"accepted_prediction_tokens\": 0,\n \"audio_tokens\": 0,\n \"reasoning_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n },\n \"prompt_tokens\": 99,\n \"prompt_tokens_details\": {\n \"audio_tokens\": 0,\n \"cached_tokens\": 0\n },\n \"total_tokens\": 108\n }\n }\n },\n \"session\": \"session_456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://evals.voker.ai/api/v1/api/v1/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent\": \"customer-support-agent\",\n \"agent_version\": \"v1\",\n \"event_name\": \"llm\",\n \"fingerprint_id\": \"123\",\n \"person\": \"user_123\",\n \"properties\": {\n \"api\": \"openai-chat-completions\",\n \"inputs\": {\n \"messages\": [\n {\n \"content\": \"You are a helpful assistant.\",\n \"role\": \"system\"\n },\n {\n \"content\": \"Can you help me?\",\n \"role\": \"user\"\n }\n ],\n \"model\": \"gpt-4o\"\n },\n \"output\": {\n \"choices\": [\n {\n \"finish_reason\": \"stop\",\n \"index\": 0,\n \"message\": {\n \"content\": \"Hello! How can I assist you today?\",\n \"role\": \"assistant\"\n }\n }\n ],\n \"id\": \"chatcmpl-123\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"usage\": {\n \"completion_tokens\": 9,\n \"completion_tokens_details\": {\n \"accepted_prediction_tokens\": 0,\n \"audio_tokens\": 0,\n \"reasoning_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n },\n \"prompt_tokens\": 99,\n \"prompt_tokens_details\": {\n \"audio_tokens\": 0,\n \"cached_tokens\": 0\n },\n \"total_tokens\": 108\n }\n }\n },\n \"session\": \"session_456\"\n}"
response = http.request(request)
puts response.read_body{
"type": "fingerprint-not-found"
}{
"type": "session-id-empty"
}Headers
Example:
"Bearer 123"
Body
application/json
Create an event.
See Creating an Event for more information.
Type of the event. Currently, only "llm" is supported.
Allowed value:
"llm"Event specific properties. For LLM events, this includes the inputs and outputs of the LLM call.
Show child attributes
Show child attributes
The fingerprint of the client that generated the event.
The name of the agent version associated with the event.
If this agent version does not exist, it will be created. If an agent version is not supplied, a default version will be used.
Response
Successful Response
⌘I
Create Event
curl --request POST \
--url https://evals.voker.ai/api/v1/api/v1/events \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"agent": "customer-support-agent",
"agent_version": "v1",
"event_name": "llm",
"fingerprint_id": "123",
"person": "user_123",
"properties": {
"api": "openai-chat-completions",
"inputs": {
"messages": [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Can you help me?",
"role": "user"
}
],
"model": "gpt-4o"
},
"output": {
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "Hello! How can I assist you today?",
"role": "assistant"
}
}
],
"id": "chatcmpl-123",
"model": "gpt-4o-2024-08-06",
"usage": {
"completion_tokens": 9,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0
},
"prompt_tokens": 99,
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0
},
"total_tokens": 108
}
}
},
"session": "session_456"
}
'import requests
url = "https://evals.voker.ai/api/v1/api/v1/events"
payload = {
"agent": "customer-support-agent",
"agent_version": "v1",
"event_name": "llm",
"fingerprint_id": "123",
"person": "user_123",
"properties": {
"api": "openai-chat-completions",
"inputs": {
"messages": [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Can you help me?",
"role": "user"
}
],
"model": "gpt-4o"
},
"output": {
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "Hello! How can I assist you today?",
"role": "assistant"
}
}
],
"id": "chatcmpl-123",
"model": "gpt-4o-2024-08-06",
"usage": {
"completion_tokens": 9,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0
},
"prompt_tokens": 99,
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0
},
"total_tokens": 108
}
}
},
"session": "session_456"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent: 'customer-support-agent',
agent_version: 'v1',
event_name: 'llm',
fingerprint_id: '123',
person: 'user_123',
properties: {
api: 'openai-chat-completions',
inputs: {
messages: [
{content: 'You are a helpful assistant.', role: 'system'},
{content: 'Can you help me?', role: 'user'}
],
model: 'gpt-4o'
},
output: {
choices: [
{
finish_reason: 'stop',
index: 0,
message: {content: 'Hello! How can I assist you today?', role: 'assistant'}
}
],
id: 'chatcmpl-123',
model: 'gpt-4o-2024-08-06',
usage: {
completion_tokens: 9,
completion_tokens_details: {
accepted_prediction_tokens: 0,
audio_tokens: 0,
reasoning_tokens: 0,
rejected_prediction_tokens: 0
},
prompt_tokens: 99,
prompt_tokens_details: {audio_tokens: 0, cached_tokens: 0},
total_tokens: 108
}
}
},
session: 'session_456'
})
};
fetch('https://evals.voker.ai/api/v1/api/v1/events', 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://evals.voker.ai/api/v1/api/v1/events",
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([
'agent' => 'customer-support-agent',
'agent_version' => 'v1',
'event_name' => 'llm',
'fingerprint_id' => '123',
'person' => 'user_123',
'properties' => [
'api' => 'openai-chat-completions',
'inputs' => [
'messages' => [
[
'content' => 'You are a helpful assistant.',
'role' => 'system'
],
[
'content' => 'Can you help me?',
'role' => 'user'
]
],
'model' => 'gpt-4o'
],
'output' => [
'choices' => [
[
'finish_reason' => 'stop',
'index' => 0,
'message' => [
'content' => 'Hello! How can I assist you today?',
'role' => 'assistant'
]
]
],
'id' => 'chatcmpl-123',
'model' => 'gpt-4o-2024-08-06',
'usage' => [
'completion_tokens' => 9,
'completion_tokens_details' => [
'accepted_prediction_tokens' => 0,
'audio_tokens' => 0,
'reasoning_tokens' => 0,
'rejected_prediction_tokens' => 0
],
'prompt_tokens' => 99,
'prompt_tokens_details' => [
'audio_tokens' => 0,
'cached_tokens' => 0
],
'total_tokens' => 108
]
]
],
'session' => 'session_456'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://evals.voker.ai/api/v1/api/v1/events"
payload := strings.NewReader("{\n \"agent\": \"customer-support-agent\",\n \"agent_version\": \"v1\",\n \"event_name\": \"llm\",\n \"fingerprint_id\": \"123\",\n \"person\": \"user_123\",\n \"properties\": {\n \"api\": \"openai-chat-completions\",\n \"inputs\": {\n \"messages\": [\n {\n \"content\": \"You are a helpful assistant.\",\n \"role\": \"system\"\n },\n {\n \"content\": \"Can you help me?\",\n \"role\": \"user\"\n }\n ],\n \"model\": \"gpt-4o\"\n },\n \"output\": {\n \"choices\": [\n {\n \"finish_reason\": \"stop\",\n \"index\": 0,\n \"message\": {\n \"content\": \"Hello! How can I assist you today?\",\n \"role\": \"assistant\"\n }\n }\n ],\n \"id\": \"chatcmpl-123\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"usage\": {\n \"completion_tokens\": 9,\n \"completion_tokens_details\": {\n \"accepted_prediction_tokens\": 0,\n \"audio_tokens\": 0,\n \"reasoning_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n },\n \"prompt_tokens\": 99,\n \"prompt_tokens_details\": {\n \"audio_tokens\": 0,\n \"cached_tokens\": 0\n },\n \"total_tokens\": 108\n }\n }\n },\n \"session\": \"session_456\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://evals.voker.ai/api/v1/api/v1/events")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"agent\": \"customer-support-agent\",\n \"agent_version\": \"v1\",\n \"event_name\": \"llm\",\n \"fingerprint_id\": \"123\",\n \"person\": \"user_123\",\n \"properties\": {\n \"api\": \"openai-chat-completions\",\n \"inputs\": {\n \"messages\": [\n {\n \"content\": \"You are a helpful assistant.\",\n \"role\": \"system\"\n },\n {\n \"content\": \"Can you help me?\",\n \"role\": \"user\"\n }\n ],\n \"model\": \"gpt-4o\"\n },\n \"output\": {\n \"choices\": [\n {\n \"finish_reason\": \"stop\",\n \"index\": 0,\n \"message\": {\n \"content\": \"Hello! How can I assist you today?\",\n \"role\": \"assistant\"\n }\n }\n ],\n \"id\": \"chatcmpl-123\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"usage\": {\n \"completion_tokens\": 9,\n \"completion_tokens_details\": {\n \"accepted_prediction_tokens\": 0,\n \"audio_tokens\": 0,\n \"reasoning_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n },\n \"prompt_tokens\": 99,\n \"prompt_tokens_details\": {\n \"audio_tokens\": 0,\n \"cached_tokens\": 0\n },\n \"total_tokens\": 108\n }\n }\n },\n \"session\": \"session_456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://evals.voker.ai/api/v1/api/v1/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent\": \"customer-support-agent\",\n \"agent_version\": \"v1\",\n \"event_name\": \"llm\",\n \"fingerprint_id\": \"123\",\n \"person\": \"user_123\",\n \"properties\": {\n \"api\": \"openai-chat-completions\",\n \"inputs\": {\n \"messages\": [\n {\n \"content\": \"You are a helpful assistant.\",\n \"role\": \"system\"\n },\n {\n \"content\": \"Can you help me?\",\n \"role\": \"user\"\n }\n ],\n \"model\": \"gpt-4o\"\n },\n \"output\": {\n \"choices\": [\n {\n \"finish_reason\": \"stop\",\n \"index\": 0,\n \"message\": {\n \"content\": \"Hello! How can I assist you today?\",\n \"role\": \"assistant\"\n }\n }\n ],\n \"id\": \"chatcmpl-123\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"usage\": {\n \"completion_tokens\": 9,\n \"completion_tokens_details\": {\n \"accepted_prediction_tokens\": 0,\n \"audio_tokens\": 0,\n \"reasoning_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n },\n \"prompt_tokens\": 99,\n \"prompt_tokens_details\": {\n \"audio_tokens\": 0,\n \"cached_tokens\": 0\n },\n \"total_tokens\": 108\n }\n }\n },\n \"session\": \"session_456\"\n}"
response = http.request(request)
puts response.read_body{
"type": "fingerprint-not-found"
}{
"type": "session-id-empty"
}