Enum Class OpenAIModelId

java.lang.Object
java.lang.Enum<OpenAIModelId>
ai.singlr.openai.OpenAIModelId
All Implemented Interfaces:
Serializable, Comparable<OpenAIModelId>, Constable

public enum OpenAIModelId extends Enum<OpenAIModelId>
Supported OpenAI model identifiers.

Each enum constant maps to a specific model available through the Responses API.

  • Enum Constant Details

  • Method Details

    • values

      public static OpenAIModelId[] 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

      public static OpenAIModelId valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • id

      public String id()
      Returns the API model identifier string.
      Returns:
      the model ID used in API requests
    • contextWindow

      public int contextWindow()
      Returns the context window size in tokens.
      Returns:
      the context window size
    • maxOutputTokens

      public int maxOutputTokens()
      Returns the maximum output tokens this model can generate in a single response. Used as the fallback when ModelConfig.maxOutputTokens() is unset.
      Returns:
      the per-model output ceiling
    • fromId

      public static OpenAIModelId fromId(String id)
      Finds an OpenAIModelId by its string identifier.
      Parameters:
      id - the model identifier string
      Returns:
      the matching OpenAIModelId, or null if not found
    • isSupported

      public static boolean isSupported(String id)
      Checks if the given model ID is supported.
      Parameters:
      id - the model identifier string
      Returns:
      true if the model is supported