Skip to content

ProviderPreset

Defined in: core/src/presets.ts:54

auth: PresetAuth;

Defined in: core/src/presets.ts:62


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.


optional defaultModel?: string;

Defined in: core/src/presets.ts:64

Fallback when the caller passes no model.


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.


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.


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.


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.


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.


optional models?: string[];

Defined in: core/src/presets.ts:66

Representative model ids.


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.


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.


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.


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.


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.


optional textOnly?: boolean;

Defined in: core/src/presets.ts:71

True when the endpoint hard-400s image parts (measured on DeepSeek).