---
title: "Compare Runs"
method: GET
path: "/api/v1/optimization/runs/compare"
tags: ["optimization"]
---

# Compare Runs

`GET /api/v1/optimization/runs/compare`

Compare prompt diffs and scores across optimization runs.

## Query parameters

- `run_ids` string, required — Comma-separated run IDs to compare (max 5).

## Response `200`

Successful Response

- RunComparisonResponse — Cross-run comparison payload.
  - `runs` RunComparisonItem[], required — Compared run summaries.
    - `run_id` string, required — Optimization run identifier.
    - `program_spec` string, required — DSPy program specification optimized.
    - `validation_score` number, nullable — Validation score from the run.
    - `prompt_snapshots` PromptSnapshotItem[], required — Before/after prompt snapshots for this run.
      - `predictor_name` string, required — Predictor name from named_predictors().
      - `prompt_type` string, required — Snapshot type: 'before' or 'after'.
      - `prompt_text` string, required — Full prompt/instruction text.

## Other responses

- `400` — Invalid run_ids parameter.
- `401` — Authentication is required or the provided token is invalid.
- `422` — Validation Error

## Changes

- **2026-05-23** `6178f925cdec` — 1 breaking, 3 info
  - the `detail` response's property type changed from `array` to no type for status `422`
  - added `subschema #1, subschema #2` to the `detail` response property `anyOf` list for the response status `422`
  - added the required property `code` to the response with the `422` status
  - added the required property `message` to the response with the `422` status
- **2026-04-18** `1f45411d7556` — 1 breaking
  - the `runs/items/run_id` response's property type changed from `integer` to `string` for status `200`
- **2026-04-14** `3044e5c4a9da` — 1 info
  - endpoint added
- **2026-03-19** `78507b29ed8f` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/qredence/apis/fleet-rlm/changes/api/v1/optimization/runs/compare/get.md)

---

[API](https://skmtc.dev/qredence/apis/fleet-rlm.md) · [All operations](https://skmtc.dev/qredence/apis/fleet-rlm/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/qredence/fleet-rlm/revisions/e25aaded81b9/schema)
