docs: clarify legacy openai-codex auth (#90028) · openclaw/openclaw@208fec6
jalehman
·
2026-06-04
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,10 +17,18 @@ is now:
|
17 | 17 | told us this usage is allowed again |
18 | 18 | |
19 | 19 | OpenAI Codex OAuth is explicitly supported for use in external tools like |
20 | | -OpenClaw. This page explains: |
| 20 | +OpenClaw. |
| 21 | + |
| 22 | +OpenClaw stores both OpenAI API-key auth and ChatGPT/Codex OAuth under the |
| 23 | +canonical provider id `openai`. Older `openai-codex:*` profile ids and |
| 24 | +`auth.order.openai-codex` entries are legacy state repaired by |
| 25 | +`openclaw doctor --fix`; use `openai:*` profile ids and `auth.order.openai` for |
| 26 | +new config. |
21 | 27 | |
22 | 28 | For Anthropic in production, API key auth is the safer recommended path. |
23 | 29 | |
| 30 | +This page explains: |
| 31 | + |
24 | 32 | - how the OAuth **token exchange** works (PKCE) |
25 | 33 | - where tokens are **stored** (and why) |
26 | 34 | - how to handle **multiple accounts** (profiles + per-session overrides) |
@@ -122,6 +130,18 @@ Flow shape:
|
122 | 130 | |
123 | 131 | OpenAI Codex OAuth is explicitly supported for use outside the Codex CLI, including OpenClaw workflows. |
124 | 132 | |
| 133 | +The login command still uses the canonical OpenAI provider id: |
| 134 | + |
| 135 | +```bash |
| 136 | +openclaw models auth login --provider openai |
| 137 | +``` |
| 138 | + |
| 139 | +Use `--profile-id openai:<name>` for multiple ChatGPT/Codex OAuth accounts in |
| 140 | +one agent. Do not use `openai-codex:<name>` for new profiles. Doctor migrates |
| 141 | +that older prefix to a collision-free `openai:*` profile id; run |
| 142 | +`openclaw models auth list --provider openai` after repair before copying |
| 143 | +profile ids into `auth.order` or `/model ...@<profileId>`. |
| 144 | + |
125 | 145 | Flow shape (PKCE): |
126 | 146 | |
127 | 147 | 1. generate PKCE verifier/challenge + random `state` |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -193,6 +193,25 @@ key in the provider dashboard when you need provider-side invalidation.
|
193 | 193 | |
194 | 194 | ## Controlling which credential is used |
195 | 195 | |
| 196 | +### OpenAI and legacy `openai-codex` ids |
| 197 | + |
| 198 | +OpenAI API-key profiles and ChatGPT/Codex OAuth profiles both use the canonical |
| 199 | +provider id `openai`. New config should use `openai:*` profile ids and |
| 200 | +`auth.order.openai`. |
| 201 | + |
| 202 | +If you see `openai-codex` in older config, auth profile ids, or |
| 203 | +`auth.order.openai-codex`, treat it as legacy migration input. Do not create new |
| 204 | +`openai-codex` profiles. Run: |
| 205 | + |
| 206 | +```bash |
| 207 | +openclaw doctor --fix |
| 208 | +openclaw models auth list --provider openai |
| 209 | +``` |
| 210 | + |
| 211 | +Doctor rewrites legacy `openai-codex:*` profile ids and |
| 212 | +`auth.order.openai-codex` entries to the canonical `openai` auth route. For |
| 213 | +OpenAI-specific model/runtime routing, see [OpenAI](/providers/openai). |
| 214 | + |
196 | 215 | ### During login (CLI) |
197 | 216 | |
198 | 217 | Use `openclaw models auth login --provider <id> --profile-id <profileId>` for |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。