import type { ChatCompletionParams, LLMProvider, ModelInfo, ProviderCapabilities, StreamChunk } from '@namzu/sdk'; import type { OpenRouterConfig } from './types.js'; /** * What this DRIVER does, not what OpenRouter could do: tools pass * through to the request body, but user-message image `attachments` * are not mapped into content parts — `supportsVision` stays false * until the message translation handles them. */ export declare const OPENROUTER_CAPABILITIES: ProviderCapabilities; export declare class OpenRouterProvider implements LLMProvider { readonly id = "openrouter"; readonly name = "OpenRouter"; readonly capabilities: ProviderCapabilities; private config; private baseUrl; constructor(config: OpenRouterConfig); private getHeaders; private formatMessages; private buildRequestBody; chatStream(params: ChatCompletionParams): AsyncIterable; /** * Ask about the KEY, not about the catalogue. * * `listModels` here is already honest — it has no fallback and returns * exactly what the server sent. It is still useless as a credential check, * because `/models` does not authenticate: any string whatsoever, including * a typo or a revoked key, came back with the full catalogue and was * reported as verified. Nothing was wrong with the menu; the menu was simply * never evidence about the key. * * `/key` is the endpoint that answers the question actually being asked. It * requires the credential and returns its metadata, so a 401 here means the * key is genuinely refused. */ probeCredential(signal?: AbortSignal): Promise; /** * The vendor's own `context_length` for this model. * * This driver already parsed the number and threw it away: `listModels` * maps it into `contextWindow` and nothing downstream ever asked. The * kernel meanwhile fell back to a hand-maintained prefix table whose own * header records what that costs — every Claude entry carried 200k * including the 1M-window models, so those runs compacted at roughly 14% * full. OpenRouter fronts hundreds of models from a dozen vendors, so it * is the driver where a static table drifts fastest. * * `undefined` for a model the listing does not contain, rather than a * guess: "I asked and it is not there" leaves the table exactly as * authoritative as it was, while a substituted number would present a * guess as a vendor answer. * * A fulfilled listing is cached for this driver, because a payload of * several hundred models does not change under a running run. Pending * requests stay caller-owned, so concurrent cold misses may duplicate the * request rather than letting one caller's cancellation own both. A * failure is NOT cached — the next run asks again rather than inheriting * one bad minute forever. */ resolveContextWindow(model: string, signal?: AbortSignal): Promise; /** First fulfilled listing; see the note on `resolveContextWindow`. */ private contextWindows?; listModels(signal?: AbortSignal): Promise; healthCheck(): Promise; } //# sourceMappingURL=client.d.ts.map