API reference · Account
The Merkle proof of one of your receipts, as a file
GET/api/account/receipts/{number}/proofSigned in session
A receipt is a ledger entry, so its proof is that entry's leaf in its day's ledger tree. Session bound; a crew's receipt takes ?orgId= and the billing.view permission. 404 receipt_not_found, proof_not_committed or receipts_off.
Parameters
| Field | Type | What it is |
|---|---|---|
| number (path)required | string | The receipt number, AM-<year>-<entry>. |
| orgId (query) | integer | The crew whose receipt it is. |
Answer 200
The proof, with a content-disposition naming the file.
| Field | Type | What it is |
|---|---|---|
| object | string | One of "receipt_proof". |
| version | integer | |
| day | string | |
| tree | string | One of "usage", "ledger". |
| index | integer | |
| leaf | string | The canonical text that was hashed. A usage leaf is ["am-usage-v1", row id, request id, account digest, model, prompt tokens, completion tokens, billed micro USD, upstream micro USD or null, the markup in basis points those two imply or null, unix ms]; a ledger leaf is ["am-ledger-v1", entry id, account digest, kind, delta micro USD, SHA-256 of its reference or null, unix ms]. The account is a keyed digest, never an address. |
| leaf_hash | string | |
| path | array of object | |
| path[] | string | One of "left", "right". |
| path[] | string | |
| header | object | The day header. The day's root is SHA-256 of the byte 0x02 followed by the UTF-8 of the JSON array ["am-day-v1", day, usage_root, usage_count, ledger_root, ledger_count, billed_micros, upstream_micros, unmeasured_count]. |
| header. | string | The UTC day. |
| header. | string | |
| header. | integer | |
| header. | string | |
| header. | integer | |
| header. | integer | What the meter billed that day, micro USD. |
| header. | integer | What the upstreams charged, micro USD; a usage row nobody measured counts at its billed figure. |
| header. | integer | Usage rows with no measured upstream cost. |
| root | string | |
| publication | object or null | Where the root was published: a transaction from the operator's signer to itself whose calldata is the UTF-8 text `antimatter receipts v1 <day> <root>`. Null while it is not on chain, which is always the case where the operator has not switched publishing on. |
Errors
- 401OpenAI shaped error.
- 404OpenAI shaped error.
- 429OpenAI shaped error.
Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.