Unquant

Opening your workspace…

Unquant

如何在 Unquant 中使用 OpenAI Codex CLI

Codex CLI 通过 OpenAI Responses API 进行通信。Unquant 提供兼容 Responses 的端点,因此只需几行配置,Codex 即可直接连接,无需代理。

配置指南阅读时间 2 分钟更新于 2026 年 10 月 1 日
  1. 1

    设置密钥

    Codex 从配置文件中指定的环境变量读取密钥:

    export UNQUANT_API_KEY=your-unquant-key
  2. 2

    将 Unquant 添加为 provider

    编辑 ~/.codex/config.toml:

    model = "glm-5.3-flash"
    model_provider = "unquant"
    
    [model_providers.unquant]
    name = "Unquant"
    base_url = "https://api.unquant.io/v1"
    env_key = "UNQUANT_API_KEY"
    wire_api = "responses"
  3. 3

    运行 Codex

    在你的项目中运行 codex。如需改用 Qwen,请将 model = "qwen-3.8-flash-next"。

推理力度

Codex 的 model_reasoning_effort 设置会原样传递为推理力度:每个模型均支持 low 或 high。

故障排查

401
未授权

env_key 中指定的变量必须在运行 Codex 的 shell 中已设置。

404
未找到

请将 base_url 设为 https://api.unquant.io/v1,并设置 wire_api = "responses"。

429
并发流限额已达上限

你的账户上还有另一个请求正在运行,请等待其完成后重试。

继续阅读