Back to API Docs

Codex CLI

OpenAI's Codex CLI via an OpenAI-compatible provider.

Connection

URL cơ sở
https://your-domain.com/v1
Install
npm install -g @openai/codex

Default model

Setup

  1. Install the Codex CLI globally via npm.
  2. Configure your shell environment with the keys.
  3. Save the configuration to ~/.codex/config.toml.
  4. Run `codex` in your project directory.

Cấu hình

Biến môi trường
~/.zshrc
bash
export OPENAI_API_KEY="YOUR_API_KEY"
export OPENAI_BASE_URL="https://your-domain.com/v1"
Provider config
~/.codex/config.toml
toml
model = "gpt-4o-mini"
model_provider = "gateway"

[model_providers.gateway]
name = "API Gateway"
base_url = "https://your-domain.com/v1"
wire_api = "chat"
env_key = "OPENAI_API_KEY"