Interface: IUsageAddArgs
Defined in: internal/usage-guard/types.ts:179
The report of an addUsage: the call's factors and what it used.
Built by the LLMClient after the provider answered, failed or was aborted.
Extends
Properties
costUsd
costUsd:
number
Defined in: internal/usage-guard/types.ts:189
Informative: list prices of the model times the tokens, in USD. No exchange rates, no discounts, no reservations.
An app that bills in its own currency or credits computes from
usage, not from this.
date
date:
Date
Defined in: internal/usage-guard/types.ts:181
When the call ended.
kind
kind:
ETraceKind
Defined in: internal/usage-guard/types.ts:130
What the call is for: the answer, a run step, a guardrail judge, a query rewrite, an embedding, a memory update.
Inherited from
modelId
modelId:
string
Defined in: internal/usage-guard/types.ts:128
The model that answers: the profile's main or cheap model, or the embedding model.
Inherited from
profileId?
optionalprofileId?:string
Defined in: internal/usage-guard/types.ts:126
The profile the call runs on. Absent for system jobs (e.g. KB ingestion).
Inherited from
runId?
optionalrunId?:string
Defined in: internal/usage-guard/types.ts:134
The run the call is a step of; absent outside a run.
Inherited from
tenantId
tenantId:
string
Defined in: internal/usage-guard/types.ts:122
The tenant that pays: every limit of the app is at least per tenant.
Inherited from
threadId?
optionalthreadId?:string
Defined in: internal/usage-guard/types.ts:132
The thread of the call; absent for a call outside a thread (an embedding, a KB ingestion).
Inherited from
traceId
traceId:
string
Defined in: internal/usage-guard/types.ts:120
The id of the call's trace entry: links a report to the trace and pairs a check with its addUsage.
Inherited from
usage
usage:
IUsage
Defined in: internal/usage-guard/types.ts:183
What the provider reported; all zero when it reported nothing (a failed or aborted call).
userId?
optionaluserId?:string
Defined in: internal/usage-guard/types.ts:124
Absent for system jobs (e.g. KB ingestion).