Home

Switch language

Start Install GuideQuick StartDocs Overview
Docs ChannelsModels & APIGateway OpsTools & Skills
More ArticlesResourcesHelp Center
Get Started
Documentation navigation Providers
Providers 2 sections

OpenAI / Codex

OpenAI

OpenAI has two main paths inside OpenClaw: standard OpenAI Platform API keys and the subscription-style OpenAI Code / Codex route. The first is a normal API integration; the second is built around OAuth and subscription reuse.

Two Access Paths

API Key

OpenAI Platform

The standard API path for usage-based billing, servers and explicit key management.

OAuth / Subscription

OpenAI Code (Codex)

A good fit when you want to reuse ChatGPT or Codex subscription auth, especially for cloud Codex capabilities.

Common Setup Paths

API key

openclaw onboard --auth-choice openai-api-key
openclaw onboard --openai-api-key "$OPENAI_API_KEY"

Codex OAuth

openclaw onboard --auth-choice openai-codex
openclaw models auth login --provider openai-codex

Default model snippet

{
  agents: {
    defaults: {
      model: { primary: "openai/gpt-5.2" }
    }
  }
}