import type { ProviderId } from "@/lib/ai/core/types"; /** Client-safe provider metadata (mirrors PROVIDER_META without importing adapters). */ export const PROVIDERS: Record = { openai: { name: "OpenAI", shortName: "OpenAI", keyDocsUrl: "https://platform.openai.com/api-keys", keyPrefixHint: "sk-…", colorVar: "var(--p-openai)", description: "GPT-6, GPT-5.x, o-series reasoning models — via the Responses API.", consoleUrl: "https://platform.openai.com", keyHelp: "Create a project key at platform.openai.com → API keys. Keys look like sk-proj-….", }, anthropic: { name: "Anthropic", shortName: "Anthropic", keyDocsUrl: "https://platform.claude.com/settings/keys", keyPrefixHint: "sk-ant-…", colorVar: "var(--p-anthropic)", description: "Claude Fable, Opus, Sonnet and Haiku — adaptive thinking, 1M context.", consoleUrl: "https://platform.claude.com", keyHelp: "Create a key in the Claude Console → Settings → API keys. Keys look like sk-ant-api03-….", }, gemini: { name: "Google Gemini", shortName: "Gemini", keyDocsUrl: "https://aistudio.google.com/apikey", keyPrefixHint: "AIza… or AQ.…", colorVar: "var(--p-gemini)", description: "Gemini 3.x Flash and Pro, 2.5 family — Gemini Developer API.", consoleUrl: "https://aistudio.google.com", keyHelp: "Create a key in Google AI Studio → Get API key. Both AIza… and AQ.… keys work.", }, xai: { name: "xAI", shortName: "xAI", keyDocsUrl: "https://console.x.ai", keyPrefixHint: "xai-…", colorVar: "var(--p-xai)", description: "Grok 4.x reasoning and non-reasoning models with live web search.", consoleUrl: "https://console.x.ai", keyHelp: "Create a key in the xAI Console → API Keys. Keys look like xai-….", }, mistral: { name: "Mistral AI", shortName: "Mistral", keyDocsUrl: "https://console.mistral.ai/api-keys", keyPrefixHint: "32 characters", colorVar: "var(--p-mistral)", description: "Mistral Large / Medium / Small, Ministral, Magistral reasoning, Codestral — La Plateforme.", consoleUrl: "https://console.mistral.ai", keyHelp: "Create a key in La Plateforme → API Keys (console.mistral.ai). Keys are 32 alphanumeric characters.", }, deepseek: { name: "DeepSeek", shortName: "DeepSeek", keyDocsUrl: "https://platform.deepseek.com/api_keys", keyPrefixHint: "sk-…", colorVar: "var(--p-deepseek)", description: "DeepSeek V4 Flash / Pro — thinking mode, context caching, very low prices.", consoleUrl: "https://platform.deepseek.com", keyHelp: "Create a key at platform.deepseek.com → API keys. Keys look like sk-….", }, kimi: { name: "Kimi (Moonshot AI)", shortName: "Kimi", keyDocsUrl: "https://platform.moonshot.ai/console/api-keys", keyPrefixHint: "sk-…", colorVar: "var(--p-kimi)", description: "Kimi K2.6 / K2.7 Code / K3 — long context, thinking, web search (api.moonshot.ai).", consoleUrl: "https://platform.moonshot.ai", keyHelp: "Create a key in the Moonshot AI international console (platform.moonshot.ai). Keys look like sk-….", }, openrouter: { name: "OpenRouter", shortName: "OpenRouter", keyDocsUrl: "https://openrouter.ai/settings/keys", keyPrefixHint: "sk-or-v1-…", colorVar: "var(--p-openrouter)", description: "Hundreds of models from every vendor behind one key, with live pricing and routing.", consoleUrl: "https://openrouter.ai", keyHelp: "Create a key at openrouter.ai → Settings → Keys. Keys look like sk-or-v1-….", }, cerebras: { name: "Cerebras", shortName: "Cerebras", keyDocsUrl: "https://cloud.cerebras.ai/", keyPrefixHint: "csk-…", colorVar: "var(--p-cerebras)", description: "Ultra-fast inference for open models (GPT-OSS, Qwen, Gemma) on wafer-scale hardware.", consoleUrl: "https://cloud.cerebras.ai", keyHelp: "Create a key in Cerebras Cloud → API Keys. Keys look like csk-….", }, custom: { name: "Custom endpoints", shortName: "Custom", keyDocsUrl: "/app/settings/endpoints", keyPrefixHint: "", colorVar: "var(--p-custom)", description: "Your own OpenAI-compatible servers — Ollama, LM Studio, vLLM, llama.cpp, MLX.", consoleUrl: "/app/settings/endpoints", keyHelp: "Configured per endpoint in Settings → Endpoints (base URL, optional key, headers).", }, }; /** Providers connected with one API key, in display order. `custom` is managed in Settings → Endpoints. */ export const PROVIDER_ORDER: ProviderId[] = ["openai", "anthropic", "gemini", "xai", "mistral", "deepseek", "kimi", "openrouter", "cerebras"]; export function providerName(p: string | null | undefined): string { return p && p in PROVIDERS ? PROVIDERS[p as ProviderId].shortName : p ?? "—"; }