type FetchLike = (input: RequestInfo | URL, init?: RequestInit | BunFetchRequestInit) => Promise; export type OAuth2ClientCredentialsConfig = { /** Token endpoint that issues client-credentials grants. */ tokenUrl: string; clientId: string; clientSecret: string; /** Space-joined scopes (or array). */ scope?: string | string[]; /** Optional audience parameter (Auth0, etc.). */ audience?: string; /** Where to send credentials: request body (default) or HTTP Basic header. */ authStyle?: "body" | "basic"; /** Extra params merged into the token request body. */ extraParams?: Record; /** Refresh this many ms before the token actually expires. Defaults to 60s. */ expirySkewMs?: number; /** Fallback lifetime when the response omits expires_in. Defaults to 3600s. */ fallbackTtlSeconds?: number; fetch?: FetchLike; now?: () => number; }; /** * Builds a `tokenSource` for `openai()` / `openaiCompatible()` that performs the * OAuth2 client-credentials flow against custom LLM gateways (Azure AD, Auth0, * enterprise proxies). Caches the access token in memory and refreshes it * automatically before expiry. Returns `() => Promise`. */ export declare const createOAuth2ClientCredentialsTokenSource: (config: OAuth2ClientCredentialsConfig) => (() => Promise); export {};