Access GPT models including standard chat models and reasoning models (o1, o3, GPT-5).
OPENAI_API_KEY=sk-...OpenAI provider automatically routes between two APIs based on model metadata:
- Chat Completions API: Standard GPT models (gpt-4o, gpt-4-turbo, gpt-3.5-turbo)
- Responses API: Reasoning models (o1, o3, o4-mini, gpt-5) with extended thinking
Passed via :provider_options keyword:
- Type: Integer
- Purpose: Required for reasoning models (o1, o3, gpt-5)
- Note: ReqLLM auto-translates
max_tokenstomax_completion_tokensfor reasoning models - Example:
provider_options: [max_completion_tokens: 4000]
- Type:
:auto|:json_schema|:tool_strict - Default:
:auto - Purpose: Control structured output strategy
:auto: Use json_schema when supported, else strict tools:json_schema: Force response_format with json_schema:tool_strict: Force strict: true on function tools- Example:
provider_options: [openai_structured_output_mode: :json_schema]
- Type: Map
- Purpose: Custom response format configuration
- Example:
provider_options: [ response_format: %{ type: "json_schema", json_schema: %{ name: "person", schema: %{type: "object", properties: %{name: %{type: "string"}}} } } ]
- Type: Boolean | nil
- Default:
nil - Purpose: Override parallel tool call behavior
- Example:
provider_options: [openai_parallel_tool_calls: false]
- Type:
:low|:medium|:high - Purpose: Control reasoning effort (Responses API only)
- Example:
reasoning_effort: :high
- Type:
:auto|:default|:flex|:priority| String - Purpose: Service tier for request prioritization
- Example:
service_tier: :auto
- Type: Integer
- Purpose: Set seed for reproducible outputs
- Example:
provider_options: [seed: 42]
- Type: Boolean
- Purpose: Request log probabilities
- Example:
provider_options: [logprobs: true, top_logprobs: 3]
- Type: Integer (1-20)
- Purpose: Number of log probabilities to return
- Requires:
logprobs: true - Example:
provider_options: [logprobs: true, top_logprobs: 5]
- Type: String
- Purpose: Track usage by user identifier
- Example:
provider_options: [user: "user_123"]
- Type: Positive integer
- Purpose: Control embedding dimensions (model-specific ranges)
- Example:
provider_options: [dimensions: 512]
- Type:
"float"|"base64" - Purpose: Format for embedding output
- Example:
provider_options: [encoding_format: "base64"]
- Type: String
- Purpose: Resume tool calling flow from previous response
- Example:
provider_options: [previous_response_id: "resp_abc123"]
- Type: List of
%{call_id, output}maps - Purpose: Provide tool execution results for resume flow
- Example:
provider_options: [tool_outputs: [%{call_id: "call_1", output: "result"}]]
OpenAI provides comprehensive usage data including:
reasoning_tokens- For reasoning models (o1, o3, gpt-5)cached_tokens- Cached input tokens- Standard input/output/total tokens and costs