gpt-6.2-sol。wire_api 只支持 responses(省略时也是这个默认值)。请求会发到 {base_url}/responses,因此 Base URL 应填写 https://接口地址/v1,最终路径为 https://接口地址/v1/responses。{{API_KEY}} 表示。https://接口地址/v1。gpt-6.2-sol 可用,并且你的 Key 所在分组已开通该模型。请确认该模型可通过 Responses 接口调用。codex。配置写在 ~/.codex/config.toml(也可使用项目内受信任目录下的 .codex/config.toml)。env_key 填的是变量名,不是密钥本身):~/.codex/config.toml,增加自定义 provider。openai、ollama、lmstudio 是内置 ID,不能占用:model = "gpt-6.2-sol"
model_provider = "relay"
[model_providers.relay]
name = "Relay"
base_url = "https://接口地址/v1"
env_key = "RELAY_API_KEY"
wire_api = "responses"codex,确认当前模型为 gpt-6.2-sol,发送一条短消息进行测试。base_url 以 /v1 结尾,不要再加 /responses。Codex 会自行拼接。experimental_bearer_token(官方不推荐),使用 env_key。{
"model": "gpt-6.2-sol",
"input": "你好,请用一句话介绍你自己。"
}/v1/responses 上可用,再启动 codex 测试即可。RELAY_API_KEY 未设置、与 env_key 名称不一致,或 Key 无效。env_key 必须是变量名。在启动 codex 的同一终端执行 echo $RELAY_API_KEY 检查。base_url 漏了 /v1,或多写了 /responses。正确值是 https://接口地址/v1。gpt-6.2-sol。当前 Codex 只走 Responses,不走 Chat Completions。若 curl 访问 /v1/responses 失败,先在中转站确认该模型已开通 Responses;仅支持 /v1/chat/completions 的模型无法按此配置使用。~/.codex/config.toml,TOML 格式无误,并且 model_provider 与 [model_providers.relay] 的 ID 一致。改完后重新启动 codex。