Execute unified test run
curl --request POST \
--url https://api.trymaitai.ai/api/v1/unified-test-runs/{test_run_id}/execute \
--header 'X-Maitai-Api-Key: <api-key>'import requests
url = "https://api.trymaitai.ai/api/v1/unified-test-runs/{test_run_id}/execute"
headers = {"X-Maitai-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Maitai-Api-Key': '<api-key>'}};
fetch('https://api.trymaitai.ai/api/v1/unified-test-runs/{test_run_id}/execute', 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.trymaitai.ai/api/v1/unified-test-runs/{test_run_id}/execute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Maitai-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"
"net/http"
"io"
)
func main() {
url := "https://api.trymaitai.ai/api/v1/unified-test-runs/{test_run_id}/execute"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Maitai-Api-Key", "<api-key>")
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.trymaitai.ai/api/v1/unified-test-runs/{test_run_id}/execute")
.header("X-Maitai-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trymaitai.ai/api/v1/unified-test-runs/{test_run_id}/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Maitai-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": "<unknown>"
}Unified Test Runs
Execute unified test run
Schedule execution across MODEL / WORKFLOW / AGENT and return immediately.
Requires status=RUNNING (i.e. /prepare was called). Non-blocking: the service validates state, resolves the API key when required, and schedules a conductor (in-proc asyncio task in dev, K8s Job named unified-test-run-{id} in prod). HTTP returns the run row while it is still processing. Callers poll GET /{id}/progress to watch counts advance and to observe the final transition to COMPLETED (or FAILED for setup errors like missing API key or missing workflow).
Per-item failures do not abort the run, items are marked FAILED with an error_message and the run still lands in COMPLETED.
POST
/
unified-test-runs
/
{test_run_id}
/
execute
Execute unified test run
curl --request POST \
--url https://api.trymaitai.ai/api/v1/unified-test-runs/{test_run_id}/execute \
--header 'X-Maitai-Api-Key: <api-key>'import requests
url = "https://api.trymaitai.ai/api/v1/unified-test-runs/{test_run_id}/execute"
headers = {"X-Maitai-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Maitai-Api-Key': '<api-key>'}};
fetch('https://api.trymaitai.ai/api/v1/unified-test-runs/{test_run_id}/execute', 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.trymaitai.ai/api/v1/unified-test-runs/{test_run_id}/execute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Maitai-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"
"net/http"
"io"
)
func main() {
url := "https://api.trymaitai.ai/api/v1/unified-test-runs/{test_run_id}/execute"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Maitai-Api-Key", "<api-key>")
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.trymaitai.ai/api/v1/unified-test-runs/{test_run_id}/execute")
.header("X-Maitai-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trymaitai.ai/api/v1/unified-test-runs/{test_run_id}/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Maitai-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": "<unknown>"
}Was this page helpful?