How to Set Up OpenAI OAuth & Select Models in OpenClaw
Rajen Sikder

TLDR
Running OpenClaw with direct OpenAI API keys can easily cost $100+ a month in pay-per-token fees. By authenticating via OAuth instead, you can connect your standard ChatGPT account directly to OpenClaw and run local agent workflows without metered API billing. Just run openclaw models auth login --provider openai, authenticate in your browser, pick your model with openclaw models set openai/gpt-5.5, and you are ready to go.
Why Switch from API Keys to OpenAI OAuth?
When running heavy autonomous agent workflows, long reasoning sessions, or continuous background tasks in OpenClaw, usage costs can ramp up fast. Direct pay-per-token API billing can quickly become expensive, especially when running multi-turn loops where full conversation histories are re-sent on every step.
Setting up OpenAI authentication in OpenClaw does not require burning through API credits. By utilizing OAuth (Subscription / Account Auth), you do not even need a paid plan: it works with the standard free ChatGPT account. OpenClaw links directly to your OpenAI account, allowing your local agents to leverage OpenAI without pay-per-token API charges.
Personal Experience: I used to spend around $100 every month on average just on API credits for my agent workflows. Switching OpenClaw over to authentication saved me that entire $100 monthly bill while keeping my local automation running continuously.
Here is a quick, step by step guide to authenticating OpenAI, discovering available models, and configuring your active primary model.
Step 1: Authenticate via OAuth
To start the login process, run the auth login command for OpenAI in your terminal:
Bash
openclaw models auth login --provider openaiWhat happens next:
OpenClaw generates an authentication link or device code in your terminal.
Copy and paste the link into your browser, log into your OpenAI account (free or paid), and grant authorization.
OpenClaw stores the token securely in its local database for your agent.
Terminal Tip: When copying links or pasting authentication codes inside Linux or VPS terminal environments, remember to use
Ctrl + Shift + Vto paste instead of standardCtrl + V.
Managing Multiple Accounts: If you maintain separate personal and work OpenAI accounts, save them with custom profile IDs:
openclaw models auth login --provider openai --profile-id openai:work
Step 2: Discover Available Models
Once logged in, check which models your account grants access to.
Option A: List models registered in your local catalog
Bash
openclaw models list --provider openaiOption B: Perform a live probe against the OpenAI API
To verify active credentials and check token limits or live model access in real time:
Bash
openclaw models status --probeStep 3: Set Your Active Model
Select the primary OpenAI model you want OpenClaw to run:
openclaw models set openai/gpt-5.5If you prefer a lighter, faster option for routine tasks, switch to the mini tier:
openclaw models set openai/gpt-5.4-miniConfirm the active model:
openclaw models statusYour selected model will now be highlighted as the active primary engine for OpenClaw.
Summary of Commands
# 1. Initiate OAuth login
openclaw models auth login --provider openai
# 2. Check available models
openclaw models list --provider openai
# 3. Set your active primary model
openclaw models set openai/gpt-5.5
# 4. Verify configuration
openclaw models statusClaim 80% Off Your OpenClaw Setup
Get instant access to managed OpenClaw hosting and agent automation. Enjoy 80% off on all OpenClaw managed hosting plans—use coupon code OC80 at checkout to save on your first month.
Claim 80% Discount