Create run from a dataset
Endpoint: POST /runs/dataset
Description Starts a run using an existing dataset: the server takes the dataset’s records and selected metrics.
Parameters
- Body —
application/json:
{
"dataset_id": 1,
"threshold": "integer | null",
"model_slug": "string | null",
"is_blocking": false
}
is_blocking
false(default)— The run and evaluation records are saved, then evaluation work is started in the background; the201response returns right away. Results may still be missing in that payload - pollGET /runs/{run_id}until evaluations complete. Prefer this for large datasets to avoid holding the HTTP request open.true— The API waits until every evaluation for this run has been executed. The response body normally includes filled-in scores,aggregate_results, andfinished_at, and credit usage for the run is finalized before you receive201.
Error responses
401,402— Auth or insufficient credits.422— Body/query validation failed.404—model_slugis not a documented model slug.400— Dataset id not found; metric IDs from the dataset config invalid; inactive metrics; duplicate run alias (unique per user).404— No records on the dataset; no metrics configured for the dataset.500— Failure creating the run.
Responses
201— same run object shape asGET /runs/{run_id}.
Example response (201)
{
"id": 991,
"user": "analyst@acme.com",
"run_type": "Dataset",
"run_source": "API",
"dataset": "Support QA - March",
"data_collection": "Customer Support",
"number_of_metrics": 2,
"result": 83.5,
"threshold": 70,
"model_slug": "gpt-4o",
"alias": "support-march",
"aggregate_results": {
"ans_corr": 86,
"faith": 81
},
"started_at": "2026-04-01T09:12:00Z",
"finished_at": null,
"is_gte_threshold": null,
"evaluations": []
}
curl
curl -X POST "https://api.aegisevals.ai/api/v1/runs/dataset" \
-H "Authorization: Bearer sk_00000000000000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"dataset_id":1,"threshold":70,"model_slug":"gpt-4o","is_blocking":false}'