> ## Documentation Index
> Fetch the complete documentation index at: https://weights.fyi/run/llms.txt

# DELETE /v1/jobs/{job_id}

```text
DELETE https://weights.fyi/run/v1/jobs/<job_id>
Authorization: Bearer <token>                    scope: submit
```

**Available since:** 2026-10-08, when the service went live on weights.fyi/run, the clean stop of a training job included.

**Answer time:** synchronous for a page job and a measurement job: the cancel is recorded before the answer. A training job that is running answers `202` at once and finishes its stop afterwards, after saving its last checkpoint.

Stops a job. A page job's pages not yet sent are cancelled: their text is deleted, they never run or cost anything. Pages already with the model finish and are written as usual, so the job stays `RUNNING` with pages `in_flight` until they are in, then becomes `CANCELLED`. A training job stops cleanly instead: queued and not yet given to the model, it is cancelled at once; training, it turns `finishing`, saves its last checkpoint, weights first, and ends `CANCELLED` with the epochs it finished and the best model so far, charged up to the stop. A measurement job is `CANCELLED` at once: the work posted so far stays charged, nothing after it is.

Cancelling is safe to repeat: a finished job comes back unchanged, a finishing one answers `202` again. It counts against your token's request rate, so after a burst it can meet `429 rate_limited`. What ran is still charged, final once the model has stopped, including its 144 s of staying ready if it was started for this job.

## Request

| Name | Where | Required | Meaning |
|---|---|---|---|
| `Authorization` | header | yes | `Bearer` and your token. The token needs the `submit` scope, and the call counts against the token's request rate. |
| `job_id` | path | yes | The job to stop, `job_` followed by 24 hexadecimal characters. |

## Return value

The job as [GET /v1/jobs/{job_id}](/run/docs/reference/jobs-get.md) shows it, after the change:

| Answer | When | What it shows |
|---|---|---|
| **200 OK**, page job | Always. | `status` `CANCELLED` when no page was with the model, else `RUNNING` until those finish; `progress.cancelled` counts the pages that will not run. A finished job unchanged. |
| **202 Accepted**, training job | It was training. | `state` `finishing`, `state_text` "Finishing", while it saves and stops. |
| **200 OK**, training job | It was not training yet, or had finished. | `status` `CANCELLED` (or its earlier final word), `state` `done`, `stop_reason` `cancelled` for a job that never trained, or the training's own word, such as `signal`. |
| **200 OK**, measurement job | Always. | `status` `CANCELLED`, `state` `done`, `cancel_requested` `true`, with the rungs it finished under `progress.rungs`; a job that had already ended is returned unchanged. The fields are those of [a measurement job](/run/docs/reference/jobs-get.md). |

## Errors

| Status | Code | When it happens | What to do |
|---|---|---|---|
| `401` | `unauthorized`, `invalid_token`, `token_revoked`, `token_expired` | No token, or one that does not work (any more). | Use a valid token. |
| `403` | `scope_required`, `account_suspended` | The token lacks `submit`, or the account is suspended. | Use a token with `submit`; for a suspended account, talk to us. |
| `404` | `job_not_found` | The job does not exist or belongs to another account. | Check the id. |
| `429` | `rate_limited` | The token sends work faster than its request rate. | Wait the `Retry-After` seconds, then send the cancel again. |

## Examples

A one-page job still waiting for the model; no page ran, so the cost is zero and final (from a test copy of the service):

```sh
curl -s -X DELETE https://weights.fyi/run/v1/jobs/JOB_ID -H "Authorization: Bearer $WEIGHTS_API_KEY"
```

```json
{
  "job_id": "job_63a47e390e1b77237fbfeb4c",
  "model": "laya-page-role",
  "service_class": "flex",
  "status": "CANCELLED",
  "traceparent": "00-54da3ec45d99eba84336021ad3e15853-136241e49ed6a735-01",
  "waiting_for": null,
  "created_at": "2026-10-09T08:28:09.784Z",
  "started_at": null,
  "completed_at": "2026-10-09T08:28:09.788Z",
  "progress": {"total": 1, "done": 0, "failed": 0, "cancelled": 1, "queued": 0, "in_flight": 0,
               "pages_per_second": null, "eta_seconds": null, "rate_window_seconds": 60.0},
  "model_state": {"state": "asleep", "since": "2026-10-09T08:28:09.782Z", "expected_ready_seconds": 151},
  "cost": {"usd_micros": 0, "final": true,
           "basis": "the sum of the job's charges so far, each posted as its results landed, at the prices it was admitted at"},
  "runs": []
}
```

## Patterns

### Stopping a training job and keeping what it learned

The model is the epoch with the best validation score, so an early stop keeps it. When `progress.epochs_done` stops improving, cancel; poll until `CANCELLED`, then [read the results](/run/docs/reference/jobs-results.md): `model` and `checkpoints` name the best epoch so far.

## History

- 2026-10-08: live: unsent pages cancelled, pages with the model finish; a training job stops cleanly, weights first, keeping the best model.
- 2026-11-16: documented cancelling a measurement job.

## See also

[GET /v1/jobs/{job_id}](/run/docs/reference/jobs-get.md), [Fine-tune a model](/run/docs/fine-tune.md), [Prices and billing](/run/docs/prices.md).
