Skip to content

AIDK API Reference / aidk-shared / TokenUsage

Interface: TokenUsage ​

Defined in: packages/shared/src/models.ts:81

Token usage information (normalized across providers).

Used in ModelOutput, stream events, and execution metrics.

Properties ​

PropertyTypeDescriptionDefined in
cacheCreationTokens?numberTokens used to create cache (Anthropic prompt caching)packages/shared/src/models.ts:98
cachedInputTokens?numberTokens read from cache (Anthropic prompt caching)packages/shared/src/models.ts:95
inputTokensnumberInput tokens consumedpackages/shared/src/models.ts:83
outputTokensnumberOutput tokens generatedpackages/shared/src/models.ts:86
reasoningTokens?numberReasoning/thinking tokens (Anthropic extended thinking, OpenAI o1)packages/shared/src/models.ts:92
totalTokensnumberTotal tokens (input + output)packages/shared/src/models.ts:89

Released under the MIT License.