# `Codex.Auth`
[🔗](https://github.com/nshkrdotcom/codex_sdk/blob/v0.18.1/lib/codex/auth.ex#L1)

API key resolution with `CODEX_API_KEY` → `auth.json` → `OPENAI_API_KEY` precedence.

# `api_key`

```elixir
@spec api_key() :: String.t() | nil
```

# `auth_paths`

```elixir
@spec auth_paths() :: [String.t()]
```

# `chatgpt_access_token`

```elixir
@spec chatgpt_access_token() :: String.t() | nil
```

# `codex_home`

```elixir
@spec codex_home() :: String.t()
```

# `direct_api_key`

```elixir
@spec direct_api_key() :: String.t() | nil
```

# `infer_auth_mode`

```elixir
@spec infer_auth_mode() :: :api | :chatgpt
```

---

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