OpenAI Integration

Integrate OpenAI GPT-4o, o1, o3, and GPT-4.1 models with OpenClaw.

Overview

OpenAI provides the most widely used AI models. OpenClaw supports all OpenAI Chat Completion models.

Available Models

  • GPT-4o — Best for general tasks, fast and capable
  • GPT-4o-mini — Cost-effective for simpler tasks
  • o1 / o3 — Advanced reasoning models
  • GPT-4.1 — Latest generation model

Configuration

{
  "agents": {
    "default": {
      "provider": "openai",
      "model": "gpt-4o"
    }
  }
}

Environment Variables

export OPENAI_API_KEY="sk-..."

Get API Key

  1. Visit platform.openai.com
  2. Navigate to API Keys
  3. Click Create new secret key
  4. Copy and set the key as OPENAI_API_KEY

Next Steps