Skip to navigation

Cancel a Request

The Ideogram API doesn’t support cancelling a request. Once a request is accepted, it runs to completion and is billed when it completes, even if you stop waiting for it. A request that is rejected before it runs, such as a 429, is not billed.

Stop waiting safely

  • Set a deadline in your client. For an asynchronous request, poll GET /v2/generations/{generation_id} until the result arrives or your own deadline passes. Keep the generation_id either way.
  • Expect a late result. A generation you stopped waiting for can still finish. If you use webhooks, verify the delivery, then ignore it or store it for later, based on the generation_id you recorded.
  • Don’t resubmit to “restart”. Sending the request again starts a second generation, billed separately. If you still want the result, poll the first generation_id.

Avoid paying for work you don’t need

  • Quote first. dry_run=true returns a request’s price without running it.
  • Send only what you will use. Ask for the number of images you need and the quality you need.
  • Keep concurrency bounded. A queue that sends requests as capacity frees up is easier to stop than a burst of requests sent at once. See Rate limits.