import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; import { OpenRouterResponse, Message, Tool, ResponseFormat, ProviderRoutingConfig, PluginConfig, ReasoningConfig, CreditBalance, ApiKeyInfo, OpenRouterRequestOptions, StreamCallbacks, ChatStreamResult } from '../types'; import { Logger } from '../utils/logger'; type ProxyConfig = string | { host: string; port: number | string; user?: string; pass?: string; } | null; interface ApiHandlerConfig { apiKey: string; apiEndpoint?: string; apiBaseUrl?: string; proxy?: ProxyConfig; headers?: Record; axiosConfig?: AxiosRequestConfig; modelFallbacks?: string[]; logger: Logger; debug: boolean; } export declare class ApiHandler { private apiKey; private apiEndpoint; readonly apiBaseUrl: string; private proxy; private baseHeaders; private axiosInstance; private modelFallbacks; private logger; private debug; constructor(config: ApiHandlerConfig); updateApiKey(newApiKey: string): void; getAxiosInstance(): AxiosInstance; buildChatRequestBody(params: { model: string; messages: Message[]; tools?: Tool[] | null; responseFormat?: ResponseFormat | null; temperature?: number; maxTokens?: number | null; topP?: number | null; presencePenalty?: number | null; frequencyPenalty?: number | null; stop?: string | string[] | null; logitBias?: Record | null; seed?: number | null; toolChoice?: OpenRouterRequestOptions['toolChoice'] | null; parallelToolCalls?: boolean; route?: string; transforms?: string[]; provider?: ProviderRoutingConfig; models?: string[]; plugins?: PluginConfig[]; reasoning?: ReasoningConfig; filterMessagesForApi: (messages: Message[]) => Message[]; }): Record; sendChatRequest(requestBody: Record, depth: number): Promise>; getCreditBalance(): Promise; getApiKeyInfo(): Promise; getModels(): Promise; sendStreamingChatRequest(requestBody: Record, callbacks?: StreamCallbacks, abortSignal?: AbortSignal): Promise; private _processProxyConfig; private _initializeHeaders; private _initializeAxiosInstance; private _setupAxiosInterceptors; private logRequestDetails; } export {};