export type OpenAIAuthSource = 'config' | 'env' | 'codex-cli' | 'chatgpt-oauth' | 'chatgpt-oauth-expired' | 'no-usable-auth' | 'no-usable-auth-codex-oauth' | 'no-usable-auth-forced-chatgpt-oauth'; export interface OpenAIAuthResolution { apiKey: string | null; source: OpenAIAuthSource; last4?: string; envVar?: 'OPENAI_API_KEY' | 'CODEX_API_KEY'; accountId?: string; expiresAt?: number; } export interface AuthResolverDeps { readEnv?: (key: string) => string | undefined; homedir?: () => string; readFile?: (path: string) => string | null; } export declare function resolveOpenAIAuth(explicitConfigKey: string | undefined, deps?: AuthResolverDeps, forceChatgptOAuth?: boolean): OpenAIAuthResolution; type CodexAuthParse = { kind: 'apikey'; apiKey: string; } | { kind: 'chatgpt'; accessToken?: string; accountId?: string; expiresAt?: number; } | { kind: 'no-key'; } | { kind: 'invalid'; }; export declare function parseCodexAuthJson(raw: string): CodexAuthParse; export declare function decodeJwtClaims(token: string): Record | null; export declare function formatAuthDiagnostic(resolution: OpenAIAuthResolution): string; export {};