主题
语言

Codex CLI(OpenAI)

使用 GetVibe API 设置 Codex CLI:config.toml、auth.json 和环境变量。必须设置 wire_api = "responses",因为 Codex 调用 /v1/responses。

现成配置

根据请求从我们的目录生成:包含 API 地址、所有已发布的模型及其上下文和输出限制,以及推荐设置。其中不含密钥。Codex 从 GETVIBE_API_KEY(env_key)读取密钥。单次运行使用低价模型:codex -m <model ID>;使用最高推理强度:codex -c model_reasoning_effort="high"。请删除此文件旧版本遗留的 [profiles.*] 表——只要这些表仍存在,Codex 0.134 及更高版本就会拒绝使用 --profile。

# macOS / Linux
mkdir -p ~/.codex
curl -fsSL https://getvibeapi.com/api/integrations/codex.toml -o ~/.codex/config.toml
# Windows PowerShell
New-Item -ItemType Directory -Force "$HOME\.codex" | Out-Null
Invoke-WebRequest https://getvibeapi.com/api/integrations/codex.toml -OutFile "$HOME\.codex\config.toml"
  • 主模型 — gpt-6.1-sol:具备强大代理能力的编码模型,拥有较大的上下文窗口,价格适中;使用不带限定的 id 可保持跨渠道故障转移。
  • 小型任务 — deepseek-v4.1-flash:最便宜且能力足够、支持 1M 上下文的模型,用于标题、摘要、提交消息和压缩。
  • 启用流式传输,请求超时时间为 600 秒,推理力度为 medium:较长的推理回答需要几分钟,而不使用流式传输会达到等待时限。
  • 所有地方都使用不带 :suffix 的纯模型 ID,这样可以保持自动故障转移到健康通道的功能。
目录会发生变化:出现新模型时,请再次下载该文件。若只保留部分模型,请在 URL 中添加带逗号分隔 ID 的 ?models=。

Codex CLI 是 OpenAI 推出的代理式工具,用于在终端中处理代码。它使用 /v1/responses 端点,因此必须设置 wire_api = "responses" 参数。

config.toml

将供应商添加到 ~/.codex/config.toml:

model = "gpt-6.1-sol"
model_provider = "getvibe"
model_reasoning_effort = "high"

[model_providers.getvibe]
name = "GetVibe API"
base_url = "https://getvibeapi.com/v1"
wire_api = "responses"
env_key = "GETVIBE_API_KEY"

主要方法:环境变量

设置由 env_key 指定名称的变量:

export GETVIBE_API_KEY="PASTE_YOUR_GETVIBE_KEY_HERE"
codex

Alternative: auth.json

对于此选项,请移除 env_key,并将 provider block 替换为以下内容:

model = "gpt-6.1-sol"
model_provider = "getvibe"
model_reasoning_effort = "high"

[model_providers.getvibe]
name = "GetVibe API"
base_url = "https://getvibeapi.com/v1"
wire_api = "responses"
requires_openai_auth = true

然后将真实密钥以精确名称 OPENAI_API_KEY 放入 ~/.codex/auth.json 中。$GETVIBE_API_KEY 字符串不会在 JSON 内展开。

{"OPENAI_API_KEY": "PASTE_YOUR_GETVIBE_KEY_HERE"}
Codex CLI 严格访问 /v1/responses(OpenAI Responses API 格式)。如果没有 wire_api = "responses",请求将发送到错误的端点。
来自 api.openai.com 的 403 Country, region, or territory not supported 表示你的 GetVibe key 未被使用,而不是 GetVibe 在你的国家/地区不可用。
Codex CLI + GetVibe API — config.toml、wire_api responses | GetVibe API