completed, the result contains model
output, and the receipt identifies the saved model that ran.
Choose a model, send it one task with a budget and time limit, then read its
answer. This walkthrough keeps the run on the model and provider you choose.
After a completed run, read two records. The result holds the model
output. The receipt records which saved model ran and what it used. It
never contains your prompt or the output.
A run is one task you send to Millwork; the API calls a run an
execution. A saved model is a catalog model you added to your
organization; the API calls a saved model an arm.
What a live run costs
- Platform fee: charged when Millwork accepts the run, not when it completes. A run you cancel keeps its fee.
- Model usage: a separate cost. For a model Millwork provides, Millwork deducts recorded usage from your credit. With your provider account, the provider bills usage under your account’s terms.
mode: "echo"). A test run does not call a model, so it has no platform fee and no model cost. It still counts toward your quota.
This diagram shows the requests your app sends, the moment the platform fee is
charged, and the two records your app reads at the end.
Before you begin
- Your organization is approved for the private preview.
- Your Millwork API key is configured for the organization you want to use.
- You have
curlandjq. - Your account has credit and quota for one live run.
RUN_SUFFIX makes each request key unique. A request key is the value you
send in the Idempotency-Key header so a retry does not start the work twice.
1
Choose a model from your catalog
Your catalog lists the models your organization can use now. If you came
from Connect a provider account, keep
Expected result: one line per model, numbered from If the catalog is empty, ask support about models available
to your organization. Connecting your own provider account is a separate option.
CONNECTION_ID in this terminal. The code below limits the list to that
connection. Otherwise it shows the whole catalog.0.
access: customer means the model runs through your own provider account, so
your provider bills the model usage. access: millwork means Millwork
provides the model and deducts its recorded usage from your credit.Pick one row and keep its number for the next step:2
Save the model to your organization
Each catalog entry carries Expected result:
arm_registration_template, the exact body for
this request. Send it unchanged. Millwork rejects a saved model whose settings go beyond that template.201 with an arm_id and "status": "ready". If
the status is degraded or disabled, read status_reason and choose
another catalog row.Keep ARM_ID. The next request sends it as routing.required_arm_id to
use this saved model and its provider account. If the model is unavailable,
Millwork refuses the request; it does not substitute another model.If the response was lost, send the same registration again with the same
request key in the Idempotency-Key header and Millwork returns the saved
model it already created. Without a request key, check GET /v1/arms
for the saved model before sending the registration again.3
Submit the run
Send the task and your limits. Millwork charges the platform fee the
moment it accepts the run. Model usage is a separate cost, described in
Model access and billing. A live run needs credit and
quota.What each limit means:Expected result:
data_classesis the kind of data you allow. Usepublicfor public information andsandboxfor examples you invented for testing.max_cost_usdis the model-usage budget. Once recorded spend reaches it, Millwork starts no further provider calls. A call already started can finish above this amount. The platform fee is separate.max_runtime_sis the run’s time limit.on_evallists what Millwork may do after the output check. An empty list means it does nothing more on its own.
verifier_id). If you do not send a verifier_id, a basic check confirms only that output is present.
To connect a check you already run, follow
Connect an output check.202 with an execution_id, "status": "queued", "mode": "live", and links to the status, events, and
receipt. Keep the execution_id. Every status, event, result, receipt, and
support request uses it.If the response was lost, repeat this request with the same RUN_SUFFIX
and body. Changing the request key starts a new run.If the API returns insufficient_credit, add credit under Billing & plan
and send the request again with a new request key.4
Wait for a final status
Millwork records Expected result:
accepted as the run’s first event, then the run moves
through queued, running, and progress. Poll
until it reaches one of the four final statuses: completed, failed,
cancelled, or expired. Do not submit the task again while it is
running.completed. Keep the execution_id for the last
step. A run that is still in progress after 90 seconds is not lost. Check
it again later with the same id.5
Read the result and the receipt
Only a completed live run has a result. Every run that reaches a final
status has a receipt.Read your answer after Expected result: your model’s answer.
completed:result.json may also contain an
expiry time in retention_expires_at.
receipt.json records which saved model ran
(slices[0].route.selected_arm), the model usage (slices[0].cost and
totals.usd), the platform fee on its own line (totals.platform_fee_usd),
and the output check that applied. It does not contain your prompt or the
output.
A verifier named vrf_builtin_baseline is the built-in presence check;
it confirms output exists, not that the answer is correct.If the run failed, read its events before retrying:Check your work
- The saved model is
ready. - The run reached
completed. result.jsoncontains model output infinal_text.receipt.jsonidentifies the selected saved model, without the prompt or output.
ARM_ID you saved. For a catalog model,
compare the requested and provider-reported model names:
requested is what Millwork asked for. provider_reported is what the provider
said it ran; it can be a dated or more specific name. The receipt carries the
same facts in slices[0].model_provenance.
If Millwork selected a model your administrator saved directly with a provider
model ID, the result’s model_provenance is null and the receipt omits it.
The saved-model ID and usage are still recorded. Do not infer a
provider-reported model from the saved model’s name.
Common fixes
For retry rules and every error code, read
Errors and retries.
Send another task
Keep the saved model, change the objective inrun-request.json, and choose a
new RUN_SUFFIX before submitting new work. Reuse the original request key
only to recover the original request.
To change models, choose and save another catalog row, then use its new
ARM_ID in the next request. Keeping routing.required_arm_id ensures the
request uses that model and payer. Automatic model selection is an option
described in Model access and billing.
Your provider account
Run through a provider account your organization already pays for.