Skip to content

basalt / ai/src / OpenAICompatibleProviderOptions

Interface: OpenAICompatibleProviderOptions ​

Defined in: ai/src/provider/openai.ts:10

Properties ​

apiKey ​

> apiKey: string

Defined in: ai/src/provider/openai.ts:12

API key → Authorization: Bearer <key>. Required.


baseUrl? ​

> optional baseUrl?: string

Defined in: ai/src/provider/openai.ts:20

API base URL up to and including /v1. /chat/completions is appended. Defaults to the public OpenAI API; point it at any compatible gateway, e.g. https://ai.go4ai.io/v1.


fetch? ​

> optional fetch?: FetchLike

Defined in: ai/src/provider/openai.ts:28

Injected non-streaming fetch. Defaults to the global fetch.


model? ​

> optional model?: string

Defined in: ai/src/provider/openai.ts:14

Model id, e.g. 'gpt-4o-mini' or 'us.anthropic.claude-sonnet-4-5-20250929-v1:0'.


sseFetch? ​

> optional sseFetch?: SseFetch

Defined in: ai/src/provider/openai.ts:30

Injected streaming fetch. Defaults to one built on the global fetch.


stream? ​

> optional stream?: boolean

Defined in: ai/src/provider/openai.ts:26

Stream the completion via SSE (default true). Streaming avoids the spurious 500 some gateways return when buffering a long non-streaming response. Set false for a gateway that doesn't support streaming.

Released under the MIT License.