Intelligence · interface
AiUsage
What an agent has spent.
Explained in Agents and behaviour.
interface AiUsageimport type { AiUsage } from '@driftengine/ai';In depth
Mutated in place. A session charges per event, and allocating a usage object per event would put an allocation on the path a streaming response takes hundreds of times per request.
Properties
| Name | Type | Description |
|---|---|---|
inputTokens | number | |
outputTokens | number | |
requests | number | |
preemptedRequests | number | Requests aborted because a higher-priority observation arrived.MoreThe token price of responsiveness, and the number a consumer tunes its priority
thresholds against. Separate from |
abortedRequests | number | |
costMicros | number | |
latencyMsP90 | number |