/** * kosha-discovery — Anthropic provider discoverer. * * Queries the Anthropic `/v1/models` endpoint to enumerate all available * Claude models and maps them into normalized {@link ModelCard} objects. * @module */ import type { CredentialResult, ModelCard } from "../types.js"; import { BaseDiscoverer } from "./base.js"; /** * Derive normalized capability tags from the Models API `capabilities` tree. * Returns an empty array when the tree is absent so callers can fall back to * ID-based inference. */ export declare function capabilityTagsFromAnthropicApi(capabilities: Record | undefined): string[]; /** * Discovers models available through the Anthropic API. * * Authentication is via `x-api-key` header. The endpoint is paginated, * so we loop until `has_more` is false. */ export declare class AnthropicDiscoverer extends BaseDiscoverer { readonly providerId = "anthropic"; readonly providerName = "Anthropic"; readonly baseUrl = "https://api.anthropic.com"; /** * Fetch all models from the Anthropic API using cursor-based pagination. * @param credential - Must contain an `apiKey` or `accessToken`. * @param options - Optional timeout override (default 10 s). * @returns Normalized model cards, or an empty array if unauthenticated. */ discover(credential: CredentialResult, options?: { timeout?: number; }): Promise; /** * Convert an Anthropic API model object into a normalized {@link ModelCard}. * * Capabilities are the union of ID-based inference (so pre-March-2026 API * responses without a `capabilities` tree keep working) and whatever the * live tree reports. Context window and output cap come straight from the * API when present; `makeCard` leaves them at 0 otherwise so the * enrichment pass can fill them. */ private toModelCard; /** * Infer capability flags from the model ID string. * * All Claude chat models get "chat", "code", "nlu", and "function_calling". * Vision is added for Claude 3+ models (detected via regex). * @param modelId - The canonical Anthropic model ID. */ private inferCapabilities; /** * Check whether a model ID indicates vision (multimodal) support. * * Every namespaced Claude family (opus/sonnet/haiku/fable/mythos) has been * multimodal since Claude 3, so family-first IDs (e.g. `claude-opus-5`, * `claude-sonnet-5`, `claude-fable-5-1`, `claude-haiku-4-5`) are matched * directly. Legacy version-first IDs (`claude-3`, `claude-3-5-haiku`, * `claude-4-6`) are covered by the major-version pattern. * * @param id - Lowercased model ID. * @returns `true` for Claude 3+ and all family-first Claude models. */ private hasVisionSupport; /** * No-key fallback: source the latest provider catalogue from the public * seed pipeline (`getPublicSeed()`), which can merge models.dev, * LiteLLM, and promotional overrides. Falls back to the curated static * list only if public seed retrieval fails or returns no models. */ private publicCatalogFallback; /** Return curated fallback models when both API and public catalog are unavailable. */ private staticFallbackModels; } //# sourceMappingURL=anthropic.d.ts.map