Skip to content

OpenAI

provider: 'openai'

The OpenAI provider reaches GPT models through OpenAI's API. The same models can be reached through OpenRouter.

Authentication

Get an API key from the OpenAI platform and pass it through extra.apiKey:

ts
{
  provider: 'openai',
  model: 'gpt-5-5',
  extra: { apiKey: process.env.OPENAI_API_KEY },
}

Configuration

FieldRequiredDescription
extra.apiKeyRecommendedOpenAI API key. If omitted, the OpenAI client falls back to OPENAI_API_KEY.
extra.baseUrlOptionalOverride the API base URL — useful for Azure OpenAI or a compatible proxy.

Models

Modelmodel
GPT 5.4gpt-5-4
GPT 5.5gpt-5-5

JSON output

GPT models use response_format: json_schema (strict: true) for schema-enforced JSON. See JSON output and schemas. temperature is not sent.