Am I charged when an AI image generation fails or is canceled?

On Sume's image API a completed image is billed in full and a failed or canceled one is not. How the reserve, capture and refund work, and what a 402 means.

4 min readSume
All posts

No. Sume's image docs say image generation billing is all-or-nothing: a completed generation is billed in full, and a failed or cancelled one is not billed. A request that ends early because your client disconnected is treated as a failed generation and is not billed either.

That is from the Image API and Core concepts docs, read 2026-09-29. Failed direct requests return 502 Bad Gateway.

What happens to the money when I submit?

Provider-backed generation can reserve the estimated cost from your wallet on submit, capture the actual cost on success, and refund on failure or cancellation before capture. If the balance cannot cover the estimate, the submit fails with 402 insufficient_credits and no work starts.

Billing outcomes for one image generation, from Sume's docs, 2026-09-29.
OutcomeBilled?
CompletedYes, in full, at the endpoint price
Failed (502 or failed job)No
Canceled before captureNo
Client disconnects earlyCounted as failed, not billed
Balance too low at submit402, no job starts

Can I cancel a queued image?

Yes: POST /v1/jobs/:id/cancel works before generation starts. After that it returns 409 job_generation_already_started.

curl -X POST https://api.sume.com/v1/jobs/job_123/cancel \
  -H "Authorization: Bearer $SUME_API_KEY"

What if I retry after a timeout?

Send the same Idempotency-Key for the same payload. Reusing a key for a different payload returns 409 idempotency_conflict. The images route can answer 202 with a job envelope when it outlasts its 30-second wait, so a slow request is not a failed one: poll the job.

Where do I see what I paid?

The response's usage.cost is the USD amount billed to your wallet, and it is already the amount after Sume's margin.

Sources

Related posts

More in Pricing

All Pricing posts

Written by Sume