Engineering · · 7 min read
Why AI work uses credit holds
Reserve before provider work, settle with the artifact, and release on failure.
Last reviewed:
An AI request can fail after it starts, be retried by a browser, or race another worker. Charging at the beginning over-bills failures; charging only at the end can overspend a shared balance.
PostCopilot reserves available credits before provider work. Successful generations settle the hold alongside the durable artifact or action. Failed generations release it, while abandoned holds expire through maintenance.
The Usage page reads the append-only ledger, so the displayed totals come from server-authoritative debit and credit events rather than editable settings.
Frequently asked questions
Why not just charge when the AI request starts?
Because AI requests can fail after they start. Charging at the beginning bills users for failures; PostCopilot instead reserves a hold and releases it if the generation fails.
Why not charge only when the request finishes?
A browser retry or a racing worker could overspend a shared balance between start and finish. Reserving before work bounds concurrent spending to credits that actually exist.
What happens to holds that are never settled?
Abandoned holds expire through maintenance, returning the reserved credits. Successful generations settle their hold alongside the durable artifact; failures release it immediately.
Can I audit what was charged?
Yes. The Usage page reads the append-only ledger, so displayed totals come from server-authoritative debit and credit events rather than editable settings.