/** * Shared per-provider REST endpoint config (url / auth headers / query param). * * Single source of truth consumed by both `fetchProviderModels` (models.ts) and * `validateApiKey` (validation.ts), which both hit each provider's models * endpoint. Model-list response `parse` logic stays in models.ts — it has no * bearing on key validation. */ /** REST endpoint descriptor for a provider's models listing. */ export interface ProviderEndpoint { /** Full models-list URL against the provider's own public API. */ url: string; /** * Path appended to a caller- or env-supplied base URL. Present only for * providers that can legitimately be addressed through a gateway/proxy that * emulates their wire protocol. */ path?: string; /** * Env var carrying a base-URL override for this provider, using the same * name the provider's own SDK reads. Consulted by * {@link resolveProviderModelsUrl} when no explicit base URL is passed. */ baseUrlEnv?: string; headers: (key: string) => Record; queryParam?: string; } export declare const PROVIDER_ENDPOINTS: Record; /** * Resolve the models-list URL for a provider, honouring a configured base URL. * * Behind a gateway (LiteLLM, a corporate proxy, an Anthropic-compatible * router) the credential in play is the *gateway's*, not the provider's. Firing * discovery at the provider's own public API therefore 401s and yields an empty * catalog — which a caller that reads "empty" as "unknown" then degrades into * "accept anything". Resolving against the same base URL the runtime already * routes completions through keeps discovery and dispatch pointed at one place. * * Precedence: explicit `baseUrl` argument → the endpoint's `baseUrlEnv` value * in `env` → the provider's own `url`. A provider with no `path` has no * gateway form and always returns `url`. * * The base URL is joined tolerantly: a trailing slash is stripped, and a base * that already ends in the path's leading version segment (`…/v1` for a * `/v1/models` path) is not doubled up. Both spellings are common in the wild. * * Pure: reads only the `env` record it is handed. * * @since 1.5.0 */ export declare function resolveProviderModelsUrl(provider: string, options?: { baseUrl?: string; env?: Record; }): string | undefined; //# sourceMappingURL=provider-endpoints.d.ts.map