OpenAI (Codex)
Codex is OpenAI's coding agent, built on the GPT model family. If you are already in the OpenAI/ChatGPT ecosystem, Codex is a natural choice for your OpenClaw Host instance.
Step-by-Step Setup
1. Create an OpenAI Account
- Go to platform.openai.com/signup.
- Sign up using email, Google, Microsoft, or Apple account.
- Complete the email verification if you signed up with email.
2. Verify Your Phone Number
- You will be asked to verify a mobile phone number.
- Enter the SMS code you receive.
OpenAI requires a real mobile number. Virtual phone numbers, VoIP services, and some prepaid numbers will be rejected.
3. Add Payment and Buy Credits
- In the OpenAI Platform, go to Settings > Billing.
- Click "Add payment details" and enter your credit card.
- Purchase API credits — the minimum is $5.
OpenAI discontinued free API credits in mid-2025. You must add a payment method and purchase credits before you can use the API.
4. Create an API Key
- Go to API Keys in the left sidebar (or visit platform.openai.com/api-keys).
- Click "+ Create new secret key".
- Give it a name (e.g.,
openclaw-host). - Click Create secret key.
- Copy the key immediately — it is only shown once.
The API key starts with sk-proj- and is only displayed at creation time. If you close the dialog without copying, you will need to generate a new key.
5. Connect to OpenClaw Host
- Open your OpenClaw Dashboard.
- Go to Instance > Integrations tab.
- Find the Codex card and click Connect.
- Paste your API key into the field.
- Click Save.
Your instance will now use OpenAI Codex as its AI provider.
ChatGPT Plus vs API — Important Difference
A ChatGPT Plus or ChatGPT Pro subscription gives you access to chatgpt.com and the ChatGPT app. It does not include API credits.
The OpenAI API has its own separate billing. You need to purchase API credits at platform.openai.com regardless of any ChatGPT subscription you may have.
Think of it like this: ChatGPT Plus is a Netflix subscription, and the API is pay-per-use cloud computing. They are billed independently.
Usage Tiers
OpenAI increases your rate limits based on total spend:
| Tier | Requirement | Monthly Usage Limit |
|---|---|---|
| Tier 1 | $5 paid | $500/month |
| Tier 2 | $50 paid + 7 days | $2,000/month |
| Tier 3 | $100 paid + 7 days | $5,000/month |
| Tier 4 | $250 paid + 14 days | $10,000/month |
| Tier 5 | $1,000 paid + 30 days | $200,000/month |
Tier upgrades happen automatically as you meet the spend and account age requirements.
Optional: Codex CLI
If you want to use OpenAI Codex directly on your local machine (outside of OpenClaw Host), you can install the CLI:
Installation
npm (all platforms, requires Node.js 18+):
npm install -g @openai/codex
macOS (Homebrew):
brew install codex
Windows: Codex CLI runs best under WSL2. Install Node.js in your WSL environment, then use npm:
npm install -g @openai/codex
Authentication
You can authenticate the Codex CLI in two ways:
Option A — ChatGPT login (if you have Plus or Pro):
codex
On first run, it opens a browser-based login flow using your ChatGPT account. This is included with ChatGPT Plus and Pro subscriptions at no extra API cost.
Option B — API key:
export OPENAI_API_KEY="sk-proj-your-key-here"
Execution Modes
Codex CLI has three modes that control how much autonomy it has:
| Mode | Description | Use When |
|---|---|---|
suggest | Suggests changes, asks before applying | You want full control (default) |
auto-edit | Applies file edits automatically, asks before commands | You trust file changes |
full-auto | Runs everything automatically | You trust the agent completely |
The current default model is gpt-5.3-codex.
You do not need to install Codex locally to use it through OpenClaw Host. The CLI section is here for users who also want Codex on their own machine.