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

# Compare two model checkpoints

> **Required scope:** models:manage

**Required scope:** `models:manage`

### Request body

`CompareModelsRequest`

<ParamField body="checkpoint_a" type="string" required>
  First checkpoint ID
</ParamField>

<ParamField body="checkpoint_b" type="string" required>
  Second checkpoint ID
</ParamField>

### Response

`ModelComparison`

<ResponseField name="checkpoint_a" type="string" required>
  Checkpoint A identifier
</ResponseField>

<ResponseField name="checkpoint_b" type="string" required>
  Checkpoint B identifier
</ResponseField>

<ResponseField name="config_changes" type="ConfigChange[]" required>
  Configuration changes

  <Expandable title="ConfigChange">
    <ResponseField name="field" type="string" required>
      Field that changed
    </ResponseField>

    <ResponseField name="value_a" type="string" required>
      Value in checkpoint A
    </ResponseField>

    <ResponseField name="value_b" type="string" required>
      Value in checkpoint B
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="metric_diffs" type="MetricDiff" required>
  <Expandable title="MetricDiff">
    <ResponseField name="accuracy_diff" type="number (double)" required>
      Accuracy difference (B - A)
    </ResponseField>

    <ResponseField name="f1_diff" type="number (double)" required>
      F1 score difference
    </ResponseField>

    <ResponseField name="loss_diff" type="number (double)" required>
      Loss difference
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="recommendation" type="string" required>
  Recommendation
</ResponseField>

### Status codes

| Code  | Meaning                                            |
| ----- | -------------------------------------------------- |
| `200` | Comparison result                                  |
| `401` | Unauthorized — missing or invalid credentials      |
| `403` | Forbidden — the key/token lacks the required scope |
| `404` | Checkpoint not found                               |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.nsr.stateset.com/api/v1/model/compare' \
    --header "X-API-Key: $STATESET_NSR_API_KEY" \
    --header 'Content-Type: application/json' \
    --data '{
    "checkpoint_a": "string",
    "checkpoint_b": "string"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "checkpoint_a": "string",
    "checkpoint_b": "string",
    "config_changes": [
      {
        "field": "string",
        "value_a": "string",
        "value_b": "string"
      }
    ],
    "metric_diffs": {
      "accuracy_diff": 1.5,
      "f1_diff": 1.5,
      "loss_diff": 1.5
    },
    "recommendation": "string"
  }
  ```
</ResponseExample>
