import type { ChatCompletionRequest, ChatCompletionResponse } from '../handlers/ChatHandler'; import type { PodChatKitStore } from '../chatkit/pod-store'; import { type AuthContext } from '../auth/AuthContext'; import type { AiGatewayService } from '../ai-gateway/AiGatewayService'; import type { UsageRepository } from '../../storage/quota/UsageRepository'; import type { QuotaService } from '../../quota/QuotaService'; export interface VercelChatServiceOptions { aiGatewayService?: Pick; } /** * @deprecated Compatibility facade for legacy internal ChatService callers. * * Public `/v1/*` routes are owned by AiGatewayHandler. This class only keeps * older ChatKit/internal call sites working while routing every inference and * model-list request through the unified AI Connection gateway runtime. */ export declare class VercelChatService { private readonly _store; private readonly logger; private usageRepo?; private quotaService?; private readonly aiGatewayService?; constructor(_store: PodChatKitStore, options?: VercelChatServiceOptions); /** * Set optional usage tracking dependencies (injected after construction). */ setUsageTracking(usageRepo: UsageRepository, quotaService: QuotaService): void; complete(request: ChatCompletionRequest, auth: AuthContext): Promise; stream(request: ChatCompletionRequest, auth: AuthContext): Promise<{ toTextStreamResponse: () => Response; }>; responses(body: unknown, auth: AuthContext): Promise>; messages(body: unknown, auth: AuthContext): Promise>; listModels(auth?: AuthContext): Promise; private completeViaGateway; private requireAiGatewayService; private podUsageScope; private extractTotalTokens; private recordForwardedUsage; /** * Check if account has remaining token quota. */ private checkTokenQuota; /** * Record token usage (fire-and-forget). */ private recordTokenUsage; }