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

# Codex

> Configure a Codex provider, authorize local ~/.codex/, and add custom models and environment variables.

Codex uses `@openai/codex-sdk`. Config is written to `~/.codex/`. You can also authorize reading local files you already have.

Install the Codex SDK in **Settings → SDK dependencies** first. If the install is incomplete (CLI integrity is missing), the status stays uninstalled.

<img src="https://mintcdn.com/mossx-docs/kz4nt5KFSKzkAZwe/images/jetbrains/provider-codex.png?fit=max&auto=format&n=kz4nt5KFSKzkAZwe&q=85&s=42e82b5edf5481f5fbe9972e8de2bec0" alt="Codex provider page" width="100%" data-path="images/jetbrains/provider-codex.png" />

## How to connect

### Add a provider

Click **Add provider** and enter a name plus config JSON. The UI edits two blocks:

* **config**: `model_provider`, `model`, `model_providers`, and similar
* **auth**: auth fields such as `OPENAI_API_KEY`

You can also pick official OpenAI direct access, or a third-party / proxy preset. Official direct access uses `https://api.openai.com`.

Saving writes to `~/.codex/` immediately.

### Authorize local config

If you already use the Codex CLI in a terminal:

1. Run `codex login` in a terminal and confirm you can ask a question
2. In CC GUI, authorize reading `~/.codex/config.toml` and `auth.json`
3. Restart the IDE

Authorization is read-only and does not overwrite those two files. You can revoke it at any time.

## Custom models and environment variables

Each Codex provider can add models:

* Model ID is required
* Display name and description are optional
* You can set a context window separately (unit: K tokens)

You can also add environment variables for the chat process and the MCP tool-discovery process separately. Built-in protected variables cannot be overridden.

## Differences from Claude

| Capability            | Codex                                                          |
| --------------------- | -------------------------------------------------------------- |
| Plan mode             | No                                                             |
| Permissions / sandbox | Set separately in **Settings → Permissions**                   |
| Fast mode             | Switch at the bottom of the input box                          |
| Abort a request       | Quiet interrupt. No ERROR bubble                               |
| Skills                | Supports Codex Skills (`$` prefix)                             |
| MCP                   | Shown separately from Claude. They do not overwrite each other |

## Usage stats

After you add input / output / cache prices on a model, **Settings → Usage stats** can estimate cost.

## Next steps

* [Provider overview](/en/jetbrains/providers/overview)
* [Detect and install](/en/jetbrains/providers/cli)
* [Send the first message](/en/jetbrains/start/first-task)
