Command palette
⌘K to open • ↑/↓ to move • Enter to go

Docs / Receipt schema

Receipt schema

Every run on Lab produces a receipt: a JSON document at GET /results/:id.json (canonical, machine-readable) with a human viewer at GET /results/:id. Successful runs include full per-step data. Failed or aborted runs include the error and reason; per-step detail may be partial or empty. See Failures & step data.

Top-level fields

FieldTypeWhat it is
idstringUnique ID (same as the resultId and receipt paths)
typestringHow the result was created: sandbox, kv, chain, generate, spawn, or external
createdAtstringWhen it ran (ISO 8601)
requestobjectWhat was sent in (code, permissions, prompt, etc.)
outcomeobjectWhat happened — ok: true with a result, or ok: false with error and reason
timingobjectHow long it took (totalMs, and for AI-generated runs: generateMs, runMs)
generatedstring?The code the AI wrote (only for /run/generate)
stepsarray?Per-step details (only for /run/chain)
receiptobject?External work receipt details (only for /receipts)
lineageobject?Parent/supersedes links for continued work

The request field (varies by type)

  • sandbox / kv: { body, capabilities? } — the code and permissions
  • chain: { steps: [{ body, capabilities, name?, input? }] } — each step in the pipeline
  • generate: { prompt, capabilities } — what you asked the AI to build
  • spawn: { body, capabilities, depth? } — the code and nesting limit
  • external: { source, action, input?, output?, capabilities?, replay?, evidence? } — work that happened through an MCP, browser, task runner, or other external system

External receipts

External receipts use type: "external" and include a receipt object:

FieldTypeWhat it is
sourcestringMCP server, browser runner, task runner, or external system
actionstringTool/action name
capabilitiesstring[]Authority used, such as cf.workers.read or browser.click
inputany?Intent, arguments, or pre-state
outputany?Result, post-state, or observation
replayobjectReplay posture: inspect only, sandbox re-run, live re-run with approval, or continue from here
evidenceany?Logs, screenshots, artifact references, before/after data

Per-step details (pipelines only)

When you run a pipeline (/run/chain), the steps array contains one entry per step:

FieldTypeWhat it is
stepnumberStep index (starts at 0)
namestring?Name you gave this step
bodystring?The code that ran
capabilitiesstring[]Permissions this step had
inputanyWhat this step received
outputanyWhat this step returned
msnumberHow long this step took (milliseconds)

Getting the result

Every run response includes a resultId. Use it to fetch the receipt later:

  • GET /results/:id.json — canonical machine-readable receipt JSON
  • GET /results/:id — human viewer on the public app

POST /seed is the only endpoint that doesn’t create a receipt.