---
title: "Charge a delivered run that finished without being billed"
method: POST
path: "/v1/admin/runs/{id}/rebill"
tags: ["billing"]
---

# Charge a delivered run that finished without being billed

`POST /v1/admin/runs/{id}/rebill`

## Request

- Base URL: `https://api.hyperresearch.ai`
- URL: `https://api.hyperresearch.ai/v1/admin/runs/{id}/rebill`
- Auth: API key in cookie `hr_session`

For a run that is `done` with `billed = 0`: settles its ledger row at the price the run was admitted at and puts it back on the billing queue. This is the repair for a run whose `finish` failed and then succeeded on a later attempt — the failed attempt wrote a $0 ledger row on the id the successful one then collided with (FAULT 79). Cross-workspace and audited. Dry run unless `apply=1`. Idempotent: the settle never raises a row that already carries a charge, so a second call reports `already_billed` and writes nothing. A trial-covered run reports `included` and is left at $0. Nothing here computes or chooses a price.

## Path parameters

- `id` string, required

## Query parameters

- `apply` '0' | '1': Omit (or `0`) for a DRY RUN: the response lists every row that would change and nothing is written. `1` performs the rewrite.

## Response `200`

What was settled, or would be

- AdminRunRebillResult
  - `applied` boolean, required
  - `plan` AdminRunRebillPlan, nullable, required
    - `run_id` string, required
    - `workspace_id` string, required
    - `status` string, required
    - `tier` string, required
    - `usage_event_id` string, required
    - `amount_cents` integer, required: The run's own frozen admission price. Nothing here computes a price.
    - `billed_before` boolean, required
  - `reason` 'run_not_found' | 'run_not_done' | 'already_billed' | 'included' | 'unknown_account' | 'skipped_charge_basis' | 'receipt_unreadable' | 'null', nullable, required: Why nothing is chargeable. `already_billed` is the idempotent second call; `included` is a trial-covered run, whose correct charge is $0; `skipped_charge_basis` is a done Deep the orchestrator deliberately settled below the tier price (salvaged, or chapters charged at the Light price); `receipt_unreadable` means its receipt could not be read to rule that out — retry.
  - `settlement` 'inserted' | 'raised' | 'existing' | 'null', nullable, required: `raised` is the repair this endpoint exists for: the $0 row a failed finish attempt left behind, lifted to the price. `existing` means another writer got there first and nothing was changed.
  - `billed_after` boolean, required
  - `requeued` boolean, required

## Other responses

- `400`: Invalid request
- `401`: Authentication failed
- `403`: Insufficient scope or plan
- `404`: Not found
- `429`: Rate limited or over quota
- `500`: Internal error

---

[API](https://skmtc.dev/hyperresearch/apis/hyperresearch-cloud-api.md) · [All operations](https://skmtc.dev/hyperresearch/apis/hyperresearch-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hyperresearch/apis/hyperresearch-cloud-api/revisions/726ef831ebf4?raw)
