For the complete documentation index, see llms.txt. This page is also available as Markdown.

POST /v2/evals/experiments/{experiment_id}/jobs

Create Eval Experiment Job

post

Start a job on the experiment. With mode generate the job produces outputs for the experiment's rows and scores them in the same job when evaluator IDs are passed; with mode score it scores the existing outputs with the selected evaluators, at least one, and regenerates nothing. The job is queued: the response is 202 with the job URL in Location and status_url. Poll that URL until the job's status is completed, completed_with_failures, failed or cancelled. One job runs per experiment at a time; starting another while one is active returns 409. When the active job is known, Location and meta.status_url point to it, with its IDs in meta.job_id and meta.experiment_id.

How to use

Use generate for new outputs (and optional evaluation), score for existing outputs with at least one evaluator. Persist the returned job ID/status_url. Only one active job is allowed; follow the existing job on 409 instead of starting duplicates.

Authentication and permissions

Required permissions: evals.run. Resource and owner access checks also apply.

Prepare request.json

Save the example body below as request.json for the curl sample. Replace example IDs, node keys, and dynamic configuration with values for your organization; these are illustrative, not pre-existing resources.

{
  "mode": "generate",
  "evaluator_ids": [
    "00000000-0000-4000-8000-000000000001"
  ]
}
Authorizations
AuthorizationstringRequired

Personal API key (sk_...) or supported user access JWT. See Authentication and authorization for endpoint restrictions and scopes. Use exactly one Authorization header.

Path parameters
experiment_idstring · uuidRequired
Body
modestring · enumRequired

What a job does.

generate: produce outputs for the experiment's rows, and score them when evaluators were selected. score: score existing outputs only; nothing is regenerated.

Possible values:
evaluator_idsstring · uuid[]Optional
Responses
202

Successful Response

application/json
post/v2/evals/experiments/{experiment_id}/jobs
curl
curl --fail-with-body -sS \
  "$STACKAI_BASE_URL/v2/evals/experiments/${EXPERIMENT_ID}/jobs" \
  -H "Authorization: Bearer $STACKAI_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary @request.json
{
  "response_code": "text",
  "meta": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "data": {
    "status": "accepted",
    "job_id": "123e4567-e89b-12d3-a456-426614174000",
    "experiment_id": "123e4567-e89b-12d3-a456-426614174000",
    "status_url": "text"
  }
}

Last updated

Was this helpful?