Integrate Codex
Codex is an AI coding tool for software development tasks. HiModels exposes an OpenAI Responses-compatible endpoint for Codex, and clients that read the same Codex configuration directory can reuse the provider configuration.
1. Install Codex CLI
Install Codex CLI with npm and verify that the command works:
npm install -g @openai/codex codex --version
2. Configure the HiModels Provider
Create an API Key from HiModels API Keys.
Set the key in the current terminal environment:
# macOS / Linux export HIMODELS_API_KEY="<your_himodels_api_key>" # Windows PowerShell $env:HIMODELS_API_KEY="<your_himodels_api_key>"
Create or edit ~/.codex/config.toml and add the HiModels provider:
model = "gpt-5.5" model_provider = "himodels" preferred_auth_method = "apikey" model_reasoning_effort = "high" [model_providers.himodels] name = "HiModels" base_url = "https://api.himodels.ai/v1" env_key = "HIMODELS_API_KEY" wire_api = "responses"
On Windows, the file is usually located at %USERPROFILE%\.codex\config.toml. Never commit a real API Key to your repository.
3. Start Using Codex
Open your project directory and start Codex:
cd /path/to/my-project codex
To temporarily switch models, pass a model ID available on HiModels:
codex --model gpt-5.5 codex --model gpt-5.4
Codex uses the Responses protocol. If the request returns 404, verify the Base URL is https://api.himodels.ai/v1 and that the selected SKU has a Responses provider configured.