Skip to main content
A lost response does not mean a lost request. Millwork may have accepted the run even though your application never saw the reply. Send the retry with the same request key, a value you choose and put in the Idempotency-Key header, and Millwork returns the run it already accepted instead of starting a new one. A run is one submitted task; the API calls it an execution. Goal: Send the same request twice and receive the same run. You are done when: both responses contain the same execution_id.

What the retry costs

Millwork charges the platform fee when it accepts a live run. A retry with the same request key and the same body returns that accepted run. No second run is created, so no second platform fee is charged. This recipe uses a test run (the API calls it Echo, mode: "echo"). It does not call a model, so it has no platform fee and no model cost. The same retry rule applies to a live run. See Model access and billing.

Before you begin

Set MILLWORK_API_URL and MILLWORK_API_KEY as shown in Make your first API call.
1

Choose a request key

Use one new key for each piece of work. Reuse that key only to retry the same request.
2

Send the same request twice

Both requests carry the same request key and the same body.
Expected result: both requests return 202 with an execution_id, "mode": "echo", and "status": "completed".
3

Compare the two run IDs

Expected result: the command prints true.

If it fails

What this confirms

The same request key and body return the same run. This test run has no platform fee. Retrying a live run does not add another platform fee. This check confirms that the test run completed. For a live run, matching IDs confirm safe replay; follow its status separately as shown in Run lifecycle. A new request key starts new work, even with the same body. Millwork does not detect a duplicate by its body alone.