Paying for AI per request sounds simple until you look at the edge cases: a request that fails halfway, two requests racing for the last rupiah, a retry that should not be charged twice. Here is exactly what Pecutin does with your balance on every call.
The balance
You top up a balance in rupiah, starting from Rp 50,000, through QRIS, a virtual account, or bank transfer. There is no monthly seat. The balance only moves when requests run on paid upstreams.
Before the request: check and hold
When a request arrives with your sk-pc-… key, the gateway first checks whether the balance can cover it, then holds a reservation. If the balance is not enough, the request is refused right away with a 402, before any provider is called. For the free Bansos pool, the equivalent refusal is a 429.
Holding first matters when many requests arrive at once. Without a hold, ten parallel requests could each see the same remaining balance and all be allowed through.
After the request: deduct and record
When the response is complete, the real cost is known: the model, the tokens in and out, the price. The gateway deducts that cost and writes one row to the ledger, and both happen in one database transaction. Either both are saved, or neither is.
The reservation is released at the same moment, so the hold never lingers on your balance.
Why one transaction matters
It gives a simple rule you can check at any time: the balance equals the sum of the ledger. There is exactly one ledger row per request, so a request cannot be charged twice or vanish from the record.
This was checked under load, not assumed. In a three-minute test at 2,000 requests per second on the production machine, 360,001 requests produced exactly 360,001 new ledger rows, and all 60 test accounts had a balance equal to the sum of their ledger.
Pertanyaan yang sering diajukan
- What happens if the provider fails?
The failed request does not produce a charge for a completed answer, and the reservation is released. Routing can also retry on another upstream if you set a fallback.
- Can I see each deduction?
Yes. Every request has its own ledger row with the model and cost, visible in the console.