# Fixes

On the paid plans, the registry API answers a document with the changes that raise its readiness score, as a JSON Patch against the document exactly as you sent it.

Fixes to your spec are rules-only JSON Patch: no workspace feature sends your spec to an AI model. The paid readiness report on our public site does, outside the workspace.

### 1. Ask for the fixes

Send the document as the body, as you would to push it. Nothing is stored and no version is made.

```sh
curl -sS -X POST "$BASE/fixes" -H "Authorization: Bearer $LATITUDE10_KEY" --data-binary @openapi.yaml
```

### 2. Read the patch

| Field | What it holds |
| --- | --- |
| `rulesVersion` | The version of the readiness rules used. |
| `scoreBefore` | The document's score as sent. |
| `scoreAfter` | Its score with the patch applied. |
| `operations` | How many operations the patch improves. |
| `patch` | The JSON Patch operations, in order. |

The fixes fill in what the rules look for, such as operationIds, summaries, descriptions, parameter descriptions, examples and an `Idempotency-Key` header on writes. Read them before you apply them.

## From the GitHub Action

With `suggest-fixes: true` and `LATITUDE10_KEY` on a paid plan, the [Action](github-action) opens or updates one pull request that applies the fixes to your file.

## Limits and errors

Each request counts as one fix run against your workspace's monthly runs, before the body is read: see [Plans and limits](../get-started/plans-and-limits#registry). Monthly quotas reset on the first of the month, UTC.

| Status | When |
| --- | --- |
| `403` | The plan has no fixes: `Suggested fixes are part of the paid plans.` |
| `413` | The body is larger than the registry reads. |
| `422` | The body isn't an OpenAPI 3.0 or 3.1 document in one file. |
| `429` | The month's fix runs are used, until `resetsAt`. |

## Where this comes from

- `app/api/registry/v1/fixes/route.ts`
- `app/registry/_lib/fixes.ts`
- `app/registry/_lib/json-patch.ts`
- `app/registry/_lib/usage.ts`
- `app/registry/_lib/ci.ts`
