Shader
Receipts

DocsConcepts8 of 35 · 3 min read

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

FieldWhat it says
walletThe wallet that paid.
agent_keyThe agent key that spent, or the default key when you spent it yourself.
job_idThe rental or generation it charges.
kindRental or generation.
unitsSeconds for a rental; for a generation, images, output seconds of video, characters of voice, or 3D assets.
requested, chargedCredits asked for and credits debited. They differ only when the balance ran out.
usdc_part, shdr_partHow much of the charge came from USDC-backed and SHDR-backed credits.
shdr_atomsThe SHDR moved to the hourly burn for the SHDR-backed part.
line_index, settle_nonce, timestampThe 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:

FieldWhat it says
unitsSeconds the machine ran
rateBaseUnitsPerSecondThe rate locked at launch
creditsBaseUnitsThe atoms charged, one per credit base unit
refundedBaseUnitsThe atoms returned to the payer
channelIdThe payment channel that was closed
channelPosition, channelCountWhich 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.