> For the complete documentation index, see [llms.txt](https://docs.fritesai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fritesai.com/getting-started/configure-codex.md).

# Configure Codex

To route Codex through the frites gateway, register frites as a model provider in `~/.codex/config.toml` and select it. frites impersonates the provider endpoint, so Codex talks to the local gateway as it would to a normal provider.

## Settings

Add the following to `~/.codex/config.toml`:

```toml
model_provider = "frites"
[model_providers.frites]
base_url = "http://127.0.0.1:6767/v1"
wire_api = "responses"
env_key = "FRITES_KEY"
```

Then export the key Codex will send:

```bash
export FRITES_KEY=frites
```

* **`base_url`**: the gateway's `/v1` base. Use `http://127.0.0.1:6767/v1` for the default port; if you installed on a different port (`frites install --port 7000`), use that port.
* **`wire_api = "responses"`**: Codex talks to the gateway over the `/v1/responses` surface.
* **`env_key = "FRITES_KEY"`**: names the environment variable Codex reads to obtain the auth token it sends.

## FRITES\_KEY is read by Codex, not by frites

`FRITES_KEY` is consumed by **Codex** because you named it in `env_key`; frites itself does not read it. It is simply the token Codex presents to the gateway. The gateway binds to `127.0.0.1` only and does not validate it against an upstream account. Child agents authenticate with the accounts you are already logged into (see [auth and billing](/product/auth-and-billing.md)). For the full list of variables that frites itself reads, see [environment variables](/reference/environment-variables.md).

## Next steps

* [First run](/getting-started/first-run.md): confirm the gateway is reachable and watch the council work.
* [Configure Claude Code](/getting-started/configure-claude-code.md): if you also use Claude Code.
* [Service management](/getting-started/service-management.md): managing the always-on gateway.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fritesai.com/getting-started/configure-codex.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
