API reference · API
The Merkle proof of one request
GET/v1/requests/{id}/proofAPI key
Where the operator seals the books (ANTIMATTER_RECEIPTS), each closed UTC day's usage rows and ledger entries become a Merkle tree about an hour after midnight UTC. This is the proof for one request this key made, by its x-antimatter-request-id: the leaf, the path, the day header and root, and the publication when there is one, plus `fields` (the leaf read back) and `row_unchanged` (whether the usage row still hashes to its leaf). Paste it into /verify. Only the key that made the request may read it; other ids are the same 404 as GET /v1/requests/{id}. A request whose day is not sealed yet is a 404 with code proof_not_committed, and with receipts off code receipts_off. Takes the read scope.
Parameters
| Field | Type | What it is |
|---|---|---|
| id (path)required | string | The request id. |
Answer 200
The proof.
| 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. |
| fields | object | |
| row_unchanged | boolean |
Errors
- 401OpenAI shaped error.
- 403OpenAI shaped error.
- 404OpenAI shaped error.
- 429Rate limited, or a spent budget or spend cap. The type distinguishes rate_limit_error, policy_exceeded, and spend_cap_exceeded.
Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.