execution. Cancelling stops work that has not started.
It does not stop a model call that is already running, and it does not return
the platform fee. Read
what cancelling stops and what you still pay
before you rely on it.
Goal: Stop a run that has not finished.
You are done when: the response status is cancelled, or a fresh status
check shows that the run already reached a final status.
Which runs you can cancel
You can cancel a run whose status isqueued, running, or progress. A run that is already completed, failed, cancelled, or
expired has a final status and cannot be cancelled; the API answers
invalid_state.
What cancelling stops and what you still pay
- What is free. For a live run, cancelling before the model call starts means no model usage is billed for that run.
- What is charged and when. Millwork charges the platform fee when it accepts a live run, not when the run completes.
- What is not returned. A run you cancel keeps its platform fee and still counts toward your quota. Your quota is the number of runs your organization may submit per calendar month (UTC), and how many may run at once. A model call that was already running is not stopped. It finishes, and its model usage cost can continue until it does.
- The one exception. When Millwork itself fails a run before any model attempt starts, because no model could serve it, the output check was unavailable, or the selected model was not ready, Millwork returns the platform fee and the quota count automatically. You do not need to ask. This never applies to a run you cancel.
- See Model access and billing for the full rules.
Before you begin
SetMILLWORK_API_URL and MILLWORK_API_KEY as shown in
Make your first API call.
1
Set the run ID
Use a run created by Run a model.
2
Send the cancellation
3
Read the response
status is cancelled. cancelled_by names who
cancelled the run.If it fails
Do not keep sending cancellation requests. A second request cannot stop more
than the first one did.
What this confirms
Millwork recordscancelled as the run’s final status and produces a receipt.
It does not produce a result. It does not stop a model call already in
progress. It does not return the platform fee or the quota count.
Read the receipt to see what ran before the cancellation:
Results and receipts.