HypeX LLM

Connect Codex CLI

Configure config.toml to switch between platform models.

Codex CLI connects through the OpenAI-compatible protocol. Add a custom model provider, then use -m to select any platform model.

Install Codex CLI

npm install -g @openai/codex

Add the HypeX LLM provider

~/.codex/config.toml
model_provider = "hypex"
model = "z-ai/glm-5.2"

[model_providers.hypex]
name = "HypeX LLM"
base_url = "https://api.hypexllm.com/v1"
env_key = "HYPEX_API_KEY"

Set the key and start

export HYPEX_API_KEY="YOUR_HYPEX_API_KEY"
codex                                # Use the default model
codex -m deepseek/deepseek-v4-pro    # Switch models for this run

env_key names an environment variable. Codex reads the key from that variable at startup; do not put a plaintext key in config.toml.

Use the Responses protocol (optional)

The platform also supports OpenAI Responses (/v1/responses). To use it in Codex, add this line to the provider configuration:

[model_providers.hypex]
name = "HypeX LLM"
base_url = "https://api.hypexllm.com/v1"
env_key = "HYPEX_API_KEY"
wire_api = "responses"

If a model has compatibility problems, remove wire_api to return to the default Chat Completions protocol.

On this page