#[non_exhaustive]pub enum ChatModel {
Show 47 variants
Gpt5_6,
Gpt5_6Sol,
Gpt5_6Terra,
Gpt5_6Luna,
Gpt5_5,
Gpt5_5Pro,
Gpt5_4,
Gpt5_4Pro,
Gpt5_4Mini,
Gpt5_4Nano,
Gpt5_3ChatLatest,
Gpt5_3Codex,
Gpt5_2Codex,
Gpt5_1Codex,
Gpt5SearchApi,
Gpt4oSearchPreview,
Gpt4oMiniSearchPreview,
GptAudio,
GptAudio1_5,
GptAudioMini,
Gpt5,
Gpt5Pro,
Gpt5_2,
Gpt5_2ChatLatest,
Gpt5_2Pro,
Gpt5_1,
Gpt5_1ChatLatest,
Gpt5_1CodexMax,
Gpt5Mini,
Gpt5Nano,
Gpt4_1,
Gpt4_1Mini,
Gpt4_1Nano,
Gpt4o,
Gpt4oMini,
Gpt4oAudioPreview,
Gpt4Turbo,
Gpt4,
Gpt3_5Turbo,
Gpt3_5Turbo16k,
O1,
O1Pro,
O3,
O3Pro,
O3Mini,
O4Mini,
Custom(String),
}Expand description
Models available for Chat Completions and Responses APIs.
This enum covers all models that can be used with the Chat Completions API
(/v1/chat/completions) and the Responses API (/v1/responses).
§Model Categories
§GPT-5 Series (Latest Flagship)
- [
Gpt5_2]: GPT-5.2 Thinking - flagship model for coding and agentic tasks - [
Gpt5_2ChatLatest]: GPT-5.2 Instant - fast workhorse for everyday work - [
Gpt5_2Pro]: GPT-5.2 Pro - smartest for difficult questions (Responses API only) - [
Gpt5_1]: GPT-5.1 - configurable reasoning and non-reasoning - [
Gpt5_1CodexMax]: GPT-5.1 Codex Max - powers Codex CLI - [
Gpt5Mini]: GPT-5 Mini - smaller, faster variant
§GPT-4.1 Series
- [
Gpt4_1]: 1M context window flagship - [
Gpt4_1Mini]: Balanced performance and cost - [
Gpt4_1Nano]: Fastest and most cost-efficient
§GPT-4o Series
- [
Gpt4o]: High-intelligence flagship model - [
Gpt4oMini]: Cost-effective GPT-4o variant - [
Gpt4oAudioPreview]: Audio-capable GPT-4o
§Reasoning Models (o-series)
- [
O1], [O1Pro]: Full reasoning models - [
O3], [O3Mini]: Latest reasoning models - [
O4Mini]: Fast, cost-efficient reasoning
§Reasoning Model Restrictions
Reasoning models (GPT-5 series, o1, o3, o4 series) have parameter restrictions:
temperature: Only 1.0 supportedtop_p: Only 1.0 supportedfrequency_penalty: Only 0 supportedpresence_penalty: Only 0 supported
GPT-5 models support reasoning.effort parameter:
none: No reasoning (GPT-5.1 default)minimal: Very few reasoning tokenslow,medium,high: Increasing reasoning depthxhigh: Maximum reasoning (GPT-5.2 Pro, GPT-5.1 Codex Max)
§Example
use openai_tools::common::models::ChatModel;
// Check if a model is a reasoning model
let model = ChatModel::O3Mini;
assert!(model.is_reasoning_model());
// GPT-5 models are also reasoning models
let gpt5 = ChatModel::Gpt5_2;
assert!(gpt5.is_reasoning_model());
// Get the API model ID string
assert_eq!(model.as_str(), "o3-mini");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Gpt5_6
GPT-5.6 - Alias routing to GPT-5.6 Sol
Gpt5_6Sol
GPT-5.6 Sol - Frontier model for complex professional work
- Context: 1.05M tokens, 128K max output
- Knowledge cutoff: 2026-02-16
- Supports: reasoning.effort
Gpt5_6Terra
GPT-5.6 Terra - Balanced model for everyday work
- Context: 1.05M tokens, 128K max output
- Supports: reasoning.effort
Gpt5_6Luna
GPT-5.6 Luna - Most cost-efficient GPT-5.6 variant
- Context: 1.05M tokens, 128K max output
- Supports: reasoning.effort
Gpt5_5
GPT-5.5 - Frontier model with 1M context
- Context: 1.05M tokens, 128K max output
- Supports: reasoning.effort (none, low, medium (default), high, xhigh)
Gpt5_5Pro
GPT-5.5 Pro - Uses more compute for consistently better answers
- Available in Responses API only (no Chat Completions)
- Supports: reasoning.effort (medium, high (default), xhigh)
Gpt5_4
GPT-5.4 - Frontier model for complex professional work
- Context: 1.05M tokens
- Supports: reasoning.effort (none (default), low, medium, high, xhigh)
Gpt5_4Pro
GPT-5.4 Pro - Uses more compute for consistently better answers
- Available in Responses API only (no Chat Completions)
- Supports: reasoning.effort (medium (default), high, xhigh)
Gpt5_4Mini
GPT-5.4 Mini - Strong mini model for coding, computer use and subagents
- Context: 400K tokens
- Supports: reasoning.effort
Gpt5_4Nano
GPT-5.4 Nano - Cheapest GPT-5.4-class model for high-volume tasks
- Context: 400K tokens
- Supports: reasoning.effort (none (default), low, medium, high, xhigh)
Gpt5_3ChatLatest
GPT-5.3 Instant - Non-reasoning chat model
Points to the GPT-5.3 Instant snapshot used in ChatGPT.
Deprecated by OpenAI - GPT-5.6 is recommended for most API usage.
Gpt5_3Codex
GPT-5.3 Codex - Most capable agentic coding model
- Available in Responses API only (no Chat Completions)
- Context: 400K tokens, 128K max output
- Supports: reasoning.effort (low, medium, high, xhigh)
Gpt5_2Codex
GPT-5.2 Codex - GPT-5.2 optimized for agentic coding tasks
- Available in Responses API only (no Chat Completions)
- Context: 400K tokens
- Supports: reasoning.effort (low, medium, high, xhigh)
Gpt5_1Codex
GPT-5.1 Codex - GPT-5 optimized for agentic coding tasks
- Available in Responses API only (no Chat Completions)
Gpt5SearchApi
GPT-5 Search API - GPT-5 with built-in web search
Rejects sampling parameters and exposes no reasoning parameter.
Gpt4oSearchPreview
GPT-4o Search Preview - GPT-4o with built-in web search
Gpt4oMiniSearchPreview
GPT-4o Mini Search Preview - GPT-4o Mini with built-in web search
GptAudio
GPT Audio - audio-capable chat model
Requires an audio input content part or an audio output modality.
GptAudio1_5
GPT Audio 1.5 - newer audio-capable chat model
GptAudioMini
GPT Audio Mini - cost-efficient audio-capable chat model
Gpt5
GPT-5 - Original GPT-5 flagship reasoning model
Gpt5Pro
GPT-5 Pro - GPT-5 with more compute for difficult questions
- Available in Responses API only (no Chat Completions)
Gpt5_2
GPT-5.2 Thinking - Flagship model for coding and agentic tasks
- Context: 128K tokens (256K with thinking)
- Supports: reasoning.effort (none, minimal, low, medium, high, xhigh)
- Supports: verbosity parameter (low, medium, high)
Gpt5_2ChatLatest
GPT-5.2 Instant - Fast workhorse for everyday work
Points to the GPT-5.2 Instant snapshot used in ChatGPT. This is a non-reasoning model, so it accepts the full standard parameter set.
Deprecated by OpenAI - GPT-5.6 is recommended for most API usage.
Gpt5_2Pro
GPT-5.2 Pro - Smartest for difficult questions
- Available in Responses API only
- Supports: xhigh reasoning effort
Gpt5_1
GPT-5.1 - Configurable reasoning and non-reasoning
- Defaults to no reasoning (effort: none)
- Supports: reasoning.effort (none, low, medium, high)
Gpt5_1ChatLatest
GPT-5.1 Instant - Chat-optimized GPT-5.1
Points to the GPT-5.1 Instant snapshot used in ChatGPT. This is a non-reasoning model, so it accepts the full standard parameter set.
Gpt5_1CodexMax
GPT-5.1 Codex Max - Powers Codex and Codex CLI
- Available in Responses API only
- Supports: reasoning.effort (none, medium, high, xhigh)
Gpt5Mini
GPT-5 Mini - Smaller, faster GPT-5 variant
Gpt5Nano
GPT-5 Nano - Fastest, most cost-efficient GPT-5 variant
Gpt4_1
GPT-4.1 - Smartest non-reasoning model with 1M token context
Gpt4_1Mini
GPT-4.1 Mini - Balanced performance and cost
Gpt4_1Nano
GPT-4.1 Nano - Fastest and most cost-efficient
Gpt4o
GPT-4o - High-intelligence flagship model (multimodal)
Gpt4oMini
GPT-4o Mini - Cost-effective GPT-4o variant
Gpt4oAudioPreview
GPT-4o Audio Preview - Audio-capable GPT-4o
Gpt4Turbo
GPT-4 Turbo - High capability with faster responses
Gpt4
GPT-4 - Original GPT-4 model
Gpt3_5Turbo
GPT-3.5 Turbo - Fast and cost-effective
Gpt3_5Turbo16k
GPT-3.5 Turbo 16K - legacy extended-context GPT-3.5 Turbo
O1
O1 - Full reasoning model for complex tasks
O1Pro
O1 Pro - O1 with more compute for complex problems
O3
O3 - Latest full reasoning model
O3Pro
O3 Pro - O3 with more compute
- Available in Responses API only (no Chat Completions)
O3Mini
O3 Mini - Smaller, faster reasoning model
O4Mini
O4 Mini - Fast, cost-efficient reasoning model
Custom(String)
Custom model ID for fine-tuned models or new models not yet in enum
Implementations§
Source§impl ChatModel
impl ChatModel
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns the model identifier string for API requests.
§Example
use openai_tools::common::models::ChatModel;
assert_eq!(ChatModel::Gpt4oMini.as_str(), "gpt-4o-mini");
assert_eq!(ChatModel::O3Mini.as_str(), "o3-mini");
assert_eq!(ChatModel::Gpt5_2.as_str(), "gpt-5.2");Sourcepub fn is_reasoning_model(&self) -> bool
pub fn is_reasoning_model(&self) -> bool
Checks if this is a reasoning model with parameter restrictions.
Reasoning models (GPT-5 series, o1, o3, o4 series) only support:
temperature = 1.0top_p = 1.0frequency_penalty = 0presence_penalty = 0
§Example
use openai_tools::common::models::ChatModel;
assert!(ChatModel::O3Mini.is_reasoning_model());
assert!(ChatModel::Gpt5_2.is_reasoning_model());
assert!(!ChatModel::Gpt4oMini.is_reasoning_model());
assert!(!ChatModel::Gpt4_1.is_reasoning_model());Sourcepub fn is_search_model(&self) -> bool
pub fn is_search_model(&self) -> bool
Checks if this is a web-search model.
Search models (gpt-5-search-api, gpt-4o-search-preview,
gpt-4o-mini-search-preview) reject the whole sampling parameter set -
temperature, top_p, n, logprobs and the penalties - but unlike
reasoning models they expose no reasoning parameter.
§Example
use openai_tools::common::models::ChatModel;
assert!(ChatModel::Gpt4oSearchPreview.is_search_model());
assert!(!ChatModel::Gpt4oSearchPreview.is_reasoning_model());
assert!(!ChatModel::Gpt4oMini.is_search_model());Sourcepub fn parameter_support(&self) -> ParameterSupport
pub fn parameter_support(&self) -> ParameterSupport
Returns parameter support information for this model.
This method provides detailed information about which parameters are supported by the model and any restrictions that apply.
§Example
use openai_tools::common::models::{ChatModel, ParameterRestriction};
// Standard model supports all parameters
let standard = ChatModel::Gpt4oMini;
let support = standard.parameter_support();
assert_eq!(support.temperature, ParameterRestriction::Any);
assert!(support.logprobs);
// Reasoning model has restrictions
let reasoning = ChatModel::O3Mini;
let support = reasoning.parameter_support();
assert_eq!(support.temperature, ParameterRestriction::FixedValue(1.0));
assert!(!support.logprobs);
assert!(support.reasoning);Sourcepub fn custom(model_id: impl Into<String>) -> Self
pub fn custom(model_id: impl Into<String>) -> Self
Creates a custom model from a string.
Use this for fine-tuned models or new models not yet in the enum.
§Example
use openai_tools::common::models::ChatModel;
let model = ChatModel::custom("ft:gpt-4o-mini:my-org::abc123");
assert_eq!(model.as_str(), "ft:gpt-4o-mini:my-org::abc123");Trait Implementations§
Source§impl<'de> Deserialize<'de> for ChatModel
impl<'de> Deserialize<'de> for ChatModel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ChatModel
impl StructuralPartialEq for ChatModel
Auto Trait Implementations§
impl Freeze for ChatModel
impl RefUnwindSafe for ChatModel
impl Send for ChatModel
impl Sync for ChatModel
impl Unpin for ChatModel
impl UnsafeUnpin for ChatModel
impl UnwindSafe for ChatModel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.