AnthropicConfig
Defined in: core/src/providers/anthropic.ts:28
Standard options that any provider config can accept to configure fallbacks inline.
Extends
Section titled “Extends”Properties
Section titled “Properties”apiKey
Section titled “apiKey”apiKey: string;Defined in: core/src/providers/anthropic.ts:29
baseUrl?
Section titled “baseUrl?”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.
bearer?
Section titled “bearer?”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.
effort?
Section titled “effort?”optional effort?: "none" | "low" | "medium" | "high" | "max";Defined in: core/src/providers/anthropic.ts:39
Bound default; a per-call effort overrides it.
explicitNone?
Section titled “explicitNone?”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.
fallbackOptions?
Section titled “fallbackOptions?”optional fallbackOptions?: FallbackOptions<Provider>;Defined in: core/src/fallback.ts:94
Custom cooldown or telemetry options for the fallback pool.
Inherited from
Section titled “Inherited from”ProviderFallbackConfig.fallbackOptions
fallbacks?
Section titled “fallbacks?”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.
Inherited from
Section titled “Inherited from”ProviderFallbackConfig.fallbacks
fetchImpl?
Section titled “fetchImpl?”optional fetchImpl?: (input, init?) => Promise<Response>;Defined in: core/src/providers/anthropic.ts:43
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
RequestInfo | URL |
init? |
RequestInit |
Returns
Section titled “Returns”Promise<Response>
headers?
Section titled “headers?”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.
instanceSessionId?
Section titled “instanceSessionId?”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.
maxTokens?
Section titled “maxTokens?”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
sessionHeader?
Section titled “sessionHeader?”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.
siteName?
Section titled “siteName?”optional siteName?: string;Defined in: core/src/providers/anthropic.ts:57
App name for OpenRouter’s rankings, sent as X-Title. See siteUrl.
siteUrl?
Section titled “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.
version?
Section titled “version?”optional version?: string;Defined in: core/src/providers/anthropic.ts:42
watchdog?
Section titled “watchdog?”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.