Skip to main content
A receipt is Millwork’s record of how one run was handled: which saved model ran, the model usage and cost, and which checks applied. It never contains the prompt or the model output, so you can keep it as a business record. This recipe exports receipts for runs created after a time you choose, one JSON record per line (NDJSON), and checks the file before you store it. Goal: Save up to 200 receipts for runs created after a chosen UTC time. You are done when: every line in the file is valid JSON and you know how many records were saved.

Before you begin

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

Export the receipts

2

Check the file

Expected result: jq exits without an error. wc shows how many receipt records were saved.
3

Store the file safely

Receipts do not contain prompts or model output. They do contain business details such as the model, the provider, usage, cost, and run IDs. Store them as you store other business records.
This endpoint returns at most 200 receipts and does not provide a next-page token. Export often enough to keep each file below that limit. A file with exactly 200 lines may be incomplete. When a file reaches 200 records, do not treat that period as complete, and do not move the start time forward.

What a receipt says about cost

A receipt’s cost and totals.usd record model usage. The platform fee Millwork charges when it accepts a live run is its own line, totals.platform_fee_usd; it is 0 for a test run, and 0 when Millwork returned the fee because the run failed before any model attempt. The dashboard’s Usage & spend page shows your Millwork charges. See Model access and billing.

If it fails