Home / Agents / OpenAI Codex CLI

OpenAI Codex CLI

OpenAI's local coding agent

OpenAI OpenAI-compatible macOSLinuxWindows

Codex CLI is OpenAI's local coding agent that reads code, edits files, and runs commands in your terminal. It fits engineers already in the OpenAI ecosystem or pointing at their own OpenAI-compatible gateway. A custom provider in config.toml routes it to any OpenAI-compatible endpoint.

Base URL (root)https://quantoport.comPut this in each tool's base_url or *_BASE_URL setting.
OpenAI-compatible pathhttps://quantoport.com/v1Append /v1 for anything speaking the OpenAI wire (/v1/chat/completions).
Recommended modelsgpt-5.6-solgpt-5.5gpt-5.3-codex-sparkNames published in our own catalogue — confirm the live list for your key with GET /v1/models.

Skip it — one-line setup

The script installs OpenAI Codex CLI from its official source, writes the gateway settings into the tool's own config file (backing up any existing one) and runs a live check. It asks for your gateway key, or take it from --key / --key-file. --uninstall restores exactly what it wrote.

shell
curl -fsSL https://quantoport.com/agents/codex/setup | bash

1 · Install

Install OpenAI Codex CLI from its own official source.

install
npm install -g @openai/codex
# or Homebrew:
brew install --cask codex
# or the official script:
curl -fsSL https://chatgpt.com/codex/install.sh | sh

2 · Configure — point it at QuantoPort

Gateway base URL https://quantoport.com; get your key from the console.

config
International site https://quantoport.com (native /v1/responses):
1) Edit ~/.codex/config.toml:
   model = "gpt-5.6-sol"
   model_provider = "quantoport"

   [model_providers.quantoport]
   name = "QuantoPort"
   base_url = "https://quantoport.com/v1"
   env_key = "QUANTOPORT_API_KEY"
   wire_api = "responses"
2) Export the key: export QUANTOPORT_API_KEY=<your gateway key>
3) Run codex.
Note: Codex 0.153+ only accepts wire_api = "responses" (the old "chat" value errors out). The CN site https://api.shinlinkai.com serves only /v1/chat/completions, not /v1/responses, so use the international site for Codex.

3 · Verify

One request proves you are on our channel.

verify
codex exec "say hi"
# or run codex and type a prompt; a normal reply means the connection works.

4 · Common pitfalls

  • wire_api must be "responses": Codex 0.153+ no longer supports "chat" and only speaks /v1/responses. The international site https://quantoport.com serves /v1/responses; the CN site currently serves only /v1/chat/completions, so use the international site for Codex.
  • env_key is just an environment-variable name; you can name it anything.
  • Custom providers cannot reuse the reserved ids: openai, ollama, lmstudio.
  • A project-level .codex/config.toml loads only when that directory is trusted.

Sources for the tool-side steps: github.com/openai/codex developers.openai.com/codex/config-advanced developers.openai.com/codex/config-reference