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

# Codex CLI

Codex CLI is OpenAI's coding agent for the terminal.

Install [Node.js 18 or later](https://nodejs.org/en/download/) before you begin.

Install Codex CLI:

```bash theme={null}
npm install -g @openai/codex  # Alternatively: `brew install codex`
```

Open the local Codex configuration file to set up GeekAI as the model provider:

```bash theme={null}
vim ~/.codex/config.toml
```

Add the following TOML configuration:

```toml theme={null}
# Default model; use a GeekAI chat model ID
model = "gpt-5.3-codex"
# Default model provider
model_provider = "geekai"

# Model provider settings
[model_providers.geekai]
# Provider name shown in the Codex interface
name = "GeekAI"

# If reachable, the international endpoint is https://geekai.dev/api/v1
base_url = "https://geekai.co/api/v1"
# Environment variable used for API authentication
env_key = "GEEKAI_API_KEY"
# Supported wire protocols: "chat" (default if omitted) and "responses"
wire_api = "responses"
```

> [!NOTE]
>
> With `model` set to `gpt-5.3-codex`, you must set `wire_api` to `responses`: GPT-5.3-Codex only supports the Responses API.

Set `env_key` to `GEEKAI_API_KEY`, the name of the environment variable Codex will read. **Do not put your actual API key in this field.**

Save the configuration file, then set the key in your shell:

```bash theme={null}
export GEEKAI_API_KEY="<YOUR_GEEKAI_API_KEY>"
```

> `export` only affects the current shell session. To persist these settings, add the commands to `~/.bashrc` or `~/.zshrc`, then run `source ~/.bashrc` or `source ~/.zshrc`.

Replace `<YOUR_GEEKAI_API_KEY>` with your [GeekAI API key](https://geekai.co/user/api_keys). If you use the international base URL, obtain a key from [GeekAI International](https://geekai.dev/user/api_keys).

The default balanced route is suitable for individual developers. For larger projects or faster, more stable responses, edit your key on the [API Keys page](https://geekai.co/user/api_keys) and select the high-availability route.

![Changing the API key route](https://static.geekai.co/storage/2025/07/26/image-20250726123753201.png)

If cost matters more than availability, choose the low-cost route instead.

Start Codex CLI in the terminal:

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

![First launch of Codex CLI](https://static.geekai.co/storage/2025/07/26/image-20250726130308039.png)

No further configuration is needed. Ask Codex for code suggestions or help with a programming problem:

![Coding with Codex CLI through GeekAI](https://static.geekai.co/storage/2025/07/26/image-20250726130640193.png)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.