# Codex (/docs/proxy/integrations/codex)



Codex appends `/responses` to the base URL, so the value must end in `/v1`,
which the OpenAI form of the proxy URL does.

```bash
export OPENAI_BASE_URL="https://proxy.tawaguard.com/<token>/openai/v1"
export OPENAI_API_KEY="<your OpenAI key>"
codex
```

Replace `<token>` with your [proxy token](/docs/proxy/quickstart).

## Custom provider in config.toml [#custom-provider-in-configtoml]

If your Codex version does not use `OPENAI_BASE_URL`, define a custom provider in
`config.toml`. The file then contains the token, so keep it out of version
control.

```toml
model_provider = "tawa"

[model_providers.tawa]
name = "Tawa Guard proxy"
base_url = "https://proxy.tawaguard.com/<token>/openai/v1"
wire_api = "responses"
env_key = "OPENAI_API_KEY"
requires_openai_auth = false
supports_websockets = false
```

## What to know [#what-to-know]

* Use an OpenAI API key. The OpenAI entry forwards only to `api.openai.com`. Codex signed in with ChatGPT sent requests to a different backend in the version tested (`codex-cli 0.167.0-alpha.3.2`), so those requests cannot go through the proxy.
* Keep `supports_websockets = false`. The proxy handles HTTP and server-sent events.
* The API-key path with a live OpenAI key was not tested.

<Callout type="warn">
  This setup was not run end to end against the hosted proxy. Check a request in
  Monitoring before you rely on it.
</Callout>
