Skip to content

Codex CLI

The Codex CLI defaults to OpenAI’s Responses API (/v1/responses), which llmprof captures natively - so you just point Codex at the proxy, no wire-protocol changes.

  1. Start the proxy (one instance handles OpenAI and Anthropic):

    Terminal window
    llmprof up
  2. Point Codex at the proxy in ~/.codex/config.toml. Codex ignores the OPENAI_BASE_URL environment variable, so the base URL has to go in the config as a custom provider (the built-in openai provider cannot be overridden):

    model_provider = "llmprof"
    [model_providers.llmprof]
    name = "llmprof"
    base_url = "http://localhost:4000/v1"
    wire_api = "responses"
    env_key = "OPENAI_API_KEY"

    Then run Codex with an OPENAI_API_KEY in the environment (API-key auth, not ChatGPT login - the login flow talks to a backend the proxy does not sit in front of):

    Terminal window
    export OPENAI_API_KEY=sk-...
    codex
  3. Open http://localhost:4000 and watch each Codex request break down by component. The timeline view shows how a coding session’s context grows.