ACP v2 (Preview) TypeScript SDK — UNSTABLE - v2.12.1
    Preparing search index...

    Type Alias UsageExperimental

    UNSTABLE

    This capability is not part of the spec yet, and may be removed or changed at any point.

    Token usage for the foreground work that just completed, not cumulative for the session.

    type Usage = {
        totalTokens: number;
        inputTokens: number;
        outputTokens: number;
        thoughtTokens?: number | null;
        cachedReadTokens?: number | null;
        cachedWriteTokens?: number | null;
        _meta?: { [key: string]: unknown } | null;
    }
    Index
    totalTokens: number

    Sum of all token types for the completed work.

    inputTokens: number

    Input tokens for the completed work.

    outputTokens: number

    Output tokens for the completed work.

    thoughtTokens?: number | null

    Thought/reasoning tokens for the completed work.

    Omitted and null are equivalent and mean the count is not reported.

    cachedReadTokens?: number | null

    Cache read tokens for the completed work.

    Omitted and null are equivalent and mean the count is not reported.

    cachedWriteTokens?: number | null

    Cache write tokens for the completed work.

    Omitted and null are equivalent and mean the count is not reported.

    _meta?: { [key: string]: unknown } | null

    The _meta property is reserved by ACP to allow Clients and Agents to attach additional metadata to their interactions. Omitted and null are equivalent and mean no metadata. Implementations MUST NOT assign meaning to keys they do not recognize.

    See protocol docs: Extensibility