Codex Now Natively Supports Any Open‑Source Model – Step‑by‑Step Setup Guide
OpenAI Codex CLI can be paired with any open‑source model that implements the Responses API; this guide explains the prerequisite change, shows how to locate and edit the configuration files, add a StepFun API key, configure the model parameters, verify the connection, and use Codex to review code changes.
Background
OpenAI Codex CLI originally only worked with OpenAI models. On X, Tibo announced that Codex App, CLI and SDK can be paired with any open‑source model that implements the OpenAI Responses API.
Prerequisite
From February 2026 Codex switched to the Responses API (wire_api = "responses") and dropped Chat Completions. Therefore the model provider must expose the Responses API.
Step 1: Locate configuration files
~/.codex/
├── config.toml # main config: model, provider, switches
└── auth.json # API keyStep 2: Add API key
{
"OPENAI_API_KEY": "your StepFun API key"
}Codex reads the key from auth.json; the field name remains OPENAI_API_KEY.
Step 3: Configure config.toml
model_provider = "stepfun"
model = "step-3.7-flash"
model_reasoning_effort = "high"
model_context_window = 256000
model_auto_compact_token_limit = 200000
model_reasoning_summary = "none"
model_supports_reasoning_summaries = false
preferred_auth_method = "apikey"
[model_providers.stepfun]
name = "StepFun"
base_url = "https://api.stepfun.com/v1"
wire_api = "responses"model_reasoning_effort only accepts low, medium or high.
Disable model_reasoning_summary and model_supports_reasoning_summaries; otherwise Codex returns an "Unsupported parameter" error.
Use the standard API endpoint https://api.stepfun.com/v1; other URLs are not supported.
Do not set env_key = "OPENAI_API_KEY" because Codex will look for an environment variable instead of auth.json.
Step 4: Verify the integration
codex exec "Say a sentence to prove you work"If the output shows model: step-3.7-flash and provider: stepfun, the connection is successful.
If the command is not found, add the Codex binary directory (e.g., C:\Users\ke\AppData\Local\OpenAI\Codex\bin) to the user PATH and restart the terminal.
Step 5: Use Codex for code review
codex review --uncommittedCodex reads the current git diff and uses the step-3.7-flash model to generate review comments. To target a specific file:
codex review --uncommitted src/utils.tsFor non‑interactive output:
codex exec -o review.md "review current uncommitted changes, list potential bugs, readability issues and improvement suggestions"The results are saved to review.md for later inspection.
Conclusion
Integrating an open‑source model such as step-3.7-flash with Codex CLI requires three things: a provider that supports the Responses API, matching entries in config.toml, and a valid API key in auth.json. After configuration, everyday commands like codex review --uncommitted work seamlessly.
References
OpenAI Codex, Custom chat completion API not working after upgrade to codex >=0.59, GitHub issue #7051, 2025‑11‑20.
OpenAI Codex, Deprecating chat/completions support in Codex, GitHub discussion #7782, 2025‑12‑09.
StepFun Open Platform, API Key management.
Tibo (@thsottiaux), Reminder that you can use the Codex App, CLI and SDK with any open source model, X, 2026.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Machine Learning Algorithms & Natural Language Processing
Focused on frontier AI technologies, empowering AI researchers' progress.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
