# `Codex.ModelSettings`
[🔗](https://github.com/nshkrdotcom/codex_sdk/blob/v0.16.1/lib/codex/model_settings.ex#L1)

Model tuning options and provider selection used to configure codex runs.

# `t`

```elixir
@type t() :: %Codex.ModelSettings{
  extra_body: map(),
  extra_headers: map(),
  extra_query: map(),
  frequency_penalty: number() | nil,
  max_tokens: pos_integer() | nil,
  metadata: map() | nil,
  parallel_tool_calls: boolean() | nil,
  presence_penalty: number() | nil,
  prompt_cache: term() | nil,
  provider: :responses | :chat,
  reasoning: term() | nil,
  response_include: term() | nil,
  store: term() | nil,
  temperature: number() | nil,
  tool_choice: term() | nil,
  top_logprobs: term() | nil,
  top_p: number() | nil,
  truncation: term() | nil
}
```

# `merge`

```elixir
@spec merge(t(), map() | keyword() | t()) :: {:ok, t()} | {:error, term()}
```

Merges two settings structs, preferring non-nil values from `overrides`.

# `new`

```elixir
@spec new(map() | keyword() | t()) :: {:ok, t()} | {:error, term()}
```

Builds a validated `%Codex.ModelSettings{}` struct.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
