import type { LanguageModel, LanguageModelUsage } from 'ai';
import type { ModelKey } from './models';
export interface ModelTokenUsage {
    inputTokens: number;
    outputTokens: number;
    cacheReadTokens: number;
    cacheWriteTokens: number;
    reasoningTokens: number;
    estimatedCostUsd: number | undefined;
}
export interface TokenTotals extends ModelTokenUsage {
}
export interface TokenUsage {
    byModel: Record<string, ModelTokenUsage>;
    totals: TokenTotals;
}
export interface TokenUsageEvent {
    model: string;
    usage: Omit<ModelTokenUsage, 'estimatedCostUsd'>;
    contextWindowTokens: number;
    contextWindowLimit?: number;
}
/** Build the per-model key from a LanguageModel instance. */
export declare function getModelKey(model: LanguageModel | string): string;
/** Extract usage fields from the AI SDK's LanguageModelUsage into our flat structure. */
export declare function extractUsage(usage: LanguageModelUsage): Omit<ModelTokenUsage, 'estimatedCostUsd'>;
type PricingLookup = (modelKey: ModelKey) => ModelPricing | undefined;
export interface ModelPricing {
    input: number;
    output: number;
    cacheRead?: number;
    cacheWrite?: number;
}
export declare class TokenUsageAccumulator {
    private byModel;
    private pricingLookup;
    constructor(pricingLookup?: PricingLookup);
    add(modelKey: string, usage: Omit<ModelTokenUsage, 'estimatedCostUsd'>): void;
    snapshot(): TokenUsage;
}
export {};
//# sourceMappingURL=token-usage.d.ts.map