Sume reserve, capture, refund: what your cost ledger should mirror
Sume reserves the estimate at submit, captures it on success and releases it on failure or cancel. Mirror the three states or cost reports will double count.

Sume bills a paid generation in three steps: reserve the estimate when the request is accepted, capture the usage when the job completes, and release or refund the reservation when it fails or is canceled before capture. Your own cost records should follow the same states, or a queued job will look like spend that never happens.
The three states
The docs describe usage as public USD estimates reserved at submit. A submit that cannot reserve the estimate fails 402 insufficient_credits before provider work starts, and a failed queue admission also releases its reservation. GET /v1/usage lists these ledger entries, such as reservations, captures, refunds and top-ups, and GET /v1/balance returns available balance.
| Event | Ledger effect | Your record |
|---|---|---|
| Submit accepted | Reservation of the estimate | Held |
| Job completed | Capture of actual usage | Spent |
| Job failed or canceled before capture | Reservation released or refunded | Released |
| Submit refused 402 | Nothing reserved | Not started |
Pitfalls
Do not add reservations to captures, since a completed job shows both. Do not read available balance as final spend while jobs are queued; held amounts are not available but are not spent yet. When a client timeout fires, the job keeps running and will capture, so keep the id.
A weekly check
Once a week, sum captures from the usage ledger and compare with your per-job records. Differences usually mean a job id you never stored.
Sources
Related posts
More in Developers
- Sume SDK returns {data, error}, not exceptions: an unwrap helper
Generated @sume-com/sdk operations resolve with data, error and response instead of throwing. Wrap them in an unwrap helper that throws a typed error.
- Where the Sume TypeScript SDK runs: Node 18+, Bun, Deno and Workers
@sume-com/sdk has no runtime dependencies and needs only fetch and WebCrypto. Install it, create a client, and know which options and helpers it adds.
- Sume video callback_url must be HTTPS: a webhook instead of polling
POST /v1/videos accepts callback_url, which must be HTTPS. Event names, the signature header, retries, and when a poll loop is still the safer choice.
- Sume video job failed: retry, new key, or switch the model?
A failed video job is final, and an Idempotency-Key replay returns the same failed job. Read the error, then retry with a new key or change models.
Written by Sume