---
title: "Cancel an eval run"
method: POST
path: "/api/v1/ai/eval/runs/{runId}/cancel"
tags: ["AI Eval"]
---

# Cancel an eval run

`POST /api/v1/ai/eval/runs/{runId}/cancel`

Cancel an in-flight eval run. Any non-terminal per-prompt jobs are cancelled and the run is archived — the response returns the updated run inline (`status: CANCELLED`, `is_archived: true`); use `/unarchive` to surface it in the default `archived=false` list again.

## Path parameters

- `runId` string, uuid, required — The unique identifier of the eval run.

## Response `200`

Cancellation processed.

- EvalRunsCancelResponse
  - `cancelled` integer, required — Number of per-prompt agentic jobs that were cancelled by this request.
  - `run` object, required — The cancelled run. `status: CANCELLED` and `is_archived: false` after this call.
    - `branch_id` string, uuid, nullable, required — Optional branch ID the run was executed against. Null when run against the main shared model.
    - `branch_name` string, nullable, required — Display name for the branch, if `branch_id` is set.
    - `completed_at` string, nullable, required — ISO 8601 timestamp when the run reached a terminal state.
    - `created_at` string, nullable, required — ISO 8601 timestamp when the run was created.
    - `description` string, nullable, required — Optional human-readable description for the run.
    - `id` string, uuid, required — Unique identifier for the run.
    - `is_archived` boolean, required — Whether the run has been archived.
    - `model_id` string, uuid, required — The shared model this run was executed against.
    - `prompt_set_id` string, uuid, required — The prompt set this run was created from.
    - `repeat_count` integer, required — How many times each prompt in the set was executed. Results carry a `repeat_index` when this is greater than 1.
    - `results` EvalRunResult[], required — Per-execution results for this run (one per prompt, times the repeat count). No guaranteed order — group executions by `eval_prompt_id` and order by `repeat_index`.
      - `agentic_job` EvalRunResultAgenticJob, required
        - `conversation_id` string, uuid, nullable, required — Conversation the agentic job belongs to.
        - `id` string, uuid, required — Agentic job identifier.
        - `state` 'CANCELLED' | 'COMPLETE' | 'DELIVERING' | 'EXECUTING' | 'FAILED' | 'QUEUED', required — Current state of the agentic job that ran this prompt.
      - `ai_timing_ms` integer, nullable, required — Strict main-agent LLM processing time in milliseconds — the measured model-call duration, excluding tool execution and subagent model calls (those count toward `tool_timing_ms`). Shown as "AI time" in the UI. Runs recorded before this was measured fall back to an approximation (`timing_ms` minus tool latency).
      - `cost` number, nullable, required — Total LLM cost (USD) for this prompt, if available.
      - `error_reason` string, nullable, required — Failure reason string for prompts whose underlying job failed.
      - `eval_prompt_id` string, uuid, nullable, required — Snapshot of the prompt id this result was executed for — repeated executions of the same prompt share it, and it survives later prompt deletion. Null on runs created before repeats existed.
      - `expectation` string, nullable, required — The prompt's expectation as of run creation (snapshotted, so later prompt edits don't change past runs), or null when none was set. The analysis judge scores the analysis against it.
      - `id` string, uuid, required — Unique identifier for the run result row.
      - `prompt` string, required — The prompt text that was evaluated.
      - `query_count` integer, nullable, required — Number of warehouse queries the underlying job ran. Null for runs executed before this metric was recorded.
      - `query_timing_ms` integer, nullable, required — Total wall-clock time (milliseconds) the underlying job spent running warehouse queries — a proxy for query execution time. Null for runs executed before this metric was recorded.
      - `repeat_index` integer, nullable, required — 0-based repeat number of this execution within the run (see the run's `repeat_count`). Null on runs created before repeats existed.
      - `score` number, nullable, required — Numeric judge score for this prompt result, if scoring ran.
      - `scoring_cost` number, nullable, required — Total LLM cost (USD) for scoring this prompt result.
      - `timing_ms` integer, nullable, required — Total `/generate` wall-time in milliseconds — LLM processing plus inner-loop tool execution. `ai_timing_ms` and `tool_timing_ms` split this; warehouse query time is separate (`query_timing_ms`).
      - `tool_timing_ms` integer, nullable, required — Inner-loop tool latency in milliseconds — time spent running tools the model invoked (model and field-value lookups, query planning), excluding the warehouse query itself (`query_timing_ms`). Null for runs recorded before per-tool latency was tracked.
    - `run_number` integer, required — Sequential, per-prompt-set run number.
    - `status` 'RUNNING' | 'COMPLETE' | 'CANCELLED', required — Run-level lifecycle. Flips to a terminal state (COMPLETE or CANCELLED) exactly once.
  - `total` integer, required — Total number of jobs in the run (prompts × the repeat count).

## Other responses

- `401` — Missing or invalid API key.
- `403` — Insufficient permissions.
- `404` — Run not found.
- `500` — The run was cancelled and archived, but could not be re-read for the response — safe to retry.

---

[API](https://skmtc.net/omniapp/apis/omni-api.md) · [All operations](https://skmtc.net/omniapp/apis/omni-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/omniapp/omni-api/versions/de7cac8b5983/schema)
