complete_receipt
Finalize pending receipts by recording execution results, costs, and output data. Updates status to completed, failed, or timeout with Ed25519 signing. Completes two-phase tracking for cryptographic accountability after initial receipt creation.
Instructions
Finalize a pending receipt by recording execution results, costs, and output data. Updates the receipt status to completed, failed, or timeout and re-signs with Ed25519. Use after create_receipt when you need to record results separately from creation (two-phase tracking). Cannot complete an already-completed receipt. Returns the updated signed receipt.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| receipt_id | Yes | The receipt ID to complete — must be a pending receipt (status: "pending") | |
| status | Yes | Final status: "completed" (success), "failed" (error occurred), or "timeout" (timed out) | |
| output_hash | No | Pre-computed SHA-256 hash of the output in format "sha256:hexstring" | |
| output_summary | No | Human-readable summary of the execution result | |
| model | No | AI model used during execution | |
| tokens_in | No | Input tokens consumed | |
| tokens_out | No | Output tokens generated | |
| cost_usd | No | Total cost in USD | |
| latency_ms | No | Total execution time in milliseconds | |
| tool_calls | No | Names of tools called during execution | |
| confidence | No | Confidence score for output quality, 0.0 to 1.0 | |
| callback_verified | No | Whether an external callback verified the result | |
| error | No | Error details if status is "failed" (e.g., {"code": "TIMEOUT", "message": "..."}) |