Skip to content

Codex

Codex speaks the OpenAI Responses API. Define a milgram model provider that points at the proxy and carries your Milgram API key as a header, and keep Codex’s own authentication: it is forwarded upstream.

  • Signed in with ChatGPT (codex login, the default): use the proxy’s chatgpt path, as below.
  • Using an OpenAI API key: use https://api.milgram.dev/v1/proxy/openai/v1 as the base_url instead.

Run codex login first, so Codex has a token to forward.

~/.codex/config.toml
model_provider = "milgram"
[model_providers.milgram]
name = "milgram"
# Signed in with ChatGPT (`codex login`):
base_url = "https://api.milgram.dev/v1/proxy/chatgpt"
# With an OpenAI API key instead:
# base_url = "https://api.milgram.dev/v1/proxy/openai/v1"
wire_api = "responses"
# Forward your Codex or ChatGPT token upstream: required behind a proxy.
requires_openai_auth = true
http_headers = { "x-milgram-api-key" = "mlg_YOUR_KEY" }

Start a Codex session and ask for anything. The session appears in the console under Sessions.