/** * Shared factory for API-key-paste "login" flows. * * Several providers (Cerebras, Synthetic, Moonshot, Together, NanoGPT, ZenMux) * don't actually implement OAuth — they just ask the user to paste an API key, * optionally validate it, and return the trimmed key. */ import type { OAuthController } from "./oauth/types"; type ChatCompletionsValidation = { kind: "chat-completions"; provider: string; baseUrl: string; model: string; }; type AnthropicMessagesValidation = { kind: "anthropic-messages"; provider: string; baseUrl: string; model: string; }; type ModelsEndpointValidation = { kind: "models-endpoint"; provider: string; modelsUrl: string; headers?: Record | (() => Record | undefined); }; export type ApiKeyLoginConfig = { /** Display name used in error messages, e.g. "Cerebras", "NanoGPT". */ providerLabel: string; /** URL opened in browser for the user to grab their key. */ authUrl: string; /** Instructions shown with the onAuth callback. */ instructions: string; /** Prompt message shown when asking for the key paste. */ promptMessage: string; /** Placeholder string for the prompt (e.g. "sk-...", "csk-..."). */ placeholder: string; /** Validation strategy, or `null` to skip validation. */ validation: ChatCompletionsValidation | AnthropicMessagesValidation | ModelsEndpointValidation | null; }; export declare function createApiKeyLogin(config: ApiKeyLoginConfig): (options: OAuthController) => Promise; export {};