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

# OpenAI Codex

> Use Codex through the Tokensmind 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 = "Tokensmind"

[model_providers.Tokensmind]
name = "Tokensmind"
base_url = "https://tokensmind.ai/v1"
personality = "pragmatic"
wire_api = "responses"

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

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

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

### CC-Switch

1. Open CC-Switch → add a provider.

<img src="https://mintcdn.com/sadfkkl/Mx1P8tz6gbwIRQ-D/images/codex/1.png?fit=max&auto=format&n=Mx1P8tz6gbwIRQ-D&q=85&s=faf29a1ec27d6257ec49482137b29261" alt="Codex 1" width="2072" height="1374" data-path="public/cn/codex-1.png" data-path="images/codex/1.png" />

2. Pick **Tokensmind** from presets.

<img src="https://mintcdn.com/sadfkkl/Mx1P8tz6gbwIRQ-D/images/codex/2_en.png?fit=max&auto=format&n=Mx1P8tz6gbwIRQ-D&q=85&s=6a0ab664dad6e344b29e7c2038101756" alt="Codex 2" width="2072" height="1374" data-path="public/cn/codex-2.png" data-path="images/codex/2_en.png" />

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

<img src="https://mintcdn.com/sadfkkl/Mx1P8tz6gbwIRQ-D/images/codex/3_en.png?fit=max&auto=format&n=Mx1P8tz6gbwIRQ-D&q=85&s=be564a570fd56752519c4bda67f7e661" alt="Codex 3" width="2072" height="1374" data-path="public/cn/codex-3.png" data-path="images/codex/3_en.png" />

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

<img src="https://mintcdn.com/sadfkkl/Mx1P8tz6gbwIRQ-D/images/codex/4.png?fit=max&auto=format&n=Mx1P8tz6gbwIRQ-D&q=85&s=9aabe95d494479ed559cffd8567e0051" 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/aihubmix/7hQ6_nS3fMExXVXm/public/cn/codex-5.png?fit=max&auto=format&n=7hQ6_nS3fMExXVXm&q=85&s=ae7c5f193d3aa5c8723c879840732d78" alt="Codex 5" width="1212" height="814" data-path="public/cn/codex-5.png" />

3. Choose a model.

<img src="https://mintcdn.com/aihubmix/7hQ6_nS3fMExXVXm/public/cn/codex-6.png?fit=max&auto=format&n=7hQ6_nS3fMExXVXm&q=85&s=f942ebc707063463a3961347f8379553" alt="Codex 6" width="1212" height="814" data-path="public/cn/codex-6.png" />

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

<img src="https://mintcdn.com/aihubmix/7hQ6_nS3fMExXVXm/public/cn/codex-8.png?fit=max&auto=format&n=7hQ6_nS3fMExXVXm&q=85&s=bf06aaa8c86834b20e5fef26fba84d50" alt="Codex 8" width="1212" height="814" data-path="public/cn/codex-8.png" />

### Desktop app

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

<img src="https://mintcdn.com/aihubmix/7hQ6_nS3fMExXVXm/public/cn/codex-9.png?fit=max&auto=format&n=7hQ6_nS3fMExXVXm&q=85&s=673289a767cd354a686d1e547a364e0d" alt="Codex 9" width="2632" height="1712" data-path="public/cn/codex-9.png" />

## 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"
```
