Coding · OpenAI
Codex
OpenAI's coding agent. Codex CLI in the terminal, the Codex extension for VS Code and other editors, and Codex in the ChatGPT desktop app share one config file, so one edit gives all three your key.
https://gw.huanwise.ai/ v1Config file: ~/.codex/config.toml on macOS and Linux, %USERPROFILE%\.codex\config.toml on Windows. Create it if it isn't there.
Copy it, then replace “paste your key” with your key:
model = "gpt-6.1-sol"
model_provider = "huanwise"
model_reasoning_effort = "medium"
[model_providers.huanwise]
name = "HuanWise"
base_url = "https://gw.huanwise.ai/v1"
wire_api = "responses"
experimental_bearer_token = "paste your key"- 1
Put the config above into config.toml. If the file already has settings, the model, model_provider and model_reasoning_effort lines go at the very top, before the first [ ] table header; change any of them that are already there rather than adding them twice.
- 2
Replace “paste your key” with your key and save.
- 3
Quit Codex fully and open it again, restarting the desktop app and your editor too. Codex CLI needs no ChatGPT sign-in: run
codex, and/statusshows the model and provider in use. - 4
Send a short test message; a reply means it works.
Set the reasoning effort in Codex itself: change model_reasoning_effort to low, high or xhigh, or pick it with /model, and keep the model name gpt-6.1-sol. If you prefer an environment variable, replace the experimental_bearer_token line with env_key = "HUANWISE_API_KEY" and set that variable (the Codex CLI example on your order page does this); the desktop app doesn't see a variable set only in a terminal.

















