Codex.Models (Codex SDK v0.3.0)

View Source

Known Codex models and their defaults.

Summary

Functions

Returns the SDK default model, honoring environment overrides when present.

Returns the default reasoning effort for the given model (or the default model).

Returns the list of supported models with metadata describing defaults.

Parses a reasoning effort value into its canonical atom form.

Renders a normalized reasoning effort as the CLI-friendly string value.

Lists the valid reasoning effort values understood by the SDK.

Returns true when the given model supports tool execution.

Types

model()

@type model() :: %{
  id: String.t(),
  default_reasoning_effort: reasoning_effort(),
  tool_enabled?: boolean(),
  default?: boolean()
}

reasoning_effort()

@type reasoning_effort() :: :minimal | :low | :medium | :high | :xhigh

Functions

default_model()

@spec default_model() :: String.t()

Returns the SDK default model, honoring environment overrides when present.

default_reasoning_effort(model \\ default_model())

@spec default_reasoning_effort(String.t() | atom() | nil) :: reasoning_effort() | nil

Returns the default reasoning effort for the given model (or the default model).

list()

@spec list() :: [model(), ...]

Returns the list of supported models with metadata describing defaults.

normalize_reasoning_effort(value)

@spec normalize_reasoning_effort(String.t() | atom() | nil) ::
  {:ok, reasoning_effort() | nil} | {:error, term()}

Parses a reasoning effort value into its canonical atom form.

reasoning_effort_to_string(effort)

@spec reasoning_effort_to_string(reasoning_effort()) :: String.t()

Renders a normalized reasoning effort as the CLI-friendly string value.

reasoning_efforts()

@spec reasoning_efforts() :: [reasoning_effort(), ...]

Lists the valid reasoning effort values understood by the SDK.

tool_enabled?(model)

@spec tool_enabled?(String.t() | atom() | nil) :: boolean()

Returns true when the given model supports tool execution.