API reference

Account

GET /account — stored, read, and written byte counters for your credential.

GET /account

Returns usage counters for the credential signing the request.

curl "$TESSERA_API/account?$AUTH"

Response200 OK

{
  "storageBytes": 62914560,
  "readBytes": 12582912,
  "writeBytes": 67108864
}
FieldDescription
storageBytesCurrently stored bytes attributed to this credential.
readBytesCumulative bytes read.
writeBytesCumulative bytes written.
StatusBodyCause
401plain textSignature or credential problem.
405method not allowedNot a GET.
503billing unavailableThe metering subsystem is not available on this deployment.

Metering is not fully wired up yet

This endpoint may return zeros even after you have stored data. Byte-level metering is not yet recorded on every code path, so treat these counters as indicative and not as a billing record. Authoritative usage figures come from invoices. We would rather tell you this than let you build a dashboard on a counter that does not move.

Storage caps

When a credential has a storage cap and a write would exceed it, the write is refused with 402 Payment Required before anything is stored:

{
  "error": "storage cap exceeded",
  "capBytes": 5497558138880,
  "incomingBytes": 62914560
}

402 can come from three endpoints, and each accounts differently:

EndpointCharged at
POST /prepare-writetotalShards × 4 MiB
POST /slabssectors × 4 MiB per slab
POST /objects4 KiB per object, for the metadata record

Note that accounting is in sectors, not in logical bytes, and a sector is charged whole. A 100 KiB object in its own slab is accounted at 15 sectors — 60 MiB. This is the strongest argument for packing many small objects into shared slabs; see Packing strategy.

Handling 402 in a client

Treat it as a hard stop that needs an operator, not as a retryable error:

if (res.status === 402) {
  const { capBytes, incomingBytes } = await res.json()
  // Do not retry — the answer will not change until the cap or the usage does.
  throw new QuotaExceeded({ capBytes, incomingBytes })
}

Retrying a 402 on a schedule will simply produce a 402 on a schedule. Surface it, alert on it, and raise the cap or delete something.