ModelsPricingTutorialsBlogFAQ
Home/Tutorials/Codex API
Tutorial · Codex

Connect the OpenAI Codex CLI

The Codex CLI is OpenAI-style compatible. Point OPENAI_BASE_URL at LowCostAI.

Connect in three steps

The Codex CLI reads the endpoint and credentials from env vars.

Step 1
Create an API key

Create a key.

Step 2
Set env vars

Export OPENAI_BASE_URL and OPENAI_API_KEY.

Step 3
Run Codex

Run codex in your project.

Configuration

export OPENAI_BASE_URL="https://api.lowcostaiapi.com/v1"
export OPENAI_API_KEY="YOUR_TOKEN"

codex "add unit tests for utils.py"

Use a model name from the Models page.