---
docId: doc_4ffd1f0b0d7b46cd90759bec5c75eb53
title: Compare versions
description: "Compares existing results from two to four versions, scenario by scenario."
api:
  group: agentes/evals
  auth: bearer
  operations:
    - operationId: compareEvalRuns
      method: GET
      path: '/v1/agents/{agentId}/evals/compare'
      postmanName: Compare versions
      query:
        - key: suiteId
          value: ''
          description: La suite.
        - key: versions
          value: 'published,draft'
          description: De dos a cuatro versiones separadas por comas.
---

<script>
  import { Ways } from '$lib/components';
</script>

# Compare versions

Compare how two to four versions replied in the same [suite](/api-reference/evals). Send `suiteId` and `versions`; read `scenarios[].change` to see improvements or regressions. This uses each version’s latest completed run and **starts no new tests**.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl "https://api.platic.ai/v1/agents/$AGENT_ID/evals/compare?suiteId=$SUITE_ID&versions=v2,v3" \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.agents.evals.compare("agent_123", { suiteId: "suite_123", versions: ["v2", "v3"] });
```

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `agentId` | string | Agent ID | ✓ |

## Query parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `suiteId` | string | The suite. | ✓ |
| `versions` | string | Two to four versions separated by commas: `draft`, `published` or `vN` (`v5,v7`). | ✓ |

## Response

```json
{
  "status": "success",
  "data": {
    "suiteId": "s8Kd2LmQ",
    "comparable": true,
    "versions": [
      { "versionId": "v5", "runId": "run_b2c4", "launchId": "lch_2c9f41", "suiteHash": "sha256:9b0e…", "knowledgeFingerprint": "sha256:77aa…", "pass1": 0.5, "passed": false, "finishedAt": "2026-11-01T15:31:40.000Z" },
      { "versionId": "v7", "runId": "run_a1f3", "launchId": "lch_2c9f41", "suiteHash": "sha256:9b0e…", "knowledgeFingerprint": "sha256:77aa…", "pass1": 1, "passed": true, "finishedAt": "2026-11-01T15:30:12.000Z" }
    ],
    "warnings": [
      { "code": "errored_trials", "message": "Some trials of v5 ended in an error and were left out", "versionIds": ["v5"] }
    ],
    "scenarios": [
      {
        "scenarioId": "asks_for_person",
        "results": [
          { "trials": 2, "passedTrials": 0, "pass1": 0, "passHatK": { "2": 0 } },
          { "trials": 3, "passedTrials": 3, "pass1": 1, "passHatK": { "2": 1, "3": 1 } }
        ],
        "change": "improved"
      }
    ]
  }
}
```

## Response fields

| Field | Description |
|-------|-------------|
| `suiteId` | The suite. |
| `comparable` | `true` if all versions have a finished run of the same frozen suite (same `suiteHash`). |
| `versions` | One per requested version, in the same order, with the run that was used: `runId`, `launchId`, `suiteHash`, `knowledgeFingerprint` (fingerprint of the agent's files in that run), `pass1`, `passed` and `finishedAt`. Without a run, those fields are `null`. |
| `warnings` | Warnings. `versionIds` says which versions each one applies to and `message` explains it for people. |
| `scenarios[].scenarioId` | The scenario. |
| `scenarios[].results` | One entry per version, in the order of `versions`; `null` if that run does not have the scenario. It has `trials`, `passedTrials`, `pass1` and `passHatK`. It only counts valid trials: those with `error` or `cancelled` are left out. |
| `scenarios[].results[].passHatK` | Probability that `k` trials in a row all pass, for several `k`. It measures how consistent the version is. |
| `scenarios[].change` | The last version against the first: `improved`, `regressed`, `unchanged` or `incomparable` (the scenario changed between runs or is missing from one). |

Warnings (`warnings[].code`):

| `code` | Meaning |
|--------|---------|
| `missing_run` | A version has no finished run of that suite. |
| `suite_changed` | The runs did not run the same frozen suite. |
| `knowledge_changed` | The agent's files changed between runs. |
| `errored_trials` | A run had trials with a technical error; they were left out of the comparison. |

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `400` | `INVALID_REQUEST` | `suiteId` or `versions` is missing, or `versions` does not have two to four valid versions. |
| `404` | `AGENT_NOT_FOUND` | The agent does not exist or belongs to another workspace. |

A version without a run is not an error: the response arrives with the `missing_run` warning and `comparable: false`.

## Notes

- To compare with fresh results, [start a run](/api-reference/evals/runs/start) with all the versions (that way they run the same frozen suite in a single launch) and compare when it finishes.
- How trials are counted is in [Results](/api-reference/evals/results).
- Read access to the agent is enough.
