← All applications · Connect apps section on /docs
Codex CLI
Also known as: codex · OpenAI Codex CLI
Codex CLI: hướng dẫn cấu hình khóa API, model và nhà cung cấp trong terminal.
Published instructions · Checked version: 0.163.0-alpha.10.2 · Checked on:
The real application was run against a local mock API to check connection settings, authentication and streaming responses. Production, all features, plugins and operating systems have not been verified.
Chat, ping, invoke and content-generation examples may send real billable requests. Check the model, balance, rate and minimum before running them. GET /v1/models checks authentication and the catalogue only. Set up environment variables safely
Base URL to paste
OpenAI SDKs generally use a URL ending in /v1; Anthropic SDKs use the root URL. Avoid adding /v1 twice. Protocol compatibility does not guarantee every provider feature.
https://apistack.vn/v1Prerequisites
- Đã cài `codex`
- API key API Stack
- Biến API_KEY (khuyến nghị)
Recommended model: gpt-5.6-sol
Quick way — command / config
npm install -g API CLI@latest
api-cli configure codex -m gpt-5.6-sol
export API_KEY='sk-stk-...'
codexWhere to place file / fill Settings
Nội dung như snippet config.toml. Không để base_url thiếu /v1.
Giống macOS.
Tạo thư mục `.codex` nếu chưa có; paste TOML; setx API_KEY.
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://apistack.vn/v1" |
| Missing API key | env_key API_KEY chưa export. | export/setx API_KEY rồi mở terminal mới. |
Notes
- Codex App (GUI) thường dùng cùng ~/.codex — xem trang codex-app.