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

# Codex

Codex is OpenAI's AI coding assistant, available as a command-line tool and as a VS Code extension. You can connect Codex to the ScitiX Model Inference API and use ScitiX models for coding tasks. Both the CLI and the extension share the same `config.toml`.

Configuration is stored in `config.toml` in your Codex home directory, typically `~/.codex/config.toml`. For the full list of options, see the [Codex Configuration Reference](https://developers.openai.com/codex/config-reference).

Supported models include `glm-5.2` and `kimi-k2.6`. For model pricing, see the [model catalog](https://console.scitix.ai/model-inference/models).

## Configure

### 1. Install Codex

For the CLI, install Codex with npm or Homebrew:

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

For other installation options, see the [official installation guide](https://github.com/openai/codex#installation).

For the VS Code extension:

1. Open **Extensions** in VS Code (`Ctrl+Shift+X` / `Cmd+Shift+X`).
2. Search for **Codex** and install the official extension.
3. Click the Codex icon in the top-right of the editor to open the **CODEX** panel.

<img src="https://mintcdn.com/scitix-adfc65c2/zz3UuyM3SCvVbeP9/model-inference/media/codex-ext.png?fit=max&auto=format&n=zz3UuyM3SCvVbeP9&q=85&s=95cab0d847ce91661a415f4213dfff46" alt="Codex extension marketplace page" style={{ width: "60%", height: "auto" }} width="1778" height="1210" data-path="model-inference/media/codex-ext.png" />

### 2. Configure the model

Create an API Key on the [API Keys](https://console.scitix.ai/model-inference/api_keys) page, then provide it in one of two ways.

<Warning>
  Keep `SCITIX_API_KEY` and other secrets out of Git. Use environment variables or a local `.env` file ignored by version control.
</Warning>

#### Option 1: Use an environment variable

Edit `~/.codex/config.toml` with `env_key` pointing to an environment variable:

```toml theme={null}
model = "glm-5.2"
model_provider = "scitix"
approval_policy = "never"
sandbox_mode = "workspace-write"

[model_providers.scitix]
name = "ScitiX"
base_url = "https://api.scitix.ai/model-api"
env_key = "SCITIX_API_KEY"
wire_api = "responses"
```

Set the key before launching Codex:

```bash theme={null}
export SCITIX_API_KEY="<Your API Key>"
code .
```

#### Option 2: Store the token in `config.toml`

If you do not want to use an environment variable, put the key directly in `config.toml` with `experimental_bearer_token` instead of `env_key`.

```toml theme={null}
model = "glm-5.2"
model_provider = "scitix"
approval_policy = "never"
sandbox_mode = "workspace-write"
model_reasoning_effort = "medium"

[model_providers.scitix]
name = "ScitiX"
base_url = "https://api.scitix.ai/model-api"
experimental_bearer_token = "<API_KEY>"
wire_api = "responses"
```

Because the key is stored in the file, keep `config.toml` out of version control.

Either way, the configured model becomes available in Codex.

<img src="https://mintcdn.com/scitix-adfc65c2/zz3UuyM3SCvVbeP9/model-inference/media/codex-open-source.png?fit=max&auto=format&n=zz3UuyM3SCvVbeP9&q=85&s=d9ae94cf451b5bb1b40a4b159125e195" alt="Codex — model config" width="2990" height="1772" data-path="model-inference/media/codex-open-source.png" />

#### Field Reference

| Field                       | Description                                                                                             |
| --------------------------- | ------------------------------------------------------------------------------------------------------- |
| `model`                     | Model ID from the [model catalog](https://console.scitix.ai/model-inference/models), such as `glm-5.2`. |
| `model_provider`            | Must match the `[model_providers.<name>]` section. Use `scitix`.                                        |
| `approval_policy`           | `never` for no approval prompts; `on-request` or `untrusted` for more control.                          |
| `sandbox_mode`              | `workspace-write` to read and edit within the workspace; `read-only` for read-only access.              |
| `base_url`                  | ScitiX Model Inference API endpoint: `https://api.scitix.ai/model-api`.                                 |
| `wire_api`                  | Use `responses` for the latest Codex version.                                                           |
| `env_key`                   | Option 1. Environment variable that holds your API Key, such as `SCITIX_API_KEY`.                       |
| `experimental_bearer_token` | Option 2. Your ScitiX API Key embedded directly instead of via `env_key`.                               |
| `model_reasoning_effort`    | Reasoning depth for the model, such as `low`, `medium`, or `high`.                                      |

## MCP Servers

Some built-in tool types, such as `web_search`, may not be available on these models. You can add these capabilities through MCP (Model Context Protocol) servers.

Configure a search MCP server in `config.toml` under `[mcp_servers.<name>]`, and Codex will call it when web search is needed. See the [Codex Configuration Reference](https://developers.openai.com/codex/config-reference) for MCP server setup details.
