Skip to content

ChatCompat

Defined in: packages/gateway/src/adapters/openai-chat/compat.ts:10

How one OpenAI-compatible server or model differs from OpenAI’s own Chat Completions API.

readonly optional cacheBreakpoints?: boolean

Defined in: packages/gateway/src/adapters/openai-chat/compat.ts:35

Whether the model takes explicit cache breakpoints (prompt_cache_breakpoint on content parts and prompt_cache_options), which OpenAI supports from gpt-5.6. Defaults to false, which leaves caching to the server’s automatic prefix cache.


readonly optional maxTokensField?: "max_tokens" | "max_completion_tokens"

Defined in: packages/gateway/src/adapters/openai-chat/compat.ts:15

The body field that carries the output limit. Defaults to "max_completion_tokens"; OpenAI deprecates max_tokens and says reasoning models do not accept it, but many compatible servers read only max_tokens.


readonly optional promptCacheRetention?: boolean

Defined in: packages/gateway/src/adapters/openai-chat/compat.ts:40

Whether cacheRetention: "long" sends prompt_cache_retention: "24h", for models before gpt-5.6 that offer extended caching. Defaults to false.


readonly optional streamUsage?: boolean

Defined in: packages/gateway/src/adapters/openai-chat/compat.ts:22

Whether to ask for a final usage chunk with stream_options: { include_usage: true }. Defaults to true. A server that rejects the field needs false, and its replies then report no usage.


readonly optional strictTools?: boolean

Defined in: packages/gateway/src/adapters/openai-chat/compat.ts:24

Whether tools are sent with strict: true when their schema allows it. Defaults to true.


readonly optional systemRole?: "system" | "developer"

Defined in: packages/gateway/src/adapters/openai-chat/compat.ts:17

The role the system prompt is sent as. Defaults to "system", which every compatible server reads.


readonly optional temperature?: boolean

Defined in: packages/gateway/src/adapters/openai-chat/compat.ts:29

Whether the model accepts temperature. Defaults to true; with false, a temperature you set is not sent and the call streams a warning.

These docs are licensedCC BY 4.0. Thelicence text is in the repository.