Log in Create workspace
Skip to content

API reference

Eval Runs

Queue a configured evaluation suite and read case-level scores, traces, latency, cost, and review state.

Jump to 2 endpoints
On this page

Overview

An evaluation run checks how your workflow performs against a set of test cases. Use it to assess a change before relying on it in production, or to investigate a regression. Creating a run queues the enabled cases from an existing suite; read the run until it reaches completed, failed, or cancelled, then inspect its summary and individual results.

Runs are queued work
POST creates a run in queued state; workers advance it through running to a terminal state. The API does not promise an immediate result or an automatic client retry, so persist the returned run ID and poll deliberately.
Standard and shadow modes
A standard run evaluates suite cases with their stored inputs. A shadow run samples production traces, optionally filters and segments them using only the documented allowlist, and can compare a candidate workflow version; sample size defaults to 12 and is clamped to 1 through 25.
Result and review views coexist
Terminal reads include aggregate pass rate and counts, per-case results, trace IDs, latency and cost, plus review counts and reviewed pass rate. Automated passed and score remain distinct from any final human-reviewed values.

Before you begin

  • The command-line examples require curl and jq; any exception is identified in its introduction.
  • An existing eval suite linked to a workflow target, with enabled cases prepared in the operator console.
  • A machine credential with eval_runs:write to schedule and eval_runs:read to fetch results.
  • Add eval_suites:read only if the machine client will list or inspect suites; the optional suite-creation example separately requires eval_suites:write.
  • A reachable workflow target and any managed secret required by its outbound authentication mode.

How it works

  1. Choose a ready suite

    List or read eval suites and verify the intended target and enabled cases. Creating a suite through the machine API does not create its cases.

  2. Queue the run

    POST its eval_suite_id, adding a workflow version or shadow parameters only when needed. Store the returned id; a monthly eval-run quota can reject creation with 429.

  3. Read through a terminal state

    GET the run at a controlled interval. Stop on completed, failed, or cancelled; on completion, inspect every result as well as aggregate fields because a completed run can contain failed or error cases.

Examples

These examples are illustrative. Replace the sample values with your own. Keep credentials in environment variables or a secret manager, never in client-side code.

Create the suite shell

This establishes suite policy. Add enabled cases in /app/evals/suites/:id before expecting case results.

bash
export AGENTOPS_BASE_URL="https://robotscenter.net"
export AGENT_TOKEN="machine_token_with_eval_suite_write"
export WORKFLOW_TARGET_ID="f92da274-a794-49ee-bd4d-b13022a6041a"

SUITE_RESPONSE=$(jq -n --arg target "$WORKFLOW_TARGET_ID" \
  '{eval_suite: {name: "Checkout contract", workflow_target_id: $target, rubric_type: "status_code", pass_threshold: 100.0}}' |
  curl --fail-with-body --silent --show-error \
    -X POST -H 'content-type: application/json' \
    -H "Authorization: Bearer $AGENT_TOKEN" \
    --data-binary @- "$AGENTOPS_BASE_URL/api/v1/eval_suites")

export EVAL_SUITE_ID=$(printf '%s' "$SUITE_RESPONSE" | jq -r '.id')
printf '%s' "$SUITE_RESPONSE" | jq .
What to expect

HTTP 201 returns the suite directly, including its ID, target summary, scheduling settings, and current eval_cases list.

Queue an eval run

Use the suite ID after its test cases are ready.

bash
export AGENTOPS_BASE_URL="https://robotscenter.net"
export AGENT_TOKEN="machine_token_with_eval_run_write"
export EVAL_SUITE_ID="9e1f1538-ff37-48f0-a2f9-65066d7d6699"

RUN_RESPONSE=$(jq -n --arg suite "$EVAL_SUITE_ID" \
  '{eval_suite_id: $suite, run_kind: "standard"}' |
  curl --fail-with-body --silent --show-error \
    -X POST -H 'content-type: application/json' \
    -H "Authorization: Bearer $AGENT_TOKEN" \
    --data-binary @- "$AGENTOPS_BASE_URL/api/v1/eval_runs")

export EVAL_RUN_ID=$(printf '%s' "$RUN_RESPONSE" | jq -r '.id')
printf '%s' "$RUN_RESPONSE" | jq '{id, status, run_kind, eval_suite_id}'
What to expect

HTTP 201 returns the run directly, normally with status: queued, along with its suite and workflow target identities.

Read terminal results

Poll with the read-scoped credential and stop when status is terminal.

bash
export AGENTOPS_BASE_URL="https://robotscenter.net"
export AGENT_TOKEN="machine_token_with_eval_run_read"
export EVAL_RUN_ID="d0b91d0c-0f4b-4a28-8d9d-ccf0c427d6e8"

curl --fail-with-body --silent --show-error \
  -H "Authorization: Bearer $AGENT_TOKEN" \
  "$AGENTOPS_BASE_URL/api/v1/eval_runs/$EVAL_RUN_ID" |
  jq '{id, status, pass_rate, total_cases, passed_cases, failed_cases, results}'
What to expect

HTTP 200 returns aggregate fields and a results array. Each result can include status, automated and reviewed scores, latency, cost, trace IDs, and its eval-case summary.

Troubleshooting

The run completes with zero cases
The suite had no enabled cases. Machine suite creation does not accept a cases payload; create and enable cases in the operator eval-suite UI before scheduling.
Creation returns 429
The workspace exhausted eval_runs_per_month. The quota problem includes upgrade context; changing the run payload does not bypass the quota.
A run stays queued or becomes failed
Check /ready for queue health, then inspect run results and related traces. Verify the target is reachable, its secret is valid, and its timeout covers the workflow response.

Endpoint reference

Ready to integrate? Open an endpoint for its required permissions, request fields, response format, and status codes. The examples above explain the workflow; these details define each individual request.

POST
/api/v1/eval_runs API key / access token

Create an eval run from an eval suite

eval_runs:write

Description

Schedules a new evaluation run. Requires an existing eval_suite_id. Create eval suites via POST /api/v1/eval_suites or the operator dashboard. sample_size is clamped to 1..25 (default 12). segment_filters and segment_by are allowlisted to environment, workflow_version_id, service_agent_id, metadata.customer_tier, and metadata.language. Create returns 429 when eval_runs_per_month is exhausted.

Auth

API key / access token

Required Scopes

eval_runs:write
Request Body
Field Type Required Description
trace_id string No AgentOps trace UUID. Must belong to this workspace and engagement when both are supplied.
candidate_workflow_version_id string No Candidate workflow version for shadow runs
engagement_id string No AgentOps engagement UUID. Must belong to this workspace.
eval_run_id string No AgentOps eval UUID for correlation; must belong to this workspace.
eval_suite_id string Yes UUID of the eval suite to run
hiring_id string No Marketplace hiring identifier for cross-system correlation.
provider string No Canonical provider name supplied by the originating runtime.
provider_run_id string No Provider run identifier supplied by the originating runtime for cross-system correlation.
run_kind string (standard, shadow) No Run mode
sample_size integer No Requested shadow sample size. Clamped to 1..25; default 12.
segment_by array<object> No Shadow summary dimensions. Allowlisted to environment, workflow_version_id, service_agent_id, metadata.customer_tier, metadata.language.
segment_filters object No Optional production-trace filters for shadow sampling. Allowed keys: environment, workflow_version_id, service_agent_id, metadata.customer_tier, metadata.language.
source_failure_group_id string No Failure group UUID when the run is incident-derived
trace_attempt integer No Marketplace attempt fence carried with the correlation envelope.
workflow_version_id string No Optional workflow version to test
Responses
201

Eval run scheduled

Returns: EvalRun

Example
{
  "average_cost": null,
  "average_latency_ms": null,
  "candidate_workflow_version": null,
  "candidate_workflow_version_id": null,
  "correlation": {
    "contract_version": "correlation/v1",
    "eval_run_id": "d0b91d0c-0f4b-4a28-8d9d-ccf0c427d6e8",
    "provider": "provider-runtime",
    "provider_run_id": "provider-run-example"
  },
  "eval_suite": null,
  "eval_suite_id": "9e1f1538-ff37-48f0-a2f9-65066d7d6699",
  "failed_cases": 2,
  "finished_at": "2026-03-20T14:05:00Z",
  "id": "d0b91d0c-0f4b-4a28-8d9d-ccf0c427d6e8",
  "inserted_at": "2026-03-20T14:00:00Z",
  "pass_rate": "0.85",
  "passed_cases": 8,
  "results": [],
  "review_counts": {
    "approved": 0,
    "pending": 0,
    "revised": 0,
    "total": 0,
    "unreviewed": 0
  },
  "reviewed_pass_rate": null,
  "run_kind": "standard",
  "segments": [],
  "shadow_summary": null,
  "source_failure_group": null,
  "source_failure_group_id": null,
  "started_at": "2026-03-20T14:00:00Z",
  "status": "completed",
  "summary": null,
  "total_cases": 10,
  "triggered_by_id": null,
  "updated_at": "2026-03-20T14:05:00Z",
  "workflow_target": null,
  "workflow_target_id": null,
  "workflow_version": null,
  "workflow_version_id": null
}
401

Invalid or missing token

403

Missing required scope

404

Eval suite not found

429

Plan quota exceeded. Problem type https://robotscenter.net/problems/quota-exceeded for eval_runs_per_month.

GET
/api/v1/eval_runs/:id API key / access token

Get eval run details

eval_runs:read

Description

Returns details of a specific eval run including results.

Auth

API key / access token

Required Scopes

eval_runs:read
Parameters
Name In Type Required Description
id path string Yes Eval run UUID
Responses
200

Eval run details

Returns: EvalRun

Example
{
  "average_cost": null,
  "average_latency_ms": null,
  "candidate_workflow_version": null,
  "candidate_workflow_version_id": null,
  "correlation": {
    "contract_version": "correlation/v1",
    "eval_run_id": "d0b91d0c-0f4b-4a28-8d9d-ccf0c427d6e8",
    "provider": "provider-runtime",
    "provider_run_id": "provider-run-example"
  },
  "eval_suite": null,
  "eval_suite_id": "9e1f1538-ff37-48f0-a2f9-65066d7d6699",
  "failed_cases": 2,
  "finished_at": "2026-03-20T14:05:00Z",
  "id": "d0b91d0c-0f4b-4a28-8d9d-ccf0c427d6e8",
  "inserted_at": "2026-03-20T14:00:00Z",
  "pass_rate": "0.85",
  "passed_cases": 8,
  "results": [],
  "review_counts": {
    "approved": 0,
    "pending": 0,
    "revised": 0,
    "total": 0,
    "unreviewed": 0
  },
  "reviewed_pass_rate": null,
  "run_kind": "standard",
  "segments": [],
  "shadow_summary": null,
  "source_failure_group": null,
  "source_failure_group_id": null,
  "started_at": "2026-03-20T14:00:00Z",
  "status": "completed",
  "summary": null,
  "total_cases": 10,
  "triggered_by_id": null,
  "updated_at": "2026-03-20T14:05:00Z",
  "workflow_target": null,
  "workflow_target_id": null,
  "workflow_version": null,
  "workflow_version_id": null
}
401

Invalid or missing token

403

Missing required scope

404

Eval run not found

Where to go next

see also