Sume Format run usage is null: not zero cost, and a safe cost helper

usage is null when spend could not be read, which is not 0. Read usage.debited_usd_micros as an integer, and keep unknown runs separate from free ones.

4 min readSume
All posts

On a Sume Format run receipt, usage is null when the spend could not be read, and that is different from a cost of 0. The real cost of a run is usage.debited_usd_micros, an integer in millionths of a dollar.

A sum that treats null as zero will understate the bill and hide the runs you should look at.

Which usage field answers which question

Names are from the Runs and results page (read 2026-10-03).

Format run usage fields (read 2026-10-03)
FieldMeaning
debited_usd_microsWhat the run actually cost
billable_amount_usd_microsGeneration only; excludes the agent's own model turn
generation_spend_cap_usd_microsThe cap applied to generation
held_usd_micros, refunded_usd_microsHold and refund, so the net is the debited amount
finalWhether the numbers are settled
usage: nullSpend could not be read; also null on old receipts for the wallet fields

A helper

The function returns None for unknown cost, and the total reports unknown runs on their own line.

def cost_micros(run):
    u = run.get("usage")
    if u is None:
        return None
    return u.get("debited_usd_micros")

runs = [
    {"usage": {"debited_usd_micros": 1_250_000}},
    {"usage": {"debited_usd_micros": 0}},
    {"usage": None},
]
known = [c for c in map(cost_micros, runs) if c is not None]
unknown = sum(1 for r in runs if cost_micros(r) is None)
print(sum(known), "micros known;", unknown, "unknown")
print(f"${sum(known) // 10_000 / 100:.2f}")

Do not use the billable amount as the bill

billable_amount_usd_micros covers generation and leaves out the agent's own model turn, so it understates the run. Use the debited amount for cost, and see the Action run version of this mistake. Integer micros avoid float drift, which matters once you add thousands of rows.

Sources

Related posts

More in Formats

All Formats posts

Written by Sume