← All applications · Connect apps section on /docs
OpenAIconfigure codex
Codex CLI
Also known as: codex · OpenAI Codex CLI
Tác tử OpenAI Codex trên terminal — cấu hình qua config.toml + auth.
Base URL to paste
Paste exactly one of two formats — wrong URL yields 404 (not 401).
https://vietrouter.com.vn/v1Prerequisites
- Đã cài `codex`
- API key Vietrouter
- Biến sk-mtm-... (khuyến nghị)
Recommended model: gpt-5.6-sol
Quick way — command / config
npm install -g API CLI@latest
api-cli configure codex -k 'sk-mtm-...' -m gpt-5.6-sol
# API key (dán vào cấu hình app): sk-mtm-...
codexWhere to place file / fill Settings
Filemacos
~/.codex/config.toml
Nội dung như snippet config.toml. Không để base_url thiếu /v1.
Filelinux
~/.codex/config.toml
Giống macOS.
Filewindows
%USERPROFILE%\.codex\config.toml
Tạo thư mục `.codex` nếu chưa có; paste TOML; setx sk-mtm-....
Verify connection
- `codex` chạy và trả lời một câu ngắn.
- Dashboard → Sử dụng.
Troubleshooting
| Symptom | Reason | How to handle |
|---|---|---|
| 404 | base_url thiếu /v1. | base_url = "https://vietrouter.com.vn/v1" |
| Missing API key | env_key sk-mtm-... chưa export. | export/setx sk-mtm-... rồi mở terminal mới. |
Notes
- Codex App (GUI) thường dùng cùng ~/.codex — xem trang codex-app.