> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getmillwork.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Results and receipts

> Use the result for model output and the receipt to understand how the run happened.

Use the **result** in your application. Keep the **receipt** as a record of what
ran. It does not include the prompt or model output.

A successful live run can return a result. Every final run leaves a receipt
that does not copy the prompt or output. Echo, failed, cancelled, and expired
runs do not return model output.

## Result

Fetch a result only after a live run reaches `completed`:

```http theme={null}
GET /v1/executions/{executionId}/result
```

A `404` means the run is not complete, produced no result, or the result
expired. When `retention_expires_at` contains a date, that is the result's
expiry time. If it is `null`, the API has not reported an automatic expiry.

Inspect the model requested and the model reported by the provider:

```bash theme={null}
curl --fail-with-body \
  --header "Authorization: Bearer $MILLWORK_API_KEY" \
  "$MILLWORK_API_URL/executions/$EXECUTION_ID/result" |
jq '{
  requested: .model_provenance.requested.upstream_ref,
  resolved: .model_provenance.resolved.upstream_ref,
  provider: .model_provenance.source.source_id,
  access: .model_provenance.source.access_lane
}'
```

`requested` is what Millwork asked for. `resolved` is what the provider or
gateway reported.

## Receipt

```http theme={null}
GET /v1/receipts/{executionId}
```

A receipt records what Millwork tried, which option succeeded, which model and
provider answered, what the run used, and which limits or checks applied. It
does not copy the prompt or output.

```json theme={null}
{
  "status": "completed",
  "mode": "live",
  "provider": "openrouter",
  "requested": "moonshot/kimi-k2/2.6",
  "resolved": "moonshotai/kimi-k2.6-20260420",
  "calls": 1,
  "content_policy": "content_free"
}
```

The values above are examples. IDs and customer content are intentionally absent.

## What to store

* Store the result only as long as your application needs it.
* Keep the receipt when you need a record without the prompt or model output.
* Keep the run ID (`execution_id`) so you can connect status, result, receipt, and support
  context.

## Final outcomes

A run can end as `completed`, `failed`, `cancelled`, or `expired`. Request
the result only after `completed`. For every other final status, read the run,
events, and receipt to see what happened.

No result? Follow the recovery steps in
[Errors and retries](/guides/errors-and-retries).
