Codex
Configure the Codex CLI to use Engy models through the Responses API.
This page explains how to configure the Codex CLI to use Engy as a model provider. It is intended for developers who want to use open models from Engy in Codex.
Prerequisites
Before you begin, make sure you have:
- The Codex CLI installed
- An Engy API key. For details, see API keys
Configure Codex
Add Engy as a model provider
Open ~/.codex/config.toml in a text editor, and add the following settings. If the file does not exist, create it.
model = "glm-5.2"
model_provider = "engy"
[model_providers.engy]
name = "engy"
base_url = "https://api.engy.ai/v1"
env_key = "ENGY_API_KEY"
wire_api = "responses"Set the API key
Set your API key in the environment variable that env_key names:
export ENGY_API_KEY="sk-engy-..."To keep the variable across sessions, add the line to your shell profile, such as ~/.zshrc or ~/.bashrc.
Start Codex
Run codex in your terminal.
Settings reference
| Setting | Description |
|---|---|
model | The Engy model ID. For the list of models, see Models and pricing. |
model_provider | The provider entry to use. It must match the name of the [model_providers.engy] table. |
base_url | The Engy API base URL, including /v1. |
env_key | The environment variable that contains the API key. |
wire_api | The API format. Set it to responses. |
Limitations
Codex uses the Responses format, which Engy supports without stored state. The following features are not available through this format:
- Image input
- Reasoning controls. The model reasons at its default level, and the reasoning is not displayed
- Structured outputs
For details, see API overview.