Skip to main content
The OpenAI provider gives you access to GPT-5, GPT-4o, and o-series reasoning models through a unified interface.

Setup

Set your API key as an environment variable:

Usage

Available Models

Provider Options

Customize OpenAI-specific parameters:

Reasoning

OpenAI reasoning models work with ai-query’s normalized reasoning parameter:
ai-query keeps max_tokens as the public API and maps it to the correct OpenAI request field internally. Visible thinking output depends on what the upstream provider actually streams. For the callback-based output model, see Thinking.

Supported Options

Tool Calling

OpenAI models have excellent tool calling support:

Streaming