ProviderPreset
Defined in: core/src/presets.ts:54
Properties
Section titled “Properties”auth: PresetAuth;Defined in: core/src/presets.ts:62
baseUrl
Section titled “baseUrl”baseUrl: string;Defined in: core/src/presets.ts:59
API root. If it ends with /v1, /v4 or another version segment, the adapter automatically routes to /chat/completions instead of /v1/chat/completions.
defaultModel?
Section titled “defaultModel?”optional defaultModel?: string;Defined in: core/src/presets.ts:64
Fallback when the caller passes no model.
explicitNone?
Section titled “explicitNone?”optional explicitNone?: boolean;Defined in: core/src/presets.ts:79
Anthropic-shape dialect: say “no thinking” with an explicit
thinking: { type: "disabled" } marker when effort is none. For
endpoints where an absent field means the model’s default, with thinking
on for reasoning-mandatory models (measured on Z.ai’s coding endpoint:
omit → thinking block; disabled → none). Leave it unset for native
Anthropic: the adapter spells none per Claude model, and ignores this
flag for every Claude from 4.6 on.
headers?
Section titled “headers?”optional headers?: Record<string, string>;Defined in: core/src/presets.ts:69
Static protocol headers the endpoint requires (e.g. OAuth beta flags). Per-request headers (request ids, account ids) are the caller’s.
imageLimits?
Section titled “imageLimits?”optional imageLimits?: ImageLimits;Defined in: core/src/presets.ts:98
Responses shape: what the backend accepts as an image, for backends that fail a whole request over one image they won’t take.
initiatorHeader?
Section titled “initiatorHeader?”optional initiatorHeader?: boolean;Defined in: core/src/presets.ts:105
OpenAI shape: send X-Initiator (user or agent) on every call. GitHub
Copilot bills a premium request per user turn.
maxTokens?
Section titled “maxTokens?”optional maxTokens?: number;Defined in: core/src/presets.ts:83
Output ceiling when the caller sets none. Thinking and the answer share it, so a model that reasons past the adapter’s default ends the turn with neither text nor a tool call.
models?
Section titled “models?”optional models?: string[];Defined in: core/src/presets.ts:66
Representative model ids.
noSampling?
Section titled “noSampling?”optional noSampling?: boolean;Defined in: core/src/presets.ts:108
OpenAI shape: never send temperature or top_p, for an endpoint that
fixes its own sampling and answers the fields with an error.
optional path?: string;Defined in: core/src/presets.ts:61
Explicit path override when a gateway has custom routing.
replayReasoning?
Section titled “replayReasoning?”optional replayReasoning?: boolean;Defined in: core/src/presets.ts:102
Responses shape: ask for the encrypted reasoning items, and send them back
on the next turn. Only for backends that take include; chatgpt is the
one that does, and Go and Grok may refuse it.
rotation?
Section titled “rotation?”optional rotation?: readonly string[];Defined in: core/src/presets.ts:95
Default model chain when the caller names neither model nor models:
the first answers, the rest take over (same key) when it fails.
routes?
Section titled “routes?”optional routes?: readonly PresetRoute[];Defined in: core/src/presets.ts:92
Wires for model ids that don’t use the preset’s own shape. The first
route with a matching prefix serves the model. A model on a different wire
than the one the provider was built for is refused with invalid, so a
per-call model can’t send a request to an endpoint that would 404 it.
sessionHeader?
Section titled “sessionHeader?”optional sessionHeader?: string;Defined in: core/src/presets.ts:87
Header that carries StreamOptions.sessionId, for gateways that route
and cache per conversation and refuse a call without it (OpenCode Go:
MissingSessionID, measured 2026-09-27).
shape: PresetShape;Defined in: core/src/presets.ts:56
Adapter wire format.
textOnly?
Section titled “textOnly?”optional textOnly?: boolean;Defined in: core/src/presets.ts:71
True when the endpoint hard-400s image parts (measured on DeepSeek).