# Codex CLI

Run Codex CLI on Boundless models: install, the config.toml provider on the Responses API, a verify command and common errors.


Codex CLI reaches Boundless through a custom provider in `~/.codex/config.toml`. Codex is built for OpenAI's models. It only accepts a custom provider that speaks the Responses API, so every request is translated on the way through; streamed tool calls are the first thing to look uneven if you change the model.

## Install

Install Codex CLI from its own documentation first. Then pick one way to point it at Boundless.

Run this in a terminal on macOS or Linux and choose **Codex CLI**:

```bash
curl -fsSL https://boundless.md/install | sh
```

Or run the package yourself, which also works on Windows:

```bash
npx -y @boundless.md/setup@latest
```

Setup signs you in through your browser, creates a key on your account and backs up every file it changes. To undo it, run `curl -fsSL https://boundless.md/install | sh -s -- --revert`. Need a key to configure by hand? Create one in [API Keys](https://inference.boundless.network/settings/api-keys). Setup also writes the key to Codex's own `.env` file, because desktop apps and background services never read a shell profile.

## Configure

### Codex CLI

Add to `~/.codex/config.toml`. Codex requires custom providers to use the Responses wire API:

```toml
model = "deepseek/deepseek-v4.1-flash"
model_provider = "boundless"
model_reasoning_effort = "low"
model_reasoning_summary = "none"

[model_providers.boundless]
name = "Boundless"
base_url = "https://api.inference.boundless.network/v1"
env_key = "BOUNDLESS_API_KEY"
wire_api = "responses"
```

```bash
export BOUNDLESS_API_KEY="YOUR_API_KEY"
codex
```

Codex compacts locally, so the provider does not need `/v1/responses/compact`.

## Model ids

The examples use `deepseek/deepseek-v4.1-flash`. Use any id from `GET https://api.inference.boundless.network/v1/models`; the [models page](https://inference.boundless.network/models) lists each one with its price and limits.

## Verify

Run the export and `codex` commands from the setup above, then send a short message and check that a reply comes back.

To check the base URL and key on their own, list the models the gateway serves. A list of models means both are right. A `401` means the key is missing or wrong:

```bash
curl https://api.inference.boundless.network/v1/models -H "Authorization: Bearer YOUR_API_KEY"
```

## Common errors

| What you see | What it usually is |
| --- | --- |
| `401` on every request | `BOUNDLESS_API_KEY` is not set in the shell that started Codex. |
| An error naming a model you never chose | The harness is sending its default. Set the model explicitly, including any small or background slot. |
| `403` with `model_not_allowed` | Your team admin has not enabled that model for you. Ask them, or pick another. See [Model access](https://inference.boundless.network/docs/teams#model-access). |

Every status and code is on the [Errors](https://inference.boundless.network/docs/errors) page. Other harnesses are on the [Coding Agents & Harnesses](https://inference.boundless.network/docs/coding-agents-and-harnesses) page.
