OpenAI (GPT) with OpenClaw
Configure GPT-4, GPT-3.5, and Codex — OAuth or API key
Configure GPT-4, GPT-3.5, and Codex — OAuth or API key
OpenAI's GPT models are supported in OpenClaw for chat, code generation, and general-purpose tasks. OpenClaw integrates with ChatGPT Plus via OAuth (subscription) or with API keys for pay-as-you-go and team usage. Models include GPT-4, GPT-3.5, and Codex (including gpt-5.3-codex for advanced code generation).
gpt-5.3-codex)Configure model in your Gateway config, e.g. openai/gpt-4. Use tiered routing: reserve GPT-4 for important work; use GPT-3.5 for heartbeats and background tasks. See Example setups & model routing.
OAuth (subscription): If you have ChatGPT Plus, you can authenticate with your subscription—no API key. Uses your subscription limits. Set up during openclaw onboard or in the Setup Wizard.
API key: Create an API key at platform.openai.com. Use for pay-as-you-go or when you prefer key-based auth. Store in ~/.openclaw/credentials or via openclaw secrets.
For OpenAI Codex routes (e.g. openai-codex/*), you can authenticate with the built-in provider flow:
openclaw models auth login --provider openai-codex
Tokens live under your agent auth profiles (see official OAuth docs). Step-by-step walkthrough: Codex OAuth tutorial. If openclaw doctor --fix on an older release rewrote Codex routes, use upstream Codex OAuth recovery. Coding-agent comparison: OpenClaw vs Claude Code.
{
"agent": {
"model": "openai/gpt-4"
}
}
Authentication is configured during onboarding or via credentials. See Configuration guide for full options.