Direct answer
A model name is not an endpoint. The provider defines the endpoint, protocol and authentication requirements, and all of them must match for reliable operation.
What this guide helps you solve
Select a model and configure an OpenAI compatible provider for the Codex CLI
Separate model, provider and protocol
model is the model identifier sent to the server; model_provider selects a set of connection settings; wire_api determines the request protocol used by Codex. Just changing the model name will not automatically switch the server.
Compatible services may implement only part of the protocol. Actual verification of tool calls, streaming output, and error behavior should prevail. Don't equate "can return text" with full compatibility.
CodeNodex current Codex configuration
The CodeNodex CLI configures an OpenAI Responses-compatible provider for Codex and sets both the main and review models to gpt-5.6-sol. base_url uses the public API endpoint, while the API key is stored separately in the authentication file.
Manually copying the configuration can easily miss authentication or overwrite existing fields. For production use, run codenodex setup first. The snippet below is for understanding the structure and does not contain secrets.
model_provider = "OpenAI"
model = "gpt-5.6-sol"
review_model = "gpt-5.6-sol"
model_reasoning_effort = "xhigh"
[model_providers.OpenAI]
name = "OpenAI"
base_url = "https://token.codenodex.com/v1"
wire_api = "responses"
requires_openai_auth = true
[features]
goals = trueSynchronize provider and authentication using CLI
Automatic setup obtains the public base URL, validates the selected API key, then merges config.toml and auth.json. It aborts if the existing TOML cannot be parsed, preventing a silent overwrite.
The provider transport configuration is different for normal Codex and WebSocket variants. Current WebSocket variants only use supports_websockets and the removed responses_websockets_v2 feature is no longer enabled.
codenodex login -o https://token.codenodex.com
codenodex setup --client codex
codex doctor --summaryPersistent defaults vs. one-time model selection
Put stable defaults in config.toml and use -m for temporary comparisons. Do not rely on interactive model selection in team scripts because it makes results difficult to reproduce.
Reasoning effort affects latency, cost and task performance. Increase it for difficult analysis; small mechanical tasks may not need the highest setting. The current configuration reference defines the available values.
codex -m gpt-5.6-sol "分析这个竞态条件,先不要修改。"
codex -m gpt-5.6-sol -c model_reasoning_effort=high "为已确认根因设计最小修复。"Manage the review model separately
review_model allows review work to use an independent default model. It must still belong to the collection of models recognized by the current provider; the availability of the main model does not mean that the review model configuration must be correct.
When assessing review quality, fix baseline branches, prompts, and code samples, and record real defects and false positives found, rather than just comparing answer lengths.
codex review --uncommitted
codex review --base main "重点检查行为回归、错误处理、秘密泄漏和缺失测试。"Locating provider errors with layered diagnostics
401 usually points to credentials or authentication headers, 404 may be a base URL path error, an unknown model indicates that the connection was made to the service but the model name does not match, and a protocol field error may manifest itself as a parsing or streaming response exception.
First use doctor and the CodeNodex key status to verify the local setup, then capture the provider fragment and error code with credentials removed. Never disable TLS verification or print complete request headers for troubleshooting.
codex doctor --summary
codenodex keys
codenodex setup --client codex
codex -s read-only "只报告当前模型和 provider 名称,不要输出认证信息。"Official sources and verification scope
This guide is based on public official documentation. Commands and configuration may change between client versions, so verify the linked sources before use.
Read the verification methodology