import type { ZodType } from "zod"; import { AIProviderName } from "../constants/enums.js"; import { BaseProvider } from "../core/baseProvider.js"; import type { StreamOptions, StreamResult } from "../types/index.js"; import type { LanguageModel, Schema } from "../types/index.js"; /** * OpenRouter Provider - BaseProvider Implementation * Provides access to 300+ models from 60+ providers via OpenRouter unified gateway */ export declare class OpenRouterProvider extends BaseProvider { private model; private openRouterClient; private config; private static modelsCache; private static modelsCacheTime; private static readonly MODELS_CACHE_DURATION; private static toolCapableModels; private static capabilitiesCached; constructor(modelName?: string, sdk?: unknown, _region?: string, credentials?: { apiKey?: string; baseURL?: string; }); protected getProviderName(): AIProviderName; protected getDefaultModel(): string; /** * Returns the Vercel AI SDK model instance for OpenRouter */ protected getAISDKModel(): LanguageModel; formatProviderError(error: unknown): Error; /** * OpenRouter supports tools for compatible models * Checks cached model capabilities or uses known patterns as fallback */ supportsTools(): boolean; /** * Provider-specific streaming implementation * Note: This is only used when tools are disabled */ protected executeStream(options: StreamOptions, analysisSchema?: ZodType | Schema): Promise; /** * Get available models from OpenRouter API * Dynamically fetches from /api/v1/models endpoint with caching and fallback */ getAvailableModels(): Promise; /** * Fetch available models from OpenRouter API /api/v1/models endpoint * @private */ private fetchModelsFromAPI; /** * Type guard to validate the models API response structure * @private */ private isValidModelsResponse; /** * Fetch and cache model capabilities from OpenRouter API * Call this to enable accurate tool support detection */ cacheModelCapabilities(): Promise; }