billing

Charge a delivered run that finished without being billed

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.

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

Path parameters

idstring 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

What was settled, or would be

appliedboolean 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_afterboolean required
requeuedboolean required

Changes

No recorded changes to this operation across all 1 revision of this API.