Use Kimi K3.1 Pro and GLM-5.3 in Codex CLI
Point Codex CLI at ParamHub with the setup below. You pay per token from prepaid credits; there is no subscription.
What you need
- Codex CLI installed:
npm install -g @openai/codex - A ParamHub API key with credits on the account.Create a key →
Set it up
Add the provider block to ~/.codex/config.toml, put your key in the PARAMHUB_API_KEY environment variable, then start Codex.
model = "GLM-5.2"
model_provider = "paramhub"
web_search = "disabled"
[model_providers.paramhub]
name = "ParamHub"
base_url = "https://api.paramhub.com/v1"
env_key = "PARAMHUB_API_KEY"
wire_api = "responses"Check that it works
- 1Run a one-off task: codex exec "say hello". It should answer and exit.
- 2Send any prompt. The request appears under Usage in your ParamHub console with its token counts and cost.
Which model to pick
We ran Codex CLI 0.171.0 through ParamHub on one task: fix 4 planted bugs and add a feature in a 6-file Python library, graded by 11 hidden tests.
| Model | Passed | Time | Input | Cached | Output | Cost |
|---|---|---|---|---|---|---|
| kimi-k3.1-pro | 4/5 | 4.3 min | 180,000 | 85% | 7,100 | $0.13 |
| GLM-5.3 | 4/6 | 2.9 min | 212,000 | 93% | 6,300 | $0.07 |
| GLM-5.2 | 3/3 | 3.2 min | 219,000 | 92% | 15,200 | $0.09 |
Codex CLI works with every model above. Where fewer runs passed than were made, the code the model wrote failed a hidden test or the task timed out; the connection itself worked.
- kimi-k3.1-pro
- Works, but less steady here than in other tools. In the one run that did not pass, Codex's file-editing tool rejected the model's edits, then one request ran for 13 minutes and the task timed out.
- GLM-5.3
- Works. In the two runs that did not pass, Codex finished the task and all but one test passed: once a bug fix was incomplete, once the model handled an edge case differently from what the tests expect.
Passed is how many runs of the task passed every hidden test, out of how many we made: 4/5 means 5 runs, 4 passed. Time, input and output are medians per task; output includes thinking. Tested on November 23, 2026 on a small task with few runs, so read the numbers as rough. Cost is per task, calculated from those medians at the current prices. Pricing →
Good to know
- Codex only speaks the Responses API. ParamHub serves it for all three models.
- At startup Codex prints "Model metadata for … not found". This is expected for models that are not from OpenAI.
- The setup turns off Codex's built-in web search, which is not available through ParamHub.
- Thinking is on by default and is billed as output tokens.
- Model names are case-sensitive. Use them exactly as listed on the pricing page.
- Requests are processed by model providers located in China. Read the Privacy Policy before sending confidential code. Privacy Policy →
If something goes wrong
The key is wrong or disabled. Copy it again from API Keys.
The account has no credits. Add credits on the Billing page.
Check the spelling and case of the model name.
Switch back
Remove the model, model_provider and web_search lines and the [model_providers.paramhub] block from config.toml.
Create an account, add credits from $5, and paste your key into the setup above.
Other tools
Codex CLI belongs to its respective owner. ParamHub is an independent service and is not affiliated with or endorsed by it.