glean/models/openai_reasoning

OpenAI reasoning models: GPT-5 and later, and the o-series.

These reject sampling parameters and stop, so this builder only offers max_output_tokens and reasoning_effort. The “pro” models are only served by the Responses API, which glean doesn’t speak yet, so they are not listed.

Types

A OpenAI reasoning model builder. Pick a model with one of the constructors (or custom), chain setters, then call build().

pub opaque type Reasoning

Values

pub fn build(m: Reasoning) -> model.Model

Build a Model to use with agent.new.

pub fn configure(
  m: Reasoning,
  f: fn(config.ProviderConfig) -> config.ProviderConfig,
) -> Reasoning

Change the provider configuration: base URL, timeout, headers, retries.

|> configure(config.timeout(_, 120_000))
pub fn custom(
  api_key key: String,
  model model_id: String,
) -> Reasoning

Any other model ID served by this API, such as one released after this version of glean. Only this module’s setters are available, so check the model accepts them.

pub fn gpt5(api_key key: String) -> Reasoning

GPT-5. Model ID: gpt-5.

pub fn gpt5_1(api_key key: String) -> Reasoning

GPT-5.1. Model ID: gpt-5.1.

pub fn gpt5_2(api_key key: String) -> Reasoning

GPT-5.2. Model ID: gpt-5.2.

pub fn gpt5_4(api_key key: String) -> Reasoning

GPT-5.4. Model ID: gpt-5.4.

pub fn gpt5_4_mini(api_key key: String) -> Reasoning

GPT-5.4 mini. Model ID: gpt-5.4-mini.

pub fn gpt5_4_nano(api_key key: String) -> Reasoning

GPT-5.4 nano. Model ID: gpt-5.4-nano.

pub fn gpt5_5(api_key key: String) -> Reasoning

GPT-5.5. Model ID: gpt-5.5.

pub fn gpt5_mini(api_key key: String) -> Reasoning

GPT-5 mini. Model ID: gpt-5-mini.

pub fn gpt5_nano(api_key key: String) -> Reasoning

GPT-5 nano. Model ID: gpt-5-nano.

pub fn gpt6_1_terra(api_key key: String) -> Reasoning

GPT-6.1 Terra. Model ID: gpt-6.1-terra.

pub fn max_output_tokens(m: Reasoning, n: Int) -> Reasoning

Set the maximum number of output tokens.

pub fn o3(api_key key: String) -> Reasoning

o3. Model ID: o3.

pub fn o3_mini(api_key key: String) -> Reasoning

o3-mini. Model ID: o3-mini.

pub fn o4_mini(api_key key: String) -> Reasoning

o4-mini. Model ID: o4-mini.

pub fn reasoning_effort(
  m: Reasoning,
  effort: provider.ReasoningEffort,
) -> Reasoning

Set how much the model should think before answering.

✨ Search Document