curl --request POST \
--url https://api.galtea.ai/tests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"productId": "prod_123",
"name": "Quality Test",
"type": "QUALITY",
"specificationIds": [
"spec_123"
],
"specificationId": "spec_123",
"groundTruthUri": "https://my-bucket.s3.amazonaws.com/tests/ground-truth.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...",
"uri": "https://my-bucket.s3.amazonaws.com/tests/test.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...",
"empty": false,
"fewShot": "Q: What is 2+2? A: 4",
"languageCode": "es-MX",
"backgroundNoiseProfile": "street",
"backgroundNoiseLevel": "medium",
"variants": [
"rag"
],
"customVariantDescription": "Custom test variant",
"strategies": [
"original"
],
"customUserPersona": "Business analyst",
"maxTestCases": 100,
"maxIterations": 10,
"models": [
"gpt-4"
],
"sourceTestId": "test_123",
"dataCatalogUri": "https://my-bucket.s3.amazonaws.com/tests/data-catalog.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...",
"endpointConnectionId": "endpoint_connection_123",
"metadata": {
"key": "value"
}
}
'import requests
url = "https://api.galtea.ai/tests"
payload = {
"productId": "prod_123",
"name": "Quality Test",
"type": "QUALITY",
"specificationIds": ["spec_123"],
"specificationId": "spec_123",
"groundTruthUri": "https://my-bucket.s3.amazonaws.com/tests/ground-truth.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...",
"uri": "https://my-bucket.s3.amazonaws.com/tests/test.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...",
"empty": False,
"fewShot": "Q: What is 2+2? A: 4",
"languageCode": "es-MX",
"backgroundNoiseProfile": "street",
"backgroundNoiseLevel": "medium",
"variants": ["rag"],
"customVariantDescription": "Custom test variant",
"strategies": ["original"],
"customUserPersona": "Business analyst",
"maxTestCases": 100,
"maxIterations": 10,
"models": ["gpt-4"],
"sourceTestId": "test_123",
"dataCatalogUri": "https://my-bucket.s3.amazonaws.com/tests/data-catalog.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...",
"endpointConnectionId": "endpoint_connection_123",
"metadata": { "key": "value" }
}
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({
productId: 'prod_123',
name: 'Quality Test',
type: 'QUALITY',
specificationIds: ['spec_123'],
specificationId: 'spec_123',
groundTruthUri: 'https://my-bucket.s3.amazonaws.com/tests/ground-truth.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...',
uri: 'https://my-bucket.s3.amazonaws.com/tests/test.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...',
empty: false,
fewShot: 'Q: What is 2+2? A: 4',
languageCode: 'es-MX',
backgroundNoiseProfile: 'street',
backgroundNoiseLevel: 'medium',
variants: ['rag'],
customVariantDescription: 'Custom test variant',
strategies: ['original'],
customUserPersona: 'Business analyst',
maxTestCases: 100,
maxIterations: 10,
models: ['gpt-4'],
sourceTestId: 'test_123',
dataCatalogUri: 'https://my-bucket.s3.amazonaws.com/tests/data-catalog.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...',
endpointConnectionId: 'endpoint_connection_123',
metadata: {key: 'value'}
})
};
fetch('https://api.galtea.ai/tests', 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.galtea.ai/tests",
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([
'productId' => 'prod_123',
'name' => 'Quality Test',
'type' => 'QUALITY',
'specificationIds' => [
'spec_123'
],
'specificationId' => 'spec_123',
'groundTruthUri' => 'https://my-bucket.s3.amazonaws.com/tests/ground-truth.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...',
'uri' => 'https://my-bucket.s3.amazonaws.com/tests/test.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...',
'empty' => false,
'fewShot' => 'Q: What is 2+2? A: 4',
'languageCode' => 'es-MX',
'backgroundNoiseProfile' => 'street',
'backgroundNoiseLevel' => 'medium',
'variants' => [
'rag'
],
'customVariantDescription' => 'Custom test variant',
'strategies' => [
'original'
],
'customUserPersona' => 'Business analyst',
'maxTestCases' => 100,
'maxIterations' => 10,
'models' => [
'gpt-4'
],
'sourceTestId' => 'test_123',
'dataCatalogUri' => 'https://my-bucket.s3.amazonaws.com/tests/data-catalog.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...',
'endpointConnectionId' => 'endpoint_connection_123',
'metadata' => [
'key' => 'value'
]
]),
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.galtea.ai/tests"
payload := strings.NewReader("{\n \"productId\": \"prod_123\",\n \"name\": \"Quality Test\",\n \"type\": \"QUALITY\",\n \"specificationIds\": [\n \"spec_123\"\n ],\n \"specificationId\": \"spec_123\",\n \"groundTruthUri\": \"https://my-bucket.s3.amazonaws.com/tests/ground-truth.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...\",\n \"uri\": \"https://my-bucket.s3.amazonaws.com/tests/test.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...\",\n \"empty\": false,\n \"fewShot\": \"Q: What is 2+2? A: 4\",\n \"languageCode\": \"es-MX\",\n \"backgroundNoiseProfile\": \"street\",\n \"backgroundNoiseLevel\": \"medium\",\n \"variants\": [\n \"rag\"\n ],\n \"customVariantDescription\": \"Custom test variant\",\n \"strategies\": [\n \"original\"\n ],\n \"customUserPersona\": \"Business analyst\",\n \"maxTestCases\": 100,\n \"maxIterations\": 10,\n \"models\": [\n \"gpt-4\"\n ],\n \"sourceTestId\": \"test_123\",\n \"dataCatalogUri\": \"https://my-bucket.s3.amazonaws.com/tests/data-catalog.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...\",\n \"endpointConnectionId\": \"endpoint_connection_123\",\n \"metadata\": {\n \"key\": \"value\"\n }\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.galtea.ai/tests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"productId\": \"prod_123\",\n \"name\": \"Quality Test\",\n \"type\": \"QUALITY\",\n \"specificationIds\": [\n \"spec_123\"\n ],\n \"specificationId\": \"spec_123\",\n \"groundTruthUri\": \"https://my-bucket.s3.amazonaws.com/tests/ground-truth.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...\",\n \"uri\": \"https://my-bucket.s3.amazonaws.com/tests/test.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...\",\n \"empty\": false,\n \"fewShot\": \"Q: What is 2+2? A: 4\",\n \"languageCode\": \"es-MX\",\n \"backgroundNoiseProfile\": \"street\",\n \"backgroundNoiseLevel\": \"medium\",\n \"variants\": [\n \"rag\"\n ],\n \"customVariantDescription\": \"Custom test variant\",\n \"strategies\": [\n \"original\"\n ],\n \"customUserPersona\": \"Business analyst\",\n \"maxTestCases\": 100,\n \"maxIterations\": 10,\n \"models\": [\n \"gpt-4\"\n ],\n \"sourceTestId\": \"test_123\",\n \"dataCatalogUri\": \"https://my-bucket.s3.amazonaws.com/tests/data-catalog.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...\",\n \"endpointConnectionId\": \"endpoint_connection_123\",\n \"metadata\": {\n \"key\": \"value\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/tests")
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 \"productId\": \"prod_123\",\n \"name\": \"Quality Test\",\n \"type\": \"QUALITY\",\n \"specificationIds\": [\n \"spec_123\"\n ],\n \"specificationId\": \"spec_123\",\n \"groundTruthUri\": \"https://my-bucket.s3.amazonaws.com/tests/ground-truth.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...\",\n \"uri\": \"https://my-bucket.s3.amazonaws.com/tests/test.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...\",\n \"empty\": false,\n \"fewShot\": \"Q: What is 2+2? A: 4\",\n \"languageCode\": \"es-MX\",\n \"backgroundNoiseProfile\": \"street\",\n \"backgroundNoiseLevel\": \"medium\",\n \"variants\": [\n \"rag\"\n ],\n \"customVariantDescription\": \"Custom test variant\",\n \"strategies\": [\n \"original\"\n ],\n \"customUserPersona\": \"Business analyst\",\n \"maxTestCases\": 100,\n \"maxIterations\": 10,\n \"models\": [\n \"gpt-4\"\n ],\n \"sourceTestId\": \"test_123\",\n \"dataCatalogUri\": \"https://my-bucket.s3.amazonaws.com/tests/data-catalog.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...\",\n \"endpointConnectionId\": \"endpoint_connection_123\",\n \"metadata\": {\n \"key\": \"value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "test_123",
"productId": "prod_123",
"userId": "user_123",
"name": "Quality Test",
"type": "QUALITY",
"models": [
"gpt-4",
"claude-3"
],
"groundTruthUri": "https://files.galtea.ai/tests/test_123/ground-truth.csv",
"uri": "https://files.galtea.ai/tests/test_123/test.csv",
"error": "<string>",
"status": "SUCCESS",
"fewShot": "Example few-shot learning data",
"languageCode": "es-MX",
"backgroundNoiseProfile": "street",
"backgroundNoiseLevel": "medium",
"variants": [
"rag",
"summarization"
],
"customVariantDescription": "Custom variant description",
"strategies": [
"original"
],
"customUserPersona": "Business analyst",
"maxTestCases": 100,
"sourceTestId": "<string>",
"dataCatalogUri": "https://files.galtea.ai/tests/test_123/data-catalog.json",
"metadata": {
"key": "value"
},
"specificationIds": [
"spec_123"
],
"specificationId": "spec_123",
"isExtendable": true,
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Create dataset
Create a new dataset. See Datasets.
File uploads. The uri, groundTruthUri, and dataCatalogUri fields of TestInput
each expect a presigned GET URL (S3 X-Amz-* or Azure Blob SAS) for a file that was
already uploaded via the storage PUT-presign endpoint. The server strips the signing
query and persists the underlying storage URI (s3://<bucket>/<key> for S3, or the
query-less blob URL for Azure) on the created dataset. A file URI the API returned
under STORAGE_PUBLIC_BASE_URL is accepted too, and stored in that same canonical form.
Providing uri switches the request into “custom dataset file” mode: generation is
skipped, the dataset is created in SUCCESS state, and credit checks / maxTestCases
/ generator-specific validations are bypassed.
Sending empty: true creates the dataset with no test cases, in SUCCESS state, with no
generation and no credit check. Add test cases afterwards with POST /testCases. It cannot
be combined with uri, groundTruthUri, dataCatalogUri, sourceTestId, or any generation
field (maxTestCases, strategies, variants, customVariantDescription, fewShot,
customUserPersona, maxIterations, endpointConnectionId).
specificationIds links the dataset to each listed specification of its product. Every
one must be a POLICY or CAPABILITY specification with the same testType, and generation
reads the first one. The deprecated specificationId reads as a one-item
specificationIds; a body with both answers 400 unless they name the same specification.
To change the links later, use PATCH /tests/{id} or specifications link-datasets.
curl --request POST \
--url https://api.galtea.ai/tests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"productId": "prod_123",
"name": "Quality Test",
"type": "QUALITY",
"specificationIds": [
"spec_123"
],
"specificationId": "spec_123",
"groundTruthUri": "https://my-bucket.s3.amazonaws.com/tests/ground-truth.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...",
"uri": "https://my-bucket.s3.amazonaws.com/tests/test.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...",
"empty": false,
"fewShot": "Q: What is 2+2? A: 4",
"languageCode": "es-MX",
"backgroundNoiseProfile": "street",
"backgroundNoiseLevel": "medium",
"variants": [
"rag"
],
"customVariantDescription": "Custom test variant",
"strategies": [
"original"
],
"customUserPersona": "Business analyst",
"maxTestCases": 100,
"maxIterations": 10,
"models": [
"gpt-4"
],
"sourceTestId": "test_123",
"dataCatalogUri": "https://my-bucket.s3.amazonaws.com/tests/data-catalog.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...",
"endpointConnectionId": "endpoint_connection_123",
"metadata": {
"key": "value"
}
}
'import requests
url = "https://api.galtea.ai/tests"
payload = {
"productId": "prod_123",
"name": "Quality Test",
"type": "QUALITY",
"specificationIds": ["spec_123"],
"specificationId": "spec_123",
"groundTruthUri": "https://my-bucket.s3.amazonaws.com/tests/ground-truth.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...",
"uri": "https://my-bucket.s3.amazonaws.com/tests/test.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...",
"empty": False,
"fewShot": "Q: What is 2+2? A: 4",
"languageCode": "es-MX",
"backgroundNoiseProfile": "street",
"backgroundNoiseLevel": "medium",
"variants": ["rag"],
"customVariantDescription": "Custom test variant",
"strategies": ["original"],
"customUserPersona": "Business analyst",
"maxTestCases": 100,
"maxIterations": 10,
"models": ["gpt-4"],
"sourceTestId": "test_123",
"dataCatalogUri": "https://my-bucket.s3.amazonaws.com/tests/data-catalog.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...",
"endpointConnectionId": "endpoint_connection_123",
"metadata": { "key": "value" }
}
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({
productId: 'prod_123',
name: 'Quality Test',
type: 'QUALITY',
specificationIds: ['spec_123'],
specificationId: 'spec_123',
groundTruthUri: 'https://my-bucket.s3.amazonaws.com/tests/ground-truth.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...',
uri: 'https://my-bucket.s3.amazonaws.com/tests/test.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...',
empty: false,
fewShot: 'Q: What is 2+2? A: 4',
languageCode: 'es-MX',
backgroundNoiseProfile: 'street',
backgroundNoiseLevel: 'medium',
variants: ['rag'],
customVariantDescription: 'Custom test variant',
strategies: ['original'],
customUserPersona: 'Business analyst',
maxTestCases: 100,
maxIterations: 10,
models: ['gpt-4'],
sourceTestId: 'test_123',
dataCatalogUri: 'https://my-bucket.s3.amazonaws.com/tests/data-catalog.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...',
endpointConnectionId: 'endpoint_connection_123',
metadata: {key: 'value'}
})
};
fetch('https://api.galtea.ai/tests', 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.galtea.ai/tests",
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([
'productId' => 'prod_123',
'name' => 'Quality Test',
'type' => 'QUALITY',
'specificationIds' => [
'spec_123'
],
'specificationId' => 'spec_123',
'groundTruthUri' => 'https://my-bucket.s3.amazonaws.com/tests/ground-truth.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...',
'uri' => 'https://my-bucket.s3.amazonaws.com/tests/test.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...',
'empty' => false,
'fewShot' => 'Q: What is 2+2? A: 4',
'languageCode' => 'es-MX',
'backgroundNoiseProfile' => 'street',
'backgroundNoiseLevel' => 'medium',
'variants' => [
'rag'
],
'customVariantDescription' => 'Custom test variant',
'strategies' => [
'original'
],
'customUserPersona' => 'Business analyst',
'maxTestCases' => 100,
'maxIterations' => 10,
'models' => [
'gpt-4'
],
'sourceTestId' => 'test_123',
'dataCatalogUri' => 'https://my-bucket.s3.amazonaws.com/tests/data-catalog.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...',
'endpointConnectionId' => 'endpoint_connection_123',
'metadata' => [
'key' => 'value'
]
]),
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.galtea.ai/tests"
payload := strings.NewReader("{\n \"productId\": \"prod_123\",\n \"name\": \"Quality Test\",\n \"type\": \"QUALITY\",\n \"specificationIds\": [\n \"spec_123\"\n ],\n \"specificationId\": \"spec_123\",\n \"groundTruthUri\": \"https://my-bucket.s3.amazonaws.com/tests/ground-truth.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...\",\n \"uri\": \"https://my-bucket.s3.amazonaws.com/tests/test.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...\",\n \"empty\": false,\n \"fewShot\": \"Q: What is 2+2? A: 4\",\n \"languageCode\": \"es-MX\",\n \"backgroundNoiseProfile\": \"street\",\n \"backgroundNoiseLevel\": \"medium\",\n \"variants\": [\n \"rag\"\n ],\n \"customVariantDescription\": \"Custom test variant\",\n \"strategies\": [\n \"original\"\n ],\n \"customUserPersona\": \"Business analyst\",\n \"maxTestCases\": 100,\n \"maxIterations\": 10,\n \"models\": [\n \"gpt-4\"\n ],\n \"sourceTestId\": \"test_123\",\n \"dataCatalogUri\": \"https://my-bucket.s3.amazonaws.com/tests/data-catalog.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...\",\n \"endpointConnectionId\": \"endpoint_connection_123\",\n \"metadata\": {\n \"key\": \"value\"\n }\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.galtea.ai/tests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"productId\": \"prod_123\",\n \"name\": \"Quality Test\",\n \"type\": \"QUALITY\",\n \"specificationIds\": [\n \"spec_123\"\n ],\n \"specificationId\": \"spec_123\",\n \"groundTruthUri\": \"https://my-bucket.s3.amazonaws.com/tests/ground-truth.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...\",\n \"uri\": \"https://my-bucket.s3.amazonaws.com/tests/test.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...\",\n \"empty\": false,\n \"fewShot\": \"Q: What is 2+2? A: 4\",\n \"languageCode\": \"es-MX\",\n \"backgroundNoiseProfile\": \"street\",\n \"backgroundNoiseLevel\": \"medium\",\n \"variants\": [\n \"rag\"\n ],\n \"customVariantDescription\": \"Custom test variant\",\n \"strategies\": [\n \"original\"\n ],\n \"customUserPersona\": \"Business analyst\",\n \"maxTestCases\": 100,\n \"maxIterations\": 10,\n \"models\": [\n \"gpt-4\"\n ],\n \"sourceTestId\": \"test_123\",\n \"dataCatalogUri\": \"https://my-bucket.s3.amazonaws.com/tests/data-catalog.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...\",\n \"endpointConnectionId\": \"endpoint_connection_123\",\n \"metadata\": {\n \"key\": \"value\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/tests")
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 \"productId\": \"prod_123\",\n \"name\": \"Quality Test\",\n \"type\": \"QUALITY\",\n \"specificationIds\": [\n \"spec_123\"\n ],\n \"specificationId\": \"spec_123\",\n \"groundTruthUri\": \"https://my-bucket.s3.amazonaws.com/tests/ground-truth.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...\",\n \"uri\": \"https://my-bucket.s3.amazonaws.com/tests/test.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...\",\n \"empty\": false,\n \"fewShot\": \"Q: What is 2+2? A: 4\",\n \"languageCode\": \"es-MX\",\n \"backgroundNoiseProfile\": \"street\",\n \"backgroundNoiseLevel\": \"medium\",\n \"variants\": [\n \"rag\"\n ],\n \"customVariantDescription\": \"Custom test variant\",\n \"strategies\": [\n \"original\"\n ],\n \"customUserPersona\": \"Business analyst\",\n \"maxTestCases\": 100,\n \"maxIterations\": 10,\n \"models\": [\n \"gpt-4\"\n ],\n \"sourceTestId\": \"test_123\",\n \"dataCatalogUri\": \"https://my-bucket.s3.amazonaws.com/tests/data-catalog.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...\",\n \"endpointConnectionId\": \"endpoint_connection_123\",\n \"metadata\": {\n \"key\": \"value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "test_123",
"productId": "prod_123",
"userId": "user_123",
"name": "Quality Test",
"type": "QUALITY",
"models": [
"gpt-4",
"claude-3"
],
"groundTruthUri": "https://files.galtea.ai/tests/test_123/ground-truth.csv",
"uri": "https://files.galtea.ai/tests/test_123/test.csv",
"error": "<string>",
"status": "SUCCESS",
"fewShot": "Example few-shot learning data",
"languageCode": "es-MX",
"backgroundNoiseProfile": "street",
"backgroundNoiseLevel": "medium",
"variants": [
"rag",
"summarization"
],
"customVariantDescription": "Custom variant description",
"strategies": [
"original"
],
"customUserPersona": "Business analyst",
"maxTestCases": 100,
"sourceTestId": "<string>",
"dataCatalogUri": "https://files.galtea.ai/tests/test_123/data-catalog.json",
"metadata": {
"key": "value"
},
"specificationIds": [
"spec_123"
],
"specificationId": "spec_123",
"isExtendable": true,
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Authorizations
API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....
Headers
Send return=minimal to get no body back from a write and skip reading the resource: a create answers 201 with only Location, and an update answers 204.
"return=minimal"
Body
Product ID. Null creates a dataset of no product.
"prod_123"
Test name
"Quality Test"
Dataset type. Required unless specificationIds are sent; then the dataset takes the specifications' test type.
QUALITY, RED_TEAMING, SCENARIOS, null "QUALITY"
Specifications of the product to link the dataset to. They must share one testType, which the dataset takes. Generation reads the first one.
["spec_123"]
Deprecated, send specificationIds. Read as a one-item specificationIds; sending both answers 400 unless they name the same specification.
"spec_123"
Presigned GET URL (S3 X-Amz-* query or Azure Blob SAS) for a ground-truth file previously uploaded via the storage PUT-presign endpoint. The server strips the signing query and persists the underlying storage URI. Cannot be combined with sourceTestId.
"https://my-bucket.s3.amazonaws.com/tests/ground-truth.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=..."
Presigned GET URL for a fully prepared custom test file previously uploaded via the storage PUT-presign endpoint. When provided, no test-case generation runs: the file is ingested as-is, the test is created in SUCCESS state, and maxTestCases, generator-related fields, and credit checks are skipped. Cannot be combined with sourceTestId or dataCatalogUri. Must be non-empty.
"https://my-bucket.s3.amazonaws.com/tests/test.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=..."
Sending empty: true creates the dataset with no test cases, in SUCCESS state, with no generation and no credit check. Add test cases afterwards with POST /testCases. It cannot be combined with uri, groundTruthUri, dataCatalogUri, sourceTestId, or any generation field (maxTestCases, strategies, variants, customVariantDescription, fewShot, customUserPersona, maxIterations, endpointConnectionId). Not supported on POST /tests/batch.
Optional few-shot examples used to guide test-case generation for QUALITY tests.
"Q: What is 2+2? A: 4"
BCP-47 language tag (e.g. en, es-MX). The region subtag selects the regional variety in simulated user messages and voice synthesis; generated test text keeps the base language. The value is stored as the full tag. A bare code for ca, de, es, eu, fr, gl, it, nl or pt defaults to the European variety of that language, in simulated user messages only (pt -> pt-PT); an explicit region always overrides it, and neither voice synthesis nor the stored value is affected.
"es-MX"
Background noise mixed into the simulated caller audio during a voice test. Clip-backed (office, street, car) or synthetic (white, pink). Null means off; set together with backgroundNoiseLevel.
office, street, car, white, pink, null "street"
How loud the background noise is relative to the caller speech. Null means off; set together with backgroundNoiseProfile.
light, medium, heavy, null "medium"
Test variants. QUALITY: rag, entity_extraction, summarization, classification, translation, correction, other. RED_TEAMING: data_leakage, financial_attacks, illegal_activities, misuse, toxicity, custom.
["rag"]
Custom variant description
"Custom test variant"
Generation strategies. "original" is the default for RED_TEAMING. At least one strategy is required for SCENARIOS tests.
["original"]
"Business analyst"
100
SCENARIOS only. Maximum number of conversation turns per generated scenario when scenario generation is executed. If omitted, the scenario-generator default is used. If uri is provided, no scenario generation runs, so this field is ignored at test-creation time. When generation runs, the value is forwarded to the scenario-generator and persisted on each generated test case. Ignored for QUALITY and RED_TEAMING tests.
x >= 110
["gpt-4"]
Source QUALITY test ID whose approved test cases seed a SCENARIOS test. Only valid when type = SCENARIOS. Cannot be combined with uri or groundTruthUri.
"test_123"
Presigned GET URL for a data-catalog file previously uploaded via the storage PUT-presign endpoint. Only valid when type = SCENARIOS. Cannot be combined with uri.
"https://my-bucket.s3.amazonaws.com/tests/data-catalog.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=..."
Endpoint connection whose input schema the generated test cases follow. Ignored when uri is provided.
"endpoint_connection_123"
Arbitrary key-value metadata
{ "key": "value" }
Response
Dataset created successfully. On Prefer: return=minimal, or when the read after the write fails, the answer has no body.
"test_123"
"prod_123"
"user_123"
"Quality Test"
QUALITY, RED_TEAMING, SCENARIOS "QUALITY"
["gpt-4", "claude-3"]
Storage URI of the ground-truth file, derived from the presigned URL supplied at creation. Returned as <STORAGE_PUBLIC_BASE_URL>/<key> when the deployment configures a public file base, otherwise in its stored form. S3: s3://<bucket>/<key>. Azure Blob: blob URL with the SAS query stripped (e.g. https://<account>.blob.core.windows.net/<container>/<path>). Either form resolves through GET /storage/generate-get-presigned-url.
"https://files.galtea.ai/tests/test_123/ground-truth.csv"
Storage URI of the uploaded custom test file. Same format rules as groundTruthUri.
"https://files.galtea.ai/tests/test_123/test.csv"
PENDING, SUCCESS, FAILED, AUGMENTING, EXTENDING, CANCELLED "SUCCESS"
Optional few-shot examples (input/output pairs) used to guide test-case generation for QUALITY tests.
"Example few-shot learning data"
BCP-47 language tag (e.g. en, es-MX). The region subtag selects the regional variety in simulated user messages and voice synthesis; generated test text keeps the base language. The value is stored as the full tag. A bare code for ca, de, es, eu, fr, gl, it, nl or pt defaults to the European variety of that language, in simulated user messages only (pt -> pt-PT); an explicit region always overrides it, and neither voice synthesis nor the stored value is affected.
"es-MX"
Background noise mixed into the simulated caller audio during a voice test. Clip-backed (office, street, car) or synthetic (white, pink). Null means off; set together with backgroundNoiseLevel.
office, street, car, white, pink, null "street"
How loud the background noise is relative to the caller speech. Null means off; set together with backgroundNoiseProfile.
light, medium, heavy, null "medium"
Test variants. QUALITY: rag, entity_extraction, summarization, classification, translation, correction, other. RED_TEAMING: data_leakage, financial_attacks, illegal_activities, misuse, toxicity, custom.
["rag", "summarization"]
"Custom variant description"
Generation strategies. "original" is the default for RED_TEAMING. At least one strategy is required for SCENARIOS tests.
["original"]
"Business analyst"
100
Storage URI of the data-catalog file (SCENARIOS tests only). Same format rules as groundTruthUri.
"https://files.galtea.ai/tests/test_123/data-catalog.json"
Arbitrary metadata, returned as stored. Usually an object, but any JSON value is accepted.
{ "key": "value" }
The specifications this dataset is linked to, oldest link first.
["spec_123"]
Deprecated, read specificationIds. The oldest linked specification, or null when there is none.
"spec_123"
True when the test can be extended by re-running its original generator (generated tests; QUALITY only when it has a ground-truth document). False for uploaded tests.
true