Codex CLI is OpenAI’s open-source local coding agent that runs in your terminal. It supports custom model providers, so you can point it at Haimaker and get one API key, budget controls, and hundreds of models behind Codex’s agentic workflow without changing how you work.
This guide walks through the full setup in five steps.
What is Codex CLI?
Codex CLI is OpenAI’s first-party terminal coding agent. It reads your codebase, edits files, runs commands, and iterates on tasks autonomously. Out of the box it talks to OpenAI directly, but the config.toml provider system lets you swap in any OpenAI-compatible API. Haimaker is one of them: it routes requests across providers with unified pricing and a single key.
Quick Start
Step 1: Install Codex CLI
Follow the Codex CLI installation instructions to install the CLI on your system.
Step 2: Get your Haimaker API key
- Sign up or log in at haimaker.ai
- Grab your API key from the dashboard
- Keep it handy — you’ll add it to your shell environment in Step 4
Step 3: Configure Codex for Haimaker
Codex uses a config.toml file, typically located at ~/.codex/config.toml. Create or edit this file with the following configuration:
model_provider = "haimaker"
model_reasoning_effort = "high"
model = "openai/gpt-5.3-codex"
[model_providers.haimaker]
name = "haimaker"
base_url = "https://api.haimaker.ai/v1"
env_key = "HAIMAKER_API_KEY"
Step 4: Set your API key
Export your Haimaker API key in your shell profile:
# Add to ~/.zshrc, ~/.bashrc, or ~/.config/fish/config.fish
export HAIMAKER_API_KEY="your-haimaker-api-key"
Codex reads the key from the environment variable named in env_key (here, HAIMAKER_API_KEY). Make sure it’s set in your current shell before starting Codex — open a new terminal or run source ~/.zshrc after editing.
Step 5: Start Codex
Navigate to your project directory and run:
cd /path/to/your/project
codex
Your requests now route through Haimaker.
Configuration Reference
Core Settings
| Setting | Description | Example |
|---|---|---|
model_provider | Provider block to use for model requests | "haimaker" |
model | Model ID from Haimaker’s model hub | "openai/gpt-5.3-codex" |
model_reasoning_effort | Reasoning effort level for Codex models | "low", "medium", "high", "xhigh" |
show_raw_agent_reasoning | Whether to display reasoning tokens in the UI | true or false |
personality | Agent personality preset | "pragmatic", "helpful", etc. |
Haimaker Provider Block
[model_providers.haimaker]
name = "haimaker"
base_url = "https://api.haimaker.ai/v1"
env_key = "HAIMAKER_API_KEY"
base_url: Haimaker’s OpenAI-compatible API endpoint. Usehttps://api.haimaker.ai/v1.env_key: The environment variable name Codex reads your API key from.
Project Trust Levels
Codex supports per-project trust levels. Add project paths to control what the agent can access:
[projects."/path/to/trusted/project"]
trust_level = "trusted"
[projects."/path/to/untrusted/project"]
trust_level = "untrusted"
trusted: Agent has full access (run commands, edit files).untrusted: Agent has restricted access for safety.
Why use Haimaker with Codex CLI?
Provider failover
Haimaker routes requests across multiple upstream providers. If one is unavailable or rate-limited, Haimaker can fail over to another, keeping long coding sessions uninterrupted.
Organizational controls
For teams, Haimaker provides centralized budget management. Set spending limits, allocate credits, and avoid surprise cost overruns across every developer running Codex.
Usage visibility
Track Codex usage from your Haimaker dashboard — costs, token usage, and request patterns in one place, instead of reconciling per-developer OpenAI bills.
Model flexibility
Switch between Codex versions (openai/gpt-5.2-codex, openai/gpt-5.3-codex) or jump to an entirely different model without touching your Codex install. Just edit one line in config.toml. Haimaker is typically about 5% cheaper than going to providers directly, which adds up fast on agentic workloads that burn tokens.
Adding more models
Codex isn’t limited to a single model. Point model at anything in Haimaker’s model hub — Claude, Gemini, GLM, Qwen, DeepSeek, and more — using the exact model ID from the hub:
model = "anthropic/claude-sonnet-4-6"
Model IDs follow the format shown on the hub. Copy them exactly; case and formatting matter.
Troubleshooting
Auth errors. Make sure HAIMAKER_API_KEY is exported in the shell you launched Codex from. Test the key directly:
curl https://api.haimaker.ai/v1/models \
-H "Authorization: Bearer $HAIMAKER_API_KEY"
Model not found. Verify the model ID against haimaker.ai/models. Use the exact format (e.g., openai/gpt-5.3-codex), not a shortened name.
Config not picked up. Confirm config.toml is at ~/.codex/config.toml and that model_provider matches the [model_providers.<name>] block name exactly.
Resources
This same pattern works for any OpenAI-compatible API. Swap the base_url and model names and Codex will route wherever you point it.
Questions? Hit us up in Discord.