> ## Documentation Index
> Fetch the complete documentation index at: https://docs.archetypeai.app/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Start with /introduction/getting-started. Use the Direct Query API (POST /api/lens/query) with the Newton Fusion model (text, image, and video reasoning) or the Newton Omega encoder (time-series embeddings). ATAI_API_ENDPOINT is the base URL https://platform.u1.archetypeai.app with no version path; every endpoint path begins with /api. Pages whose descriptions are marked (Archived) document the legacy Lens runtime — do not use them for new projects.

# List Eval Examples

> Page through what an eval measured for each of its examples

Requires [version 1.1.12](https://docs.archetypeai.app/release-notes/1.1.x.md#v1-1-12) or later of the Archetype platform.

## Overview

This endpoint lists what an eval measured for each of its examples.

The eval's own `metrics_report` answers "is this agent good enough"; these answer "where is it
bad". Each example is scored on its own rows as the run streams, and the run-level report is
those examples pooled — so the two always agree, and a run-level figure is never the mean of what
this returns.

Results are ordered by the example's position in the run, oldest first. That is deliberately not
the newest-first order the other lists use: an example set has no time order, so the useful order
is the one the caller supplied.

An example is listed as soon as the run has finished it. A running eval lists the examples it
has finished so far, and an eval that failed or was cancelled keeps the ones it finished; once
the eval completes, every example is listed. An example that could not be scored is listed with
status `failed` and the reason in `error`.

> [!NOTE]
>
> The HTTP status code returned is `404` both if the specified eval ID is unknown and if the ID
> exists but belongs to another organization.

## Request

**eval\_id** `string` *required*

Eval `evl_` id.

**limit** `integer` (default: 100)

Page size. Minimum `1`, maximum `1000`.

**after** `string`

Forward cursor: return examples after this page's last one. Pass the previous page's
`next_cursor`. Mutually exclusive with `before`.

**before** `string`

Backward cursor: return examples before this page's first one. Pass the current page's
`prev_cursor`. Mutually exclusive with `after`.

## Response

**data** `array` *required*

The page, in the order the eval was given its examples. Unlike every other list in this API
this is *not* newest-first: an example set has no time order, and reversing the list the caller
supplied would only make it harder to read.

Each entry in this array is an [Example result object](#example-result-object).

**has\_more** `boolean` *required*

`true` when more results exist beyond this page in the direction of travel.

**next\_cursor** `string`

Cursor for the next page in the same direction — pass it as `after` when paging forward, or as
`before` when you supplied `before`. `null` when `has_more` is false.

**prev\_cursor** `string`

Cursor to step back the way this page was reached. `null` on the first page.

### Example result object

**id** `string` *required*

Identifier of this example result.

**name** `string` *required*

How the example is identified — its own `name`, or the stem of its input file when it declared none.

**ordinal** `integer` *required*

The example's 1-based position in the run, and the order results are listed in.

**inputs** `array` *required*

The example's input refs, each carrying the CRC32C of the bytes scored.

**status** `string` *required*

Whether the example was scored, and how cleanly: `completed`, `partial`, or `failed`. Narrower
than the eval's own status on purpose — an example is not dispatched, paused, or cancelled on
its own. It is part of a run that either got far enough to score it or did not.

**targets** `object`

One entry per scored target. Absent when the example was not scored. Same shape as the run
report's [`targets`](https://docs.archetypeai.app/api-reference/agents/evals/get-eval#target-report-metrics_report-targets-\<target-name>),
narrowed to this example's rows — so a client that renders the run's numbers renders an
example's with no second code path. The run's own figure is every example pooled, not the mean
of these.

> [!NOTE]
>
> `targets` is absent on an example whose `status` is `failed`; when the status is `failed`,
> read `error` instead.

**constraints** `array`

What the example measured against the eval's constraints, judged on its own figures: one
[constraint verdict](https://docs.archetypeai.app/api-reference/agents/evals/get-eval.md#constraint-verdict-metrics_report-constraints)
per constraint. Absent when the eval has no constraints, or the example was not scored. [v2.0.0+](https://docs.archetypeai.app/release-notes/2.0.x.md#v2-0-0)

**feasible** `boolean`

Whether every constraint holds on this example: `false` when one is missed, `null` when none is
missed but one cannot be judged because its objective has no value. Present whenever
`constraints` is. [v2.0.0+](https://docs.archetypeai.app/release-notes/2.0.x.md#v2-0-0)

**metadata** `object`

The free-form tags the example was created with. What a long per-example table is sliced by —
which site, which shift, which operator.

**ground\_truth\_records\_rejected** `integer`

How many of the example's ground-truth records matched no prediction and were dropped. Absent
for an eval whose report does not count them.

**error** `string`

Why the example was not scored. Present when `status` is `failed`.

```bash cURL theme={"system"}
curl "$ATAI_API_URL/api/agents/evals/evl_01jcb0h2m6t4xr9nv3k7pdzs5y/examples?limit=20" \
  -H "Authorization: Bearer $ATAI_API_KEY"
```

```python Python theme={"system"}
import os
import requests

base_url = os.environ["ATAI_API_URL"]
api_key = os.environ["ATAI_API_KEY"]
headers = {"Authorization": f"Bearer {api_key}"}

eval_id = "evl_01jcb0h2m6t4xr9nv3k7pdzs5y"

cursor = None
while True:
    params = {"limit": 100}
    if cursor:
        params["after"] = cursor

    response = requests.get(f"{base_url}/api/agents/evals/{eval_id}/examples", headers=headers, params=params)
    page = response.json()

    for example in page["data"]:
        if example["status"] == "failed":
            print(f"{example['ordinal']:>3} {example['name']}: {example['error']}")
            continue
        score = example["targets"]["state"]["aggregate"]["macro_f1"]
        print(f"{example['ordinal']:>3} {example['name']}: macro_f1={score}")

    if not page["has_more"]:
        break
    cursor = page["next_cursor"]
```

```javascript JavaScript theme={"system"}
const response = await fetch(
  `${process.env.ATAI_API_URL}/api/agents/evals/evl_01jcb0h2m6t4xr9nv3k7pdzs5y/examples?limit=20`,
  {
    headers: {
      'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
    }
  }
);

const page = await response.json();

page.data.forEach(example => {
  if (example.status === 'failed') {
    console.error(`${example.ordinal} ${example.name}: ${example.error}`);
    return;
  }
  const score = example.targets.state.aggregate.macro_f1;
  console.log(`${example.ordinal} ${example.name}: macro_f1=${score}`);
});
```

```json 200 - Success theme={"system"}
{
  "data": [
    {
      "id": "<example_result_id>",
      "name": "site-a-morning",
      "ordinal": 1,
      "inputs": [
        {"type": "file", "id": "file_abc123", "format": "csv", "crc32c": "AAAAAA=="}
      ],
      "status": "completed",
      "targets": {
        "state": {
          "type": "category",
          "aggregate": {"macro_f1": 0.92, "accuracy": 0.94},
          "class_names": ["running", "idle"],
          "per_class": {
            "precision": [0.94, 0.92],
            "recall": [0.97, 0.86],
            "f1": [0.96, 0.89],
            "support": [2100, 900]
          },
          "confusion_matrix": [[2037, 63], [126, 774]],
          "missed": [0, 0],
          "false_alarms": [0, 0],
          "pairing": "by_time",
          "items": 3000,
          "items_failed": 0
        }
      },
      "ground_truth_records_rejected": 0,
      "metadata": {"site": "a", "shift": "morning"}
    },
    {
      "id": "<example_result_id>",
      "name": "site-b-idle-run",
      "ordinal": 2,
      "inputs": [
        {"type": "file", "id": "file_def456", "format": "csv", "crc32c": "AAAAAA=="}
      ],
      "status": "failed",
      "metadata": {"site": "b", "shift": "night"},
      "error": "<reason>"
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "prev_cursor": null
}
```

```json 200 - Still running theme={"system"}
{
  "data": [
    {
      "id": "<example_result_id>",
      "name": "site-a-morning",
      "ordinal": 1,
      "inputs": [
        {"type": "file", "id": "file_abc123", "format": "csv", "crc32c": "AAAAAA=="}
      ],
      "status": "completed",
      "targets": {
        "state": {
          "type": "category",
          "aggregate": {"macro_f1": 0.92, "accuracy": 0.94},
          "class_names": ["running", "idle"],
          "per_class": {
            "precision": [0.94, 0.92],
            "recall": [0.97, 0.86],
            "f1": [0.96, 0.89],
            "support": [2100, 900]
          },
          "confusion_matrix": [[2037, 63], [126, 774]],
          "missed": [0, 0],
          "false_alarms": [0, 0],
          "pairing": "by_time",
          "items": 3000,
          "items_failed": 0
        }
      },
      "ground_truth_records_rejected": 0,
      "metadata": {"site": "a", "shift": "morning"}
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "prev_cursor": null
}
```

```json 400 - Invalid query parameter theme={"system"}
{
  "errors": [
    {
      "code": "<error_code>",
      "message": "Invalid query parameter.",
      "suggestion": null,
      "error_uid": "err-xxxxxxxx"
    }
  ]
}
```

```json 404 - Eval not found theme={"system"}
{
  "errors": [
    {
      "code": "<error_code>",
      "message": "Eval not found.",
      "suggestion": null,
      "error_uid": "err-xxxxxxxx"
    }
  ]
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.