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
SetMILLWORK_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
true.