Codex CLI Quickstart

5-minute setup: route OpenAI Codex CLI (gpt-5.3-codex) through CodeGateway — install, configure base_url, verify, start coding.

This tutorial walks through using Codex CLI with CodeGateway as the proxy for the GPT-5.3 Codex model. Codex CLI is OpenAI's command-line coding assistant; it speaks the OpenAI Responses API, which CodeGateway forwards via /v1/responses.

1. Prerequisites

Sign up for CodeGateway (get $2 of free credit) and generate an API key in the Dashboard. Codex CLI needs Node.js 18+.

2. Install Codex CLI

bash
npm install -g @openai/codex

3. Configure Environment

Codex CLI reads OPENAI_BASE_URL and OPENAI_API_KEY. Point base_url at CodeGateway:

bash
export OPENAI_BASE_URL="https://api.codegateway.dev/v1"
export OPENAI_API_KEY="<your CodeGateway API key>"

4. Verify the connection

This should return the model catalog (including gpt-5.3-codex):

bash
curl https://api.codegateway.dev/v1/models \
  -H "Authorization: Bearer $OPENAI_API_KEY"

5. Get Coding

Run codex from any project directory. Every request flows through CodeGateway's edge nodes and is billed per-token with our tiered markup (see /pricing).

bash
codex "Add a TypeScript function that returns Hello World under src/"
AuthorCodeGateway TeamReviewed on2026-05-07