Credits and billing
How calls are billed, when a failure is not billed, and what happens if the credit store is unreachable.
Each API key draws against a balance of credits. One call burns one credit.
When a call is billed
The credit is burned after the request completes, and only when the
response status is below 500. A request that fails on Attestra's side,
a 5xx, is not billed: our failure, our cost. A 4xx response, by
contrast, is still billed; the request reached the API and was answered,
even if the answer was a rejection.
Running out
A key with no credits left gets 402:
{"error":"no credits remaining","code":"no_credits"}The balance is a ledger, not a number
The balance is backed by an append-only ledger rather than a single mutable counter. Every debit is a recorded entry, so the balance can be rebuilt from history and audited, rather than trusted as a number that could drift silently out of sync with what actually happened.
Topping up
Top-ups are handled through hosted invoices. See the pricing page for current rates.
If the credit store is unreachable
If the store backing the credit balance cannot be reached, the gate fails open rather than refusing traffic, matching the behaviour of the rate limiter (see Rate limits). Serving a handful of unbilled calls during an outage is preferred to taking every integration down over it.