# `H.Provider.AccountPolicy`
[🔗](https://github.com/parlant/harness/blob/v0.3.0/lib/h/provider/account_policy.ex#L1)

Optional account ordering for the existing Codex adapter. Return a subset
of the supplied aliases, in preference order, using cached data only.

Callbacks run in inference workers, never in the session coordinator. They
get no request body, transport options, credential, or provider error body.
A rejection notification can update state, but cannot authorize a retry.
Rate-limit scope is unknown.

# `status_projection`

```elixir
@type status_projection() :: %{
  optional(:status_note) =&gt; String.t() | nil,
  optional(:sources) =&gt; %{optional(String.t()) =&gt; String.t()}
}
```

# `unavailability`

```elixir
@type unavailability() :: %{
  :code =&gt; String.t(),
  :message =&gt; String.t(),
  optional(:summary) =&gt; String.t(),
  optional(:wait) =&gt; boolean(),
  optional(:wait_title) =&gt; String.t(),
  optional(:wait_detail) =&gt; String.t(),
  optional(:resumes_at_ms) =&gt; integer() | nil,
  optional(:recheck_after_ms) =&gt; pos_integer()
}
```

# `order`

```elixir
@callback order(model_id :: String.t(), eligible_aliases :: [String.t()]) :: [String.t()]
```

# `rejected`

```elixir
@callback rejected(
  model_id :: String.t(),
  alias_id :: String.t(),
  :invalid_token | :rate_limited
) :: :ok
```

# `status`
*optional* 

```elixir
@callback status(sources :: [String.t()]) :: status_projection()
```

# `unavailable`
*optional* 

```elixir
@callback unavailable(model_id :: String.t(), eligible_aliases :: [String.t()]) ::
  unavailability() | nil
```

---

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