curl --request POST \
--url https://{instance}.omniapp.co/api/v1/ai/eval/prompt-sets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model_id": "880e8400-e29b-41d4-a716-446655440003",
"name": "Orders regression",
"slug": "orders-regression",
"description": "Regression suite for the orders topic",
"prompts": []
}
'import requests
url = "https://{instance}.omniapp.co/api/v1/ai/eval/prompt-sets"
payload = {
"model_id": "880e8400-e29b-41d4-a716-446655440003",
"name": "Orders regression",
"slug": "orders-regression",
"description": "Regression suite for the orders topic",
"prompts": []
}
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({
model_id: '880e8400-e29b-41d4-a716-446655440003',
name: 'Orders regression',
slug: 'orders-regression',
description: 'Regression suite for the orders topic',
prompts: []
})
};
fetch('https://{instance}.omniapp.co/api/v1/ai/eval/prompt-sets', 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://{instance}.omniapp.co/api/v1/ai/eval/prompt-sets",
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([
'model_id' => '880e8400-e29b-41d4-a716-446655440003',
'name' => 'Orders regression',
'slug' => 'orders-regression',
'description' => 'Regression suite for the orders topic',
'prompts' => [
]
]),
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://{instance}.omniapp.co/api/v1/ai/eval/prompt-sets"
payload := strings.NewReader("{\n \"model_id\": \"880e8400-e29b-41d4-a716-446655440003\",\n \"name\": \"Orders regression\",\n \"slug\": \"orders-regression\",\n \"description\": \"Regression suite for the orders topic\",\n \"prompts\": []\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://{instance}.omniapp.co/api/v1/ai/eval/prompt-sets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model_id\": \"880e8400-e29b-41d4-a716-446655440003\",\n \"name\": \"Orders regression\",\n \"slug\": \"orders-regression\",\n \"description\": \"Regression suite for the orders topic\",\n \"prompts\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.omniapp.co/api/v1/ai/eval/prompt-sets")
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 \"model_id\": \"880e8400-e29b-41d4-a716-446655440003\",\n \"name\": \"Orders regression\",\n \"slug\": \"orders-regression\",\n \"description\": \"Regression suite for the orders topic\",\n \"prompts\": []\n}"
response = http.request(request)
puts response.read_body{
"prompt_set": {
"created_at": "2025-01-15T10:00:00.000Z",
"description": "Regression suite for the orders topic",
"id": "550e8400-e29b-41d4-a716-446655440000",
"is_archived": false,
"model_id": "880e8400-e29b-41d4-a716-446655440003",
"name": "Orders regression",
"prompts": [
{
"created_at": "2025-01-15T10:00:00.000Z",
"expectation": "The top product by revenue should be Aniseed Syrup.",
"id": "770e8400-e29b-41d4-a716-446655440002",
"prompt_text": "What are the top 5 products by revenue?",
"updated_at": "2025-01-15T10:00:00.000Z"
}
],
"slug": "orders-regression",
"updated_at": "2025-01-15T10:00:00.000Z"
}
}{
"detail": "Bad Request: name: Required",
"status": 400
}{
"detail": "Unauthorized: Missing or invalid API key",
"status": 401
}{
"detail": "AI eval requires at least Querier access on the model",
"status": 403
}Create an eval prompt set
Create a new eval prompt set bound to a shared model. Initial prompts can be supplied; additional prompts can be added later via PATCH.
curl --request POST \
--url https://{instance}.omniapp.co/api/v1/ai/eval/prompt-sets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model_id": "880e8400-e29b-41d4-a716-446655440003",
"name": "Orders regression",
"slug": "orders-regression",
"description": "Regression suite for the orders topic",
"prompts": []
}
'import requests
url = "https://{instance}.omniapp.co/api/v1/ai/eval/prompt-sets"
payload = {
"model_id": "880e8400-e29b-41d4-a716-446655440003",
"name": "Orders regression",
"slug": "orders-regression",
"description": "Regression suite for the orders topic",
"prompts": []
}
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({
model_id: '880e8400-e29b-41d4-a716-446655440003',
name: 'Orders regression',
slug: 'orders-regression',
description: 'Regression suite for the orders topic',
prompts: []
})
};
fetch('https://{instance}.omniapp.co/api/v1/ai/eval/prompt-sets', 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://{instance}.omniapp.co/api/v1/ai/eval/prompt-sets",
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([
'model_id' => '880e8400-e29b-41d4-a716-446655440003',
'name' => 'Orders regression',
'slug' => 'orders-regression',
'description' => 'Regression suite for the orders topic',
'prompts' => [
]
]),
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://{instance}.omniapp.co/api/v1/ai/eval/prompt-sets"
payload := strings.NewReader("{\n \"model_id\": \"880e8400-e29b-41d4-a716-446655440003\",\n \"name\": \"Orders regression\",\n \"slug\": \"orders-regression\",\n \"description\": \"Regression suite for the orders topic\",\n \"prompts\": []\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://{instance}.omniapp.co/api/v1/ai/eval/prompt-sets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model_id\": \"880e8400-e29b-41d4-a716-446655440003\",\n \"name\": \"Orders regression\",\n \"slug\": \"orders-regression\",\n \"description\": \"Regression suite for the orders topic\",\n \"prompts\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.omniapp.co/api/v1/ai/eval/prompt-sets")
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 \"model_id\": \"880e8400-e29b-41d4-a716-446655440003\",\n \"name\": \"Orders regression\",\n \"slug\": \"orders-regression\",\n \"description\": \"Regression suite for the orders topic\",\n \"prompts\": []\n}"
response = http.request(request)
puts response.read_body{
"prompt_set": {
"created_at": "2025-01-15T10:00:00.000Z",
"description": "Regression suite for the orders topic",
"id": "550e8400-e29b-41d4-a716-446655440000",
"is_archived": false,
"model_id": "880e8400-e29b-41d4-a716-446655440003",
"name": "Orders regression",
"prompts": [
{
"created_at": "2025-01-15T10:00:00.000Z",
"expectation": "The top product by revenue should be Aniseed Syrup.",
"id": "770e8400-e29b-41d4-a716-446655440002",
"prompt_text": "What are the top 5 products by revenue?",
"updated_at": "2025-01-15T10:00:00.000Z"
}
],
"slug": "orders-regression",
"updated_at": "2025-01-15T10:00:00.000Z"
}
}{
"detail": "Bad Request: name: Required",
"status": 400
}{
"detail": "Unauthorized: Missing or invalid API key",
"status": 401
}{
"detail": "AI eval requires at least Querier access on the model",
"status": 403
}Authorizations
Can be either an Organization API Key or Personal Access Token (PAT).
Include in the Authorization header as: Bearer YOUR_TOKEN
Body
The shared model this prompt set is bound to.
"880e8400-e29b-41d4-a716-446655440003"
Human-readable name for the prompt set. 255 characters or fewer.
1 - 255"Orders regression"
URL-safe identifier for the prompt set. Must be unique per model_id and match ^[a-z][a-z0-9-]*$. Max 255 characters.
255^[a-z][a-z0-9-]*$"orders-regression"
Optional human-readable description of the prompt set. Max 1024 characters.
1024"Regression suite for the orders topic"
Initial prompts for the set. Defaults to an empty list. At most 25 prompts.
25Show child attributes
Show child attributes
Response
Prompt set created successfully.
Show child attributes
Show child attributes
Was this page helpful?

