1. Requirements1. 准备工作
2. Install Codex CLI2. 安装 Codex CLI
The common installation path is npm. If you prefer not to use npm, check the official GitHub releases for platform binaries.常用安装方式是 npm。如果你不想用 npm,也可以到官方 GitHub Releases 下载对应平台的二进制文件。
3. Connect CodeToInfinity3. 接入 CodeToInfinity
Point Codex to the CodeToInfinity API endpoint and use the key you created in the console.把 Codex 指向 CodeToInfinity API 入口,并使用你在控制台生成的 Key。
For a permanent setup, add these exports to your shell profile, such as ~/.zshrc or ~/.bashrc.如果想长期生效,可以把这两行加入 ~/.zshrc 或 ~/.bashrc。
4. Verify the workflow4. 验证工作流
- Run
codexin a project directory.在一个项目目录里运行codex。 - Ask a small coding question or file-reading task first.先让它执行一个小的代码问题或文件阅读任务。
- Open the CodeToInfinity console and check quota, usage, and request details.回到 CodeToInfinity 控制台查看额度、用量和请求明细。
Troubleshooting常见问题
Command not found找不到 codex 命令
Restart your terminal, then check whether your global npm bin directory is in PATH.重启终端,并检查 npm 全局安装目录是否在 PATH 中。
401 or invalid key401 或 Key 无效
Confirm the key is active in the console and that OPENAI_API_KEY has no extra spaces.确认控制台里的 Key 是启用状态,并检查 OPENAI_API_KEY 没有多余空格。
Slow or failed model call模型调用慢或失败
Check your usage details in the console. If quota is available but calls fail, contact support with the request time and model name.先在控制台查看调用明细。如果额度正常但请求失败,请带上请求时间和模型名称反馈。