Skip to content
providerkit
GitHub

ProviderPreset

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

auth: PresetAuth;

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


baseUrl: string;

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

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:109

Fallback when the caller passes no model.


optional explicitNone?: boolean;

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

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:114

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:143

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:150

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:128

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:111

Representative model ids.


optional noSampling?: boolean;

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

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:106

Explicit path override when a gateway has custom routing.


optional replayReasoning?: boolean;

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

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:140

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:137

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:132

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:101

Adapter wire format.


optional speech?: PresetSpeech;

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

Text to speech on this endpoint. See PresetSpeech.


optional textOnly?: boolean;

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

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


optional transcription?: PresetTranscription;

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

Speech to text on this endpoint. See PresetTranscription.