Skip to main content
idempotencyKey is an optional string you set on a submission. Send the same key again and you get the task the first submission created; no new work is queued and no new credit hold is placed.
Without a key there is no deduplication: every submission creates a new task. Set a key on anything a cron job or a retrying worker might send twice.
Build the key from the unit of work, not the attempt. A key like "{jobId}:{promptId}:{engine}" comes out the same on every retry of that work.

How each endpoint treats a repeated key

The single-task endpoint keeps explicit-create semantics: you asked to create a task that already exists, so you get a conflict.
The 500-task batch absorbs duplicates as success, so a worker can resend a whole job after a restart without the batch failing on the items that already went in.

Location grids

The grid’s idempotencyKey becomes its id (a UUID is generated when you omit it). Each point’s task key is <grid id>:r<row>c<col>. Sending the same grid again under that id returns the existing points and admits only the missing ones. Sending a grid with a different center, size or radius under the same id fails the points whose coordinates differ with RESOURCE_ALREADY_EXISTS; use a new key for a new grid.

Scope and length

Keys are scoped to your account: another account can use the same string without colliding with yours. UUID format is not required.

Matching results to submissions

If you did not send a key, idempotencyKey is omitted from the task object, not returned as null.

Key lifetime

A key stays reserved after the task completes or fails, and after the 24-hour polling window closes. A polling 404 does not release the key. Use the same key for transport retries of one submission, and a new key (for example with a :r1 suffix) for a separate run of the same work.

Next steps

Batches and grids

The three bulk endpoints side by side.

Errors

Every request error code.