Opt-in pairwise preference verdict (runs on the user's BYOK key)
curl --request POST \
--url https://api.example.com/api/v1/playground/compare \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"baseline_output": "<string>",
"candidate_output": "<string>",
"model": "<string>",
"user_input": "",
"change_context": "<string>",
"provider_hint": ""
}
'import requests
url = "https://api.example.com/api/v1/playground/compare"
payload = {
"baseline_output": "<string>",
"candidate_output": "<string>",
"model": "<string>",
"user_input": "",
"change_context": "<string>",
"provider_hint": ""
}
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({
baseline_output: '<string>',
candidate_output: '<string>',
model: '<string>',
user_input: '',
change_context: '<string>',
provider_hint: ''
})
};
fetch('https://api.example.com/api/v1/playground/compare', 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.example.com/api/v1/playground/compare",
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([
'baseline_output' => '<string>',
'candidate_output' => '<string>',
'model' => '<string>',
'user_input' => '',
'change_context' => '<string>',
'provider_hint' => ''
]),
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.example.com/api/v1/playground/compare"
payload := strings.NewReader("{\n \"baseline_output\": \"<string>\",\n \"candidate_output\": \"<string>\",\n \"model\": \"<string>\",\n \"user_input\": \"\",\n \"change_context\": \"<string>\",\n \"provider_hint\": \"\"\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.example.com/api/v1/playground/compare")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"baseline_output\": \"<string>\",\n \"candidate_output\": \"<string>\",\n \"model\": \"<string>\",\n \"user_input\": \"\",\n \"change_context\": \"<string>\",\n \"provider_hint\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/playground/compare")
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 \"baseline_output\": \"<string>\",\n \"candidate_output\": \"<string>\",\n \"model\": \"<string>\",\n \"user_input\": \"\",\n \"change_context\": \"<string>\",\n \"provider_hint\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}playground
Opt-in pairwise preference verdict (runs on the user's BYOK key)
Relative pairwise preference of candidate vs baseline for the same input.
A model opinion (temp 0), not an absolute score. Opt-in (the UI never fires it automatically) and judged on the user’s own provider key — the same BYOK key used for the completions — so it never touches a platform key. Verdict ∈ is the candidate relative to the baseline.
POST
/
api
/
v1
/
playground
/
compare
Opt-in pairwise preference verdict (runs on the user's BYOK key)
curl --request POST \
--url https://api.example.com/api/v1/playground/compare \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"baseline_output": "<string>",
"candidate_output": "<string>",
"model": "<string>",
"user_input": "",
"change_context": "<string>",
"provider_hint": ""
}
'import requests
url = "https://api.example.com/api/v1/playground/compare"
payload = {
"baseline_output": "<string>",
"candidate_output": "<string>",
"model": "<string>",
"user_input": "",
"change_context": "<string>",
"provider_hint": ""
}
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({
baseline_output: '<string>',
candidate_output: '<string>',
model: '<string>',
user_input: '',
change_context: '<string>',
provider_hint: ''
})
};
fetch('https://api.example.com/api/v1/playground/compare', 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.example.com/api/v1/playground/compare",
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([
'baseline_output' => '<string>',
'candidate_output' => '<string>',
'model' => '<string>',
'user_input' => '',
'change_context' => '<string>',
'provider_hint' => ''
]),
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.example.com/api/v1/playground/compare"
payload := strings.NewReader("{\n \"baseline_output\": \"<string>\",\n \"candidate_output\": \"<string>\",\n \"model\": \"<string>\",\n \"user_input\": \"\",\n \"change_context\": \"<string>\",\n \"provider_hint\": \"\"\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.example.com/api/v1/playground/compare")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"baseline_output\": \"<string>\",\n \"candidate_output\": \"<string>\",\n \"model\": \"<string>\",\n \"user_input\": \"\",\n \"change_context\": \"<string>\",\n \"provider_hint\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/playground/compare")
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 \"baseline_output\": \"<string>\",\n \"candidate_output\": \"<string>\",\n \"model\": \"<string>\",\n \"user_input\": \"\",\n \"change_context\": \"<string>\",\n \"provider_hint\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Enter your API key (e.g. dai_sk_test_key_001)
Headers
Cookies
Body
application/json
Request a relative pairwise verdict for two outputs on the same input.
The judge runs on the USER's BYOK key (the same provider/model they're testing) — never a platform key — so a Playground verdict can't be blocked by, or billed to, DecimalAI's LLM quota.
Response
Successful Response
⌘I