Available Models

Model Context Images Tools Price (1M tokens)
GPT-5.2
Latest flagship model with advanced capabilities
128K ✓ ✓ $5 / $15
GPT-4 Turbo
Fast, capable model for most tasks
128K ✓ ✓ $10 / $30

Authentication

API KEY

Standard API key authentication

Environment Variable: OPENAI_API_KEY

Setup Steps:

  1. Create an account at platform.openai.com
  2. Navigate to API Keys section
  3. Generate a new API key
  4. Set OPENAI_API_KEY environment variable

OAUTH

OAuth for ChatGPT/Codex subscriptions

Setup Steps:

  1. Run openclaw onboard
  2. Select OpenAI OAuth
  3. Complete browser-based login

Configuration Example

{
  "models": {
    "providers": {
      "openai-codex": {
        "apiKey": "${OPENAI_API_KEY}"
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "openai-codex/gpt-5.2"
      }
    }
  }
}

Use OpenAI Codex with Messaging Channels

Connect OpenAI Codex to your favorite messaging platforms:

Frequently Asked Questions

How much does OpenAI Codex cost with OpenClaw?
OpenAI Codex pricing depends on your usage. OpenAI Codex charges based on tokens processed. OpenClaw itself is free and open source. You only pay for the AI provider API costs.
How do I authenticate OpenAI Codex with OpenClaw?
OpenAI Codex supports api_key, oauth. The most common method is using an API key which you can get from the OpenAI Codex console.
Which OpenAI Codex models work with OpenClaw?
OpenClaw supports all OpenAI Codex models including GPT-5.2, GPT-4 Turbo. You can configure your preferred model in openclaw.json or use model aliases for convenience.
Can I use OpenAI Codex as a fallback provider?
Yes, OpenClaw supports automatic failover. You can configure OpenAI Codex as a fallback in the model configuration. If your primary provider fails, OpenClaw will automatically switch to OpenAI Codex.