Getting results: wait, poll or webhook
A design takes from about 10 seconds (Quick) to a minute or two (Best, or 4 images). Starting one answers at once with status: "queued" unless you ask to wait. There are three ways to get the result.
| Best for | How | |
|---|---|---|
| Wait in the request | Scripts, a user waiting on screen | Prefer: wait=60, or the SDKs’ createAndWait |
| Poll | Simple back ends with no public URL | GET /public/v1/designs/{id}, with Prefer: wait |
| Webhook | Batches, queues, anything server to server | A webhook URL on the key |
Wait in the request
Section titled “Wait in the request”Send Prefer: wait=N (1 to 60 seconds) with POST /public/v1/designs or GET /public/v1/designs/{id}. The API holds the answer until the design finishes or the time is up:
- The answer carries
Preference-Applied: wait=Nand the design as it stands. Read itsstatus:succeededorfailedmeans it is done;queuedorrunningmeans the time ran out, so ask again with the same header. POST /public/v1/designsanswers202while the design is still on its way and200when it finished within the wait.GET /public/v1/designs/{id}always answers200.
curl https://api.remodeled.ai/public/v1/designs/01a1ebfd-4958-74a0-8036-fd131dcc3bd2 \ -H "Authorization: Bearer $REMODELED_API_KEY" \ -H "Prefer: wait=60"The SDKs do this loop for you. designs.wait(id) (and createAndWait) holds requests open in 60-second steps until the design is final, up to waitTimeout (5 minutes by default), and throws DesignFailedError if it failed. Pass throwOnFailure: false (throw_on_failure=False) to get the failed design back instead.
Without Prefer, GET /public/v1/designs/{id} answers at once. If you poll, wait at least 2 seconds between requests, or better, send Prefer: wait=30 and let the API do the waiting.
Webhook
Section titled “Webhook”Set a webhook URL on the key in the app (Account, Developer API). When one of its designs finishes, the API sends a signed design.succeeded or design.failed event with the whole design. See Webhooks.
Reading the result
Section titled “Reading the result”A finished design has status: "succeeded" and one entry in images per picture. Each has an asset with url, width and height, and a smaller thumbnail.
{ "id": "01a1ebfd-4958-74a0-8036-fd131dcc3bd2", "status": "succeeded", "images": [ { "id": "01a1ebfd-4964-759c-9af0-5e4b53a4509d", "position": 0, "asset": { "url": "https://cdn.remodeled.ai/...", "width": 1536, "height": 1024 } } ]}Image URLs are stable for as long as the account’s plan keeps the design (keptUntil). Copy the images to your own storage if you need them for longer.
A failed design has status: "failed", an error with code and message, and creditsCharged: 0: its credits were refunded.