When using ChatGPT account authentication, the --model flag rejects provider-prefixed model names (e.g., openai-codex/gpt-5.1-codex) but accepts bare model names (e.g., gpt-5.1-codex).
The CLI accepts the provider-prefixed format at startup but fails during execution with:
ERROR: {"detail":"The 'openai-codex/gpt-5.1-codex' model is not supported when using Codex with a ChatGPT account."}
Steps to Reproduce
Environment: Codex CLI v0.104.0 with ChatGPT account authentication
# Fails: provider-prefixed format
codex exec --model openai-codex/gpt-5.1-codex "Say hello"
# Works: bare model name
codex exec --model gpt-5.1-codex "Say hello"
Expected Behavior
One of:
- Auto-strip prefix — Automatically strip
openai-codex/ prefix when using ChatGPT account
- Validate upfront — Reject provider-prefixed format at parse time with helpful error
- Document — Clearly state that ChatGPT accounts must use bare model names (no provider prefix)
Actual Behavior
With provider prefix (openai-codex/gpt-5.1-codex):
- ✅ CLI accepts flag
- ✅ Session initializes
- ⚠️ Warning: "Model metadata for
openai-codex/gpt-5.1-codex not found"
- ❌ Execution fails: "model is not supported when using Codex with a ChatGPT account"
Without prefix (gpt-5.1-codex):
Output Comparison
FAILS:
$ codex exec --model openai-codex/gpt-5.1-codex "Say hello"
OpenAI Codex v0.104.0 (research preview)
--------
model: openai-codex/gpt-5.1-codex
provider: openai
--------
user
Say hello
mcp startup: no servers
warning: Model metadata for `openai-codex/gpt-5.1-codex` not found.
ERROR: {"detail":"The 'openai-codex/gpt-5.1-codex' model is not supported when using Codex with a ChatGPT account."}
WORKS:
$ codex exec --model gpt-5.1-codex "Say hello"
OpenAI Codex v0.104.0 (research preview)
--------
model: gpt-5.1-codex
provider: openai
--------
user
Say hello
mcp startup: no servers
thinking
**Preparing simple greeting response**
codex
Hi there!
tokens used 907
Impact
- Confusing UX — Provider prefix accepted at parse time but rejected at execution
- Unclear error — Error message doesn't mention the prefix issue
- Undocumented limitation — No documentation about bare-name requirement for ChatGPT accounts
- Breaks automation — Tools programmatically using provider-prefix format fail unexpectedly
Use Case
This affects agent orchestration tools (e.g., OpenClaw) that use provider-prefixed model names for clarity and consistency across multiple providers. The openai-codex/ prefix is a natural way to namespace models but silently fails on ChatGPT accounts.
Proposed Fix
Option 1 (Recommended): Auto-strip prefix for ChatGPT accounts:
if (authType === 'chatgpt' && args.model?.startsWith('openai-codex/')) {
args.model = args.model.replace('openai-codex/', '');
console.log(`Note: Stripped 'openai-codex/' prefix (ChatGPT accounts use bare model names)`);
}
Option 2: Validate upfront:
if (authType === 'chatgpt' && args.model?.includes('/')) {
console.error('Error: ChatGPT accounts require bare model names (e.g., "gpt-5.1-codex")');
console.error('Remove the provider prefix and try again');
process.exit(1);
}
Option 3: Update documentation and help text to clarify this requirement.
Environment
- Codex CLI: v0.104.0
- Auth: ChatGPT account (confirmed via
codex login status)
- OS: macOS Darwin 25.2.0 (arm64)
- Node: v25.5.0
Verification
Tested both formats with identical prompts:
openai-codex/gpt-5.1-codex → fails every time
gpt-5.1-codex → works every time
Same behavior across multiple OpenAI model names.
Root cause: ChatGPT account validation doesn't recognize provider-prefixed model names, but the CLI doesn't strip the prefix or reject it upfront.
When using ChatGPT account authentication, the
--modelflag rejects provider-prefixed model names (e.g.,openai-codex/gpt-5.1-codex) but accepts bare model names (e.g.,gpt-5.1-codex).The CLI accepts the provider-prefixed format at startup but fails during execution with:
Steps to Reproduce
Environment: Codex CLI v0.104.0 with ChatGPT account authentication
Expected Behavior
One of:
openai-codex/prefix when using ChatGPT accountActual Behavior
With provider prefix (
openai-codex/gpt-5.1-codex):openai-codex/gpt-5.1-codexnot found"Without prefix (
gpt-5.1-codex):Output Comparison
FAILS:
WORKS:
Impact
Use Case
This affects agent orchestration tools (e.g., OpenClaw) that use provider-prefixed model names for clarity and consistency across multiple providers. The
openai-codex/prefix is a natural way to namespace models but silently fails on ChatGPT accounts.Proposed Fix
Option 1 (Recommended): Auto-strip prefix for ChatGPT accounts:
Option 2: Validate upfront:
Option 3: Update documentation and help text to clarify this requirement.
Environment
codex login status)Verification
Tested both formats with identical prompts:
openai-codex/gpt-5.1-codex→ fails every timegpt-5.1-codex→ works every timeSame behavior across multiple OpenAI model names.
Root cause: ChatGPT account validation doesn't recognize provider-prefixed model names, but the CLI doesn't strip the prefix or reject it upfront.