Skip to content

openai codex

  • In 2026, OpenAI launched its coding software

Installation

  • Prerequisite: install Node.js ≥ 18 (LTS version recommended)
shell
npm install -g @openai/codex
codex --version # Expected output similar to: codex-cli 0.121.0
npm install -g @openai/codex
codex --version # Expected output similar to: codex-cli 0.121.0

Configure Environment with cc switch

  • Use cc switch to configure the environment for the codex CLI tool

  • Download cc-switch

  • macOS download Windows download

  • Add a new provider Add provider

  • Add a unified provider Add provider

  • Fill in the unified provider details

    • Name is openai-hk
    • API URL is https://api.openai-hk.com
    • apiKey is hk-your-apiKey — get this key at https://www.openai-hk.com/v3/ai/key
    • Sub-keys can be created under the codex group; the exchange rate is 0.5, which is 0.072 of the official price (0.5/7) Add provider
    • Enable claude code openai codex gemini CLIAdd provider
    • Configure models as shown below Add provider
    • Click Add
  • Sync

    • Go back to Add New Provider and you will see openai-hkAdd provider
    • Find "Sync to App" Add provider
    • Select Sync Add provider
  • Enable

    • Return to the main screen, find codex -> openai-hk and click Enable Enable

Running the App

  • Command line
shell
codex
codex

codex

  • VS Code extension

codex