Credits and billing
FlashAPI credits are integer atomic units. One displayed credit is one unit.
JSON APIs send amounts as canonical base-10 strings such as "25000", never as
JavaScript numbers.
A reservation holds credits before upstream work. Capture consumes reserved credits after a chargeable terminal outcome. Release returns reserved credits after a non-chargeable outcome. Refunds are compensating grants; they never edit the original capture.
Request details in R2 expire after 30 days. Financial history does not follow that window. The wallet balance shown in the dashboard is the server projection, not a sum of ledger pages in the browser.
The public gateway forwards /{api}/{version}/... to that version’s origin.
The upstream sets the price with a response header, X-FlashAPI-Bill: 3.
FlashAPI charges that integer after the response, and never more than the
credits still available. A missing, invalid, timed-out, or failed upstream
response is not charged. An account with no credits is not proxied. The same
Idempotency-Key is charged once.
Subscriptions
Section titled “Subscriptions”The dashboard lists monthly Polar plans from a server allowlist and starts a
Polar checkout. Returning from Polar does not add credits. FlashAPI grants
units only after a verified benefit_grant.created or benefit_grant.cycled
webhook for an allowlisted credits benefit.
order.paid and subscription.cycled are recorded but do not grant.
subscription.cycled can fire before renewal payment succeeds.
benefit_grant.revoked expires unused remaining credits from that grant. It
does not claw back already-consumed units. Unused period credits do not roll
over.
Crypto checkout, invoices, postpaid billing, and automatic Polar refund debits are not part of this phase.