Enum Class OpenAIModelId
- All Implemented Interfaces:
Serializable, Comparable<OpenAIModelId>, Constable
Supported OpenAI model identifiers.
Each enum constant maps to a specific model available through the Responses API.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionintReturns the context window size in tokens.static OpenAIModelIdFinds an OpenAIModelId by its string identifier.id()Returns the API model identifier string.static booleanisSupported(String id) Checks if the given model ID is supported.intReturns the maximum output tokens this model can generate in a single response.static OpenAIModelIdReturns the enum constant of this class with the specified name.static OpenAIModelId[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
GPT_5_5
-
GPT_5_4
-
GPT_5_4_MINI
-
GPT_5_4_NANO
-
GPT_4_1
-
GPT_4_1_MINI
-
GPT_4_1_NANO
-
GPT_4O
-
GPT_4O_MINI
-
O3
-
O4_MINI
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
id
-
contextWindow
Returns the context window size in tokens.- Returns:
- the context window size
-
maxOutputTokens
Returns the maximum output tokens this model can generate in a single response. Used as the fallback whenModelConfig.maxOutputTokens()is unset.- Returns:
- the per-model output ceiling
-
fromId
Finds an OpenAIModelId by its string identifier.- Parameters:
id- the model identifier string- Returns:
- the matching OpenAIModelId, or null if not found
-
isSupported
Checks if the given model ID is supported.- Parameters:
id- the model identifier string- Returns:
- true if the model is supported
-