Skip to main content

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​

IUsageCall.kind


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​

IUsageCall.modelId


profileId?​

optional profileId?: 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​

IUsageCall.profileId


runId?​

optional runId?: string

Defined in: internal/usage-guard/types.ts:134

The run the call is a step of; absent outside a run.

Inherited from​

IUsageCall.runId


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​

IUsageCall.tenantId


threadId?​

optional threadId?: 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​

IUsageCall.threadId


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​

IUsageCall.traceId


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?​

optional userId?: string

Defined in: internal/usage-guard/types.ts:124

Absent for system jobs (e.g. KB ingestion).

Inherited from​

IUsageCall.userId