Receipts
The `Receipt` event every charge leaves on chain, what it records, and how it is addressed.
Every line of a settlement emits one Receipt event, so every debit of your credits has a record on chain. A receipt is addressed by its transaction signature and the line's index in that transaction. The app's Receipts and the API's receipt routes are indexed from these events, and anyone with an RPC endpoint can read the same events.
#What a receipt holds
| Field | What it says |
|---|---|
wallet | The wallet that paid. |
agent_key | The agent key that spent, or the default key when you spent it yourself. |
job_id | The rental or generation it charges. |
kind | Rental or generation. |
units | Seconds for a rental; for a generation, images, output seconds of video, characters of voice, or 3D assets. |
requested, charged | Credits asked for and credits debited. They differ only when the balance ran out. |
usdc_part, shdr_part | How much of the charge came from USDC-backed and SHDR-backed credits. |
shdr_atoms | The SHDR moved to the hourly burn for the SHDR-backed part. |
line_index, settle_nonce, timestamp | The line's place in the transaction, the settlement's count for that wallet, and its time. |
Credit amounts on chain are in base units, 1,000 to a credit. Events gives each field's type.
#Kinds in the receipts list
The list in the app and the API holds four kinds. rental_settle and generation come from Receipt events. deposit comes from the UsdcDeposited and ShdrDeposited events. x402 is a generation paid per request, listed under the payer's wallet.
#An x402 rental
A rental paid over x402 has no credit account to settle against, so it leaves no Receipt event. Its receipt is the channel's close, indexed as kind x402 under the payer's wallet and addressed by the distribute transaction:
| Field | What it says |
|---|---|
units | Seconds the machine ran |
rateBaseUnitsPerSecond | The rate locked at launch |
creditsBaseUnits | The atoms charged, one per credit base unit |
refundedBaseUnits | The atoms returned to the payer |
channelId | The payment channel that was closed |
channelPosition, channelCount | Which channel of the rental it was, channel N of M, when the rental was extended |
The same amounts are in the distribute transaction's own balance changes on chain. An x402 generation payment is listed as kind x402 too, with its job.
#How often
A rental paid from credits leaves one receipt every 60 seconds while it runs and one at stop; a generation leaves one when its file is ready. Read receipts shows each way to read them, the chain included.