> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentbees.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex CLI

> OpenAI's coding CLI — runs on an OpenAI API key.

**Codex CLI** (`codex`) is OpenAI's agentic coding CLI. It authenticates with an
**OpenAI API key**.

## Set it up

<Steps>
  <Step title="Open Admin → Agent LLM">Scroll to the per-agent keys section.</Step>

  <Step title="Add the OpenAI key (Codex)">
    Paste your OpenAI API key. It's **write-only and encrypted at rest**, and only needed if you
    enable the Codex agent.
  </Step>

  <Step title="(Optional) allow specific models">
    Set a **Codex model allowlist** (e.g. `gpt-5, gpt-5-mini`). With two or more, the New Task form
    shows a Model dropdown for Codex tasks.
  </Step>
</Steps>

## Using it in a task

Pick **Codex CLI** as the agent in the New Task form. If a Codex model allowlist
is set, choose the model per task.

<Note>
  An org's **Agent allowlist** controls which CLIs users may launch. If Codex isn't in the
  allowlist, it won't appear in the New Task dropdown.
</Note>

## Through the internal gateway

If your org routes everything through the [internal gateway](/agents/internal-gateway),
Codex traffic goes through it too. Codex uses the OpenAI SDK, so the gateway path
for Codex is the origin **plus `/v1`** — this is derived automatically from your
single gateway endpoint; you don't configure it separately. A per-agent key is
only needed if your gateway issues a different key per model family.
