/**
 * Token Counter with Lazy Loading
 *
 * Tiktoken is lazy-loaded on first use to reduce startup time (23 MB module).
 * The module is loaded synchronously when first needed, but the application
 * can start without it.
 */
export declare class TokenCounter {
    private encoder;
    private model;
    private initialized;
    constructor(model?: string);
    /**
     * Initialize the encoder lazily
     */
    private ensureInitialized;
    /**
     * Count tokens in a string
     */
    countTokens(text: string): number;
    /**
     * Count tokens in messages array (for chat completions)
     */
    countMessageTokens(messages: Array<{
        role: string;
        content: string | null;
        tool_calls?: unknown;
    }>): number;
    /**
     * Estimate tokens for streaming content
     * This is an approximation since we don't have the full response yet
     */
    estimateStreamingTokens(accumulatedContent: string): number;
    /**
     * Clean up resources
     */
    dispose(): void;
}
/**
 * Format token count for display (e.g., 1.2k for 1200)
 */
export declare function formatTokenCount(count: number): string;
/**
 * Create a token counter instance
 */
export declare function createTokenCounter(model?: string): TokenCounter;
/**
 * Count tokens in a string using default encoder
 * This is a convenience function for simple token counting
 *
 * @param text - The text to count tokens for
 * @returns Number of tokens
 *
 * @example
 * ```typescript
 * const count = countTokens('Hello, world!');
 * console.log(count); // 4
 * ```
 */
export declare function countTokens(text: string): number;
/**
 * Estimate tokens without loading tiktoken (fast approximation)
 * ~4 characters per token on average
 */
export declare function estimateTokens(text: string): number;
/**
 * Preload tiktoken module in background (optional)
 * Call this early to warm up the module without blocking
 */
export declare function preloadTiktoken(): void;
/**
 * Token pricing per 1K tokens (in USD)
 */
export declare const TOKEN_PRICING: Record<string, {
    input: number;
    output: number;
}>;
/**
 * Calculate cost for a request
 */
export declare function calculateCost(inputTokens: number, outputTokens: number, model: string): {
    inputCost: number;
    outputCost: number;
    totalCost: number;
};
/**
 * Format cost for display
 */
export declare function formatCost(cost: number): string;
