Skip to content

ResponsesConfig

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

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

apiKey: string;

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


optional baseUrl?: string;

Defined in: core/src/providers/responses.ts:45

Any endpoint speaking the Responses format. Defaults to OpenAI itself.


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

Defined in: core/src/providers/responses.ts:48


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/responses.ts:50

MDN Reference

Parameter Type
input RequestInfo | URL
init? RequestInit

Promise<Response>


optional headers?: Record<string, string>;

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

Extra request headers, where a subscription backend’s account id goes (ChatGPT-Account-Id), which those backends reject the request without.


optional id?: string;

Defined in: core/src/providers/responses.ts:47

Names the provider in errors and logs.


optional imageLimits?: ImageLimits;

Defined in: core/src/providers/responses.ts:79

What this backend accepts as an image. Each image it would refuse is replaced by a note naming the reason, instead of failing the request.


optional instanceSessionId?: string;

Defined in: core/src/providers/responses.ts:67

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.

It is not sent as prompt_cache_key, which stays the per-call sessionId’s: this id names the adapter, so it is shared by every conversation the adapter serves, and a minted one never was a cache key.


optional maxTokens?: number;

Defined in: core/src/providers/responses.ts:49


model: string;

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


optional path?: string;

Defined in: core/src/providers/responses.ts:76

Where this backend serves the endpoint, when it is not /v1/responses. The ChatGPT subscription surface serves it at /backend-api/codex/responses with no version segment, so that backend needs { baseUrl: "https://chatgpt.com/backend-api/codex", path: "/responses" }. Without the override the POST 404s, and a 404 classifies as “model”. The user is told the model id does not exist when the path was the problem.


optional replayReasoning?: boolean;

Defined in: core/src/providers/responses.ts:83

Ask for the encrypted reasoning items and replay them on the next turn, so the model keeps its chain of thought across a stateless turn. Only for backends that accept include: ["reasoning.encrypted_content"].


optional serviceTier?: ServiceTier;

Defined in: core/src/providers/responses.ts:85

Default service_tier for every call; StreamOptions.serviceTier wins.


optional sessionHeader?: string;

Defined in: core/src/providers/responses.ts:56

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


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