Idempotency
Retry a request that starts a job without starting the job twice.
A network error can hide whether a request reached Vizbl. Retrying a read is harmless, but retrying a request that starts a job may start a second import or spend tokens twice. An idempotency key makes that retry safe: Vizbl recognises the repeated request and returns the job of the first one instead of starting another.
Which requests take a key
Send the key in the x-idempotency-key header of:
POST /developer-api/objects/imports, which starts an import;POST /developer-api/generations, which starts a generation and reserves tokens;POST /developer-api/rugs, which starts a rug.
The header is optional. Use one key per job you mean to start, and send the same key when you retry it. Any unique string works: a UUID, or an id from your own system such as import-chair-2026-06-11.
Example
curl https://api.vizbl.com/developer-api/generations \
-H "Authorization: Bearer $VIZBL_API_KEY" \
-H "Content-Type: application/json" \
-H "x-idempotency-key: 6f1c2a7e-5b8d-4d0e-9a51-3c2f8e7b9d10" \
-d '{
"provider": "trellis",
"images": [{ "upload_id": "upl_…" }]
}'How a retry is answered
| You send | Vizbl responds |
|---|---|
| The same key and the same body | The job of the first request. No new job starts. |
| The same key with a different body | 409: the key is already bound to another request. |
| The same key while the first generation or rug is still starting | 409 with the code gate.ERROR_DEVELOPER_API_GENERATION_STARTING. It lasts a few minutes at most: retry later. |
Keys of generations and rugs are kept for 24 hours.
When a generation times out
If a generation or rug request timed out after the job may have started, its key stays bound and every retry with it returns 409. Before you start again with a new key, list your generations to check whether the first job exists, so you do not pay for it twice.