Skip to content

AnthropicConfig

Defined in: core/src/providers/anthropic.ts:28

Standard options that any provider config can accept to configure fallbacks inline.

apiKey: string;

Defined in: core/src/providers/anthropic.ts:29


optional baseUrl?: string;

Defined in: core/src/providers/anthropic.ts:33

Any endpoint speaking the Anthropic Messages dialect, including a proxy or gateway. Defaults to Anthropic itself.


optional bearer?: boolean;

Defined in: core/src/providers/anthropic.ts:60

Send the key as a Bearer instead of x-api-key, as a subscription access token requires.


optional effort?: "none" | "low" | "medium" | "high" | "max";

Defined in: core/src/providers/anthropic.ts:39

Bound default; a per-call effort overrides it.


optional explicitNone?: boolean;

Defined in: core/src/providers/anthropic.ts:80

Say “no thinking” with an explicit thinking: { type: "disabled" } when effort resolves to none, instead of omitting the field. For endpoints where an absent field means the model’s default, not off. Z.ai’s coding endpoint reads silence as thinking ON for reasoning-mandatory models like GLM 5.3 Flash (measured 2026-09-13: omit → thinking block; disabled → none), and it accepts the marker natively. Ignored for a Claude id that thinks adaptively (4.6 and later): each has its own spelling of none (see CLAUDE_THINKING), and several reject this marker outright. Claude 4.5 and older accept it, and get it.


optional fallbackOptions?: FallbackOptions<Provider>;

Defined in: core/src/fallback.ts:94

Custom cooldown or telemetry options for the fallback pool.

ProviderFallbackConfig.fallbackOptions


optional fallbacks?: readonly FallbackCandidate[];

Defined in: core/src/fallback.ts:88

Secondary and tertiary providers to try if this provider fails/exhausts: hand-built Providers, preset-id FallbackSpecs, or both.

ProviderFallbackConfig.fallbacks


optional fetchImpl?: (input, init?) => Promise<Response>;

Defined in: core/src/providers/anthropic.ts:43

MDN Reference

Parameter Type
input RequestInfo | URL
init? RequestInit

Promise<Response>


optional headers?: Record<string, string>;

Defined in: core/src/providers/anthropic.ts:46

Merged into every request. The subscription backend needs its own beta headers, and a gateway in front usually wants one of its own.


optional id?: string;

Defined in: core/src/providers/anthropic.ts:37

Names the provider in errors and logs. The subscription backend is the reason this is not hardcoded: a token failure there is a re-login, not a bad API key, and the two must not read the same in a ledger.


optional instanceSessionId?: string;

Defined in: core/src/providers/anthropic.ts:70

The id sessionHeader carries when a call has no sessionId. Absent, the adapter mints one when it is built. Pass one when something rebuilds the adapter (withKeyPool and withToken build one per attempt): each build mints a new id, and a gateway that pins a session to one upstream host then treats every call as a new session, re-routes it and misses its prompt cache. Ignored without sessionHeader.


optional maxTokens?: number;

Defined in: core/src/providers/anthropic.ts:41

Anthropic requires an output ceiling on every request.


model: string;

Defined in: core/src/providers/anthropic.ts:30


optional sessionHeader?: string;

Defined in: core/src/providers/anthropic.ts:63

Header that carries StreamOptions.sessionId. When set and a call has no sessionId, one stable id for this provider instance rides instead.


optional siteName?: string;

Defined in: core/src/providers/anthropic.ts:57

App name for OpenRouter’s rankings, sent as X-Title. See siteUrl.


optional siteUrl?: string;

Defined in: core/src/providers/anthropic.ts:53

App attribution for OpenRouter’s rankings. The site URL rides as HTTP-Referer, the app name as X-Title. Public, not secret. Sent whenever set (other vendors ignore unknown headers); an explicit entry in headers always wins. Covers OpenRouter’s Anthropic-dialect endpoint.


optional version?: string;

Defined in: core/src/providers/anthropic.ts:42


optional watchdog?: WatchdogOptions;

Defined in: core/src/fallback.ts:92

Watch every candidate separately. A silent candidate then times out and rotates; wrapping the completed pool would abort the whole chain instead. Fallback specs inherit this unless they set their own watchdog.

ProviderFallbackConfig.watchdog