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’schatgptpath, as below. - Using an OpenAI API key: use
https://api.milgram.dev/v1/proxy/openai/v1as thebase_urlinstead.
Run codex login first, so Codex has a token to forward.
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 = truehttp_headers = { "x-milgram-api-key" = "mlg_YOUR_KEY" }The same settings inline, for a single run. Your config.toml stays untouched.
codex \ -c 'model_providers.milgram={ name = "milgram", base_url = "https://api.milgram.dev/v1/proxy/chatgpt", wire_api = "responses", requires_openai_auth = true, http_headers = { "x-milgram-api-key" = "mlg_YOUR_KEY" } }' \ -c 'model_provider="milgram"'Check it
Section titled “Check it”Start a Codex session and ask for anything. The session appears in the console under Sessions.