curl --request POST \
--url https://api.lightsage.com/v2/agent-preference/evals \
--header 'Content-Type: application/json' \
--header 'X-Lightsage-Api-Key: <api-key>' \
--data '
{
"agent": [
"codex:gpt-5-4"
],
"competitor_id": "8f6f3a52-6f0d-4a4b-9f3e-0c1f4a7f2b11",
"prompts": [
"Which web search API should I use for a research agent?"
],
"runs": 3,
"tags": [
"search"
]
}
'import requests
url = "https://api.lightsage.com/v2/agent-preference/evals"
payload = {
"agent": ["codex:gpt-5-4"],
"competitor_id": "8f6f3a52-6f0d-4a4b-9f3e-0c1f4a7f2b11",
"prompts": ["Which web search API should I use for a research agent?"],
"runs": 3,
"tags": ["search"]
}
headers = {
"X-Lightsage-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-Lightsage-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent: ['codex:gpt-5-4'],
competitor_id: '8f6f3a52-6f0d-4a4b-9f3e-0c1f4a7f2b11',
prompts: ['Which web search API should I use for a research agent?'],
runs: 3,
tags: ['search']
})
};
fetch('https://api.lightsage.com/v2/agent-preference/evals', 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.lightsage.com/v2/agent-preference/evals",
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' => [
'codex:gpt-5-4'
],
'competitor_id' => '8f6f3a52-6f0d-4a4b-9f3e-0c1f4a7f2b11',
'prompts' => [
'Which web search API should I use for a research agent?'
],
'runs' => 3,
'tags' => [
'search'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Lightsage-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.lightsage.com/v2/agent-preference/evals"
payload := strings.NewReader("{\n \"agent\": [\n \"codex:gpt-5-4\"\n ],\n \"competitor_id\": \"8f6f3a52-6f0d-4a4b-9f3e-0c1f4a7f2b11\",\n \"prompts\": [\n \"Which web search API should I use for a research agent?\"\n ],\n \"runs\": 3,\n \"tags\": [\n \"search\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Lightsage-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.lightsage.com/v2/agent-preference/evals")
.header("X-Lightsage-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent\": [\n \"codex:gpt-5-4\"\n ],\n \"competitor_id\": \"8f6f3a52-6f0d-4a4b-9f3e-0c1f4a7f2b11\",\n \"prompts\": [\n \"Which web search API should I use for a research agent?\"\n ],\n \"runs\": 3,\n \"tags\": [\n \"search\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lightsage.com/v2/agent-preference/evals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Lightsage-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent\": [\n \"codex:gpt-5-4\"\n ],\n \"competitor_id\": \"8f6f3a52-6f0d-4a4b-9f3e-0c1f4a7f2b11\",\n \"prompts\": [\n \"Which web search API should I use for a research agent?\"\n ],\n \"runs\": 3,\n \"tags\": [\n \"search\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"competitor": {
"id": "<string>",
"name": "<string>",
"domain": "<string>",
"logo_url": "<string>"
},
"prompts": [
"<string>"
],
"judges": [
"<string>"
],
"agent": [
"<string>"
],
"persona": "<string>",
"search_grounding": "default",
"runs": 1,
"tags": [
"<string>"
],
"created_at": "<string>",
"updated_at": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Create Eval
Creates a head-to-head comparison between your company and one tracked competitor. Each prompt asks an agent to choose, and a fixed judge records which company it recommended. Creating the eval does not start a run; pass the returned id as eval_id to POST /v2/eval-runs.
curl --request POST \
--url https://api.lightsage.com/v2/agent-preference/evals \
--header 'Content-Type: application/json' \
--header 'X-Lightsage-Api-Key: <api-key>' \
--data '
{
"agent": [
"codex:gpt-5-4"
],
"competitor_id": "8f6f3a52-6f0d-4a4b-9f3e-0c1f4a7f2b11",
"prompts": [
"Which web search API should I use for a research agent?"
],
"runs": 3,
"tags": [
"search"
]
}
'import requests
url = "https://api.lightsage.com/v2/agent-preference/evals"
payload = {
"agent": ["codex:gpt-5-4"],
"competitor_id": "8f6f3a52-6f0d-4a4b-9f3e-0c1f4a7f2b11",
"prompts": ["Which web search API should I use for a research agent?"],
"runs": 3,
"tags": ["search"]
}
headers = {
"X-Lightsage-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-Lightsage-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent: ['codex:gpt-5-4'],
competitor_id: '8f6f3a52-6f0d-4a4b-9f3e-0c1f4a7f2b11',
prompts: ['Which web search API should I use for a research agent?'],
runs: 3,
tags: ['search']
})
};
fetch('https://api.lightsage.com/v2/agent-preference/evals', 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.lightsage.com/v2/agent-preference/evals",
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' => [
'codex:gpt-5-4'
],
'competitor_id' => '8f6f3a52-6f0d-4a4b-9f3e-0c1f4a7f2b11',
'prompts' => [
'Which web search API should I use for a research agent?'
],
'runs' => 3,
'tags' => [
'search'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Lightsage-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.lightsage.com/v2/agent-preference/evals"
payload := strings.NewReader("{\n \"agent\": [\n \"codex:gpt-5-4\"\n ],\n \"competitor_id\": \"8f6f3a52-6f0d-4a4b-9f3e-0c1f4a7f2b11\",\n \"prompts\": [\n \"Which web search API should I use for a research agent?\"\n ],\n \"runs\": 3,\n \"tags\": [\n \"search\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Lightsage-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.lightsage.com/v2/agent-preference/evals")
.header("X-Lightsage-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent\": [\n \"codex:gpt-5-4\"\n ],\n \"competitor_id\": \"8f6f3a52-6f0d-4a4b-9f3e-0c1f4a7f2b11\",\n \"prompts\": [\n \"Which web search API should I use for a research agent?\"\n ],\n \"runs\": 3,\n \"tags\": [\n \"search\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lightsage.com/v2/agent-preference/evals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Lightsage-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent\": [\n \"codex:gpt-5-4\"\n ],\n \"competitor_id\": \"8f6f3a52-6f0d-4a4b-9f3e-0c1f4a7f2b11\",\n \"prompts\": [\n \"Which web search API should I use for a research agent?\"\n ],\n \"runs\": 3,\n \"tags\": [\n \"search\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"competitor": {
"id": "<string>",
"name": "<string>",
"domain": "<string>",
"logo_url": "<string>"
},
"prompts": [
"<string>"
],
"judges": [
"<string>"
],
"agent": [
"<string>"
],
"persona": "<string>",
"search_grounding": "default",
"runs": 1,
"tags": [
"<string>"
],
"created_at": "<string>",
"updated_at": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Body
Tracked competitor to compare against, from GET /v2/agent-preference/competitors.
Buying or build questions the agent answers by choosing between your company and the competitor. CLI clients expose this as repeatable --prompt.
1 - 20 elementsDisplay name. Defaults to <your company> vs <competitor> when omitted.
1 - 160Runnable agents from GET /v2/agents. An empty array saves the comparison without default agents. CLI clients expose repeatable --agent.
10Optional perspective applied to the whole comparison.
160Web-retrieval policy for every run: disabled, enabled, or default.
disabled, enabled, default Independent attempts for every prompt-agent pair.
1 <= x <= 2020Response
Successful Response
Eval ID. Pass it as eval_id to POST /v2/eval-runs to run the comparison.
The competitor your company is compared against. Null when the competitor is no longer tracked.
Show child attributes
Show child attributes
Criteria applied to each response. The first one decides which company the agent recommended and cannot be changed.
Requested web-retrieval behavior for an eval run.
disabled, enabled, default 1 <= x <= 20