Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/usage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,18 @@ export interface UsageBlock {
/** Prepaid credits debited from the ledger for this op (0 on the x402 pay-per-op path). */
credits_charged: number;
cache_hit?: boolean;
/**
* Composite-op itemization: additional charge legs beyond the primary verb
* (e.g. an AgentRAG ask that also ingested pages). The top-level `price_usd`
* is the PRIMARY verb's price on the taken path; the request's total cost is
* `price_usd` + the sum of `breakdown[].price_usd`. Absent on single-leg ops
* — never an empty array on the wire.
*/
breakdown?: Array<{ op: string; units: number; price_usd: number }>;
/**
* Present (always literal `true`, never `false`) when the collection named
* by this response is inside the final 24h of its lifetime — the caller's
* cue to query it (sliding the expiry) or extend it. Omitted otherwise.
*/
expiring_soon?: true;
}