import Anthropic from '@anthropic-ai/sdk'; /** The identity Anthropic requires as the FIRST system block when a request is * authenticated with a subscription OAuth token — the token is authorised only * for Claude-Code-shaped requests. Overridable via `ANTHROPIC_OAUTH_SYSTEM` for * resilience if the required string changes. Used by the adapter's buildRequest. */ export declare function oauthSystemIdentity(env?: NodeJS.ProcessEnv): string; /** Resolve the client for a call plus whether it authenticates with a * subscription OAuth token (which needs the Claude-Code system identity on every * request). The no-per-call-key client is cached (the common path); a BYOK * per-call key builds a fresh client and is never the OAuth path. Throws a clear * error when no credential is configured. */ export declare function resolveClient(perCallApiKey: string | null): { client: Anthropic; oauth: boolean; }; /** A 401 from the Anthropic SDK — an authentication rejection (a rejected or * expired OAuth token, a missing/blocked Claude-Code identity, a bad key), as * opposed to a transient 429/5xx that the caller's retry ladder handles. A 403 is * deliberately EXCLUDED: it is authorization (permission denied on the org / * project), not a bad token, so it must not trigger the metered-key fallback. */ export declare function isAuthError(err: unknown): boolean; /** Latch OAuth off after a 401 and warn ONCE — loudly, because the fallback * bills the metered key, the very cost the OAuth path exists to avoid. Never * silent: a user who set CLAUDE_CODE_OAUTH_TOKEN must SEE that it was rejected * and that spend has moved onto ANTHROPIC_API_KEY. Only the HTTP status is * emitted — never the error message or any token (secret-handling). */ export declare function noteOAuthRejected(err: unknown): void; /** Test seam: reset the cached client + the fallback latch between tests. * INTERNAL — imported directly by the co-located tests, never re-exported to * consumers, so it never appears on the package's public surface. */ export declare function resetClientStateForTests(): void; //# sourceMappingURL=client.d.ts.map