API reference

API reference · Public

One sealed day

GET/api/receipts/commitments/{day}No key

What /verify compares a recomputed root with. 404 commitment_not_found for a day not sealed, 400 invalid_day for anything that is not YYYY-MM-DD.

Parameters

Path and query parameters
FieldTypeWhat it is
day (path)requiredstringA UTC day, YYYY-MM-DD.

Answer 200

The sealed day.

Fields of the 200 answer
FieldTypeWhat it is
objectstringOne of "receipt_commitment".
versioninteger
daystring
rootstring
headerobjectThe 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.daystringThe UTC day.
header.usage_rootstring
header.usage_countinteger
header.ledger_rootstring
header.ledger_countinteger
header.billed_microsintegerWhat the meter billed that day, micro USD.
header.upstream_microsintegerWhat the upstreams charged, micro USD; a usage row nobody measured counts at its billed figure.
header.unmeasured_countintegerUsage rows with no measured upstream cost.
margin_microsintegerBilled minus upstream.
implied_markup_bpsinteger or nullThe margin over the upstream cost, basis points; null when nothing was measured.
committed_atinteger
publicationobject or nullWhere 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

  • 400OpenAI 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.

Antimatter