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

# OpenAI Codex

> Use Codex through the Onetoken API

## Install

### Official download (macOS)

[https://openai.com/codex/](https://openai.com/codex/)

### CLI

```bash theme={null} theme={null}
npm install -g @openai/codex
```

## Environment / config

### Config files

1. Edit `~/.codex/config.toml`:

```toml theme={null} theme={null}
profile = "OneToken"

[model_providers.OneToken]
name = "OneToken"
base_url = "https://onetoken.one/v1"
personality = "pragmatic"
wire_api = "responses"

[profiles.OneToken]
model = "gpt-5.2"
model_provider = "OneToken"
model_reasoning_effort = "high"
```

2. Edit `~/.codex/auth.json`:

```json theme={null} theme={null}
{
  "OPENAI_API_KEY": "Onetoken_API_KEY"
}
```

### CC-Switch

1. Open CC-Switch → add a provider.

<img src="https://mintcdn.com/onetoken-9a3c590a/Y02IerIYTPVRQQ-L/images/codex/1.png?fit=max&auto=format&n=Y02IerIYTPVRQQ-L&q=85&s=0ff0628862878550bcb8bfd4e6776ad4" alt="Codex 1" width="2072" height="1374" data-path="public/cn/codex-1.png" data-path="images/codex/1.png" />

2. Pick **OneToken** from presets.

<img src="https://mintcdn.com/onetoken-9a3c590a/KFIRj5hibFTyL0AW/images/codex/2.png?fit=max&auto=format&n=KFIRj5hibFTyL0AW&q=85&s=8a9ed5ffe637a6634c4ec446bab5c659" alt="Codex 2" width="2072" height="1374" data-path="public/cn/codex-2.png" data-path="images/codex/2.png" />

3. Paste your API key → **Add**.

<img src="https://mintcdn.com/onetoken-9a3c590a/Y02IerIYTPVRQQ-L/images/codex/3.png?fit=max&auto=format&n=Y02IerIYTPVRQQ-L&q=85&s=3491c2f646547129997820b99eb3ba5a" alt="Codex 3" width="2072" height="1374" data-path="public/cn/codex-3.png" data-path="images/codex/3.png" />

4. Select **OneToken** on the home screen → **Enable**.

<img src="https://mintcdn.com/onetoken-9a3c590a/Y02IerIYTPVRQQ-L/images/codex/4.png?fit=max&auto=format&n=Y02IerIYTPVRQQ-L&q=85&s=a11fb916d3ffbee83bdd61af5085c356" alt="Codex 4" width="2072" height="1374" data-path="public/cn/codex-4.png" data-path="images/codex/4.png" />

## Using Codex

### Terminal

1. `cd` to your project, run `codex`.

```bash theme={null} theme={null}
cd /path/to/your/project
codex
```

2. Set permissions as prompted.

<img src="https://mintcdn.com/onetoken-9a3c590a/Y02IerIYTPVRQQ-L/images/OpenAICodex/1.webp?fit=max&auto=format&n=Y02IerIYTPVRQQ-L&q=85&s=5ea7d0b0657c60dda83f3f0c6826f49d" alt="Codex 5" width="1212" height="814" data-path="public/cn/codex-5.png" data-path="images/OpenAICodex/1.webp" />

3. Choose a model.

<img src="https://mintcdn.com/onetoken-9a3c590a/Y02IerIYTPVRQQ-L/images/OpenAICodex/2.webp?fit=max&auto=format&n=Y02IerIYTPVRQQ-L&q=85&s=44d2ea1873a857af6ddd2f3c1fd865a4" alt="Codex 6" width="1212" height="814" data-path="public/cn/codex-6.png" data-path="images/OpenAICodex/2.webp" />

4. Type a natural-language task—if you get a reply, setup works.

<img src="https://mintcdn.com/onetoken-9a3c590a/Y02IerIYTPVRQQ-L/images/OpenAICodex/3.webp?fit=max&auto=format&n=Y02IerIYTPVRQQ-L&q=85&s=b0b53193ead2fbf1485ea15cb349020a" alt="Codex 8" width="1212" height="814" data-path="public/cn/codex-8.png" data-path="images/OpenAICodex/3.webp" />

### Desktop app

1. Open Codex, pick a workspace folder.
2. Enter a task—if it responds, you’re good.

<img src="https://mintcdn.com/onetoken-9a3c590a/Y02IerIYTPVRQQ-L/images/OpenAICodex/4.webp?fit=max&auto=format&n=Y02IerIYTPVRQQ-L&q=85&s=d514c3da1c1338752d85cbe8e429c3bc" alt="Codex 9" width="2632" height="1712" data-path="public/cn/codex-9.png" data-path="images/OpenAICodex/4.webp" />

## CLI reference

### Help

```bash theme={null} theme={null}
codex -h
```

### Options (excerpt)

```bash theme={null} theme={null}
Usage
  $ codex [options] <prompt>

Options
  -h, --help                 Show help and exit
  -m, --model <model>        Model to use (default: codex-mini-latest)
  -i, --image <path>         Path to an image input file
  -v, --view <rollout>       Inspect a saved rollout
  -q, --quiet                Non-interactive: print only final assistant output
  -a, --approval-mode <mode>  Override approval: 'suggest', 'auto-edit', or 'full-auto'

  --auto-edit                Auto-approve file edits; still confirm shell commands
  --full-auto                Auto-approve edits and commands in the sandbox

  --no-project-doc           Do not auto-include repo `codex.md`
  --project-doc <file>       Include a specific Markdown file as context
  --full-stdout              Do not truncate command stdout/stderr

Dangerous
  --dangerously-auto-approve-everything
                             Skip all confirmations and run commands (no sandbox)
                             For temporary local testing only

Experimental
  -f, --full-context         “Full context” mode: load the whole repo and batch-edit
                             Requires --model

Examples
  $ codex "Write and run a Python program that prints ASCII art"
  $ codex -q "Fix the build"
```
