乐于分享
好东西不私藏

重大更新! OpenClaw 接入 GPT-Image-2:这次不用自己配 API Key 了

重大更新! OpenClaw 接入 GPT-Image-2:这次不用自己配 API Key 了

OpenClaw 发布了 2026.4.23 版本。

相比上次让人想更新的版本,这次的变化更实在:通过 OpenAI Codex 的 OAuth 路径,OpenClaw 原生接入了 GPT-Image-2 生成能力,用户不需要自己准备 OPENAI_API_KEY。与此同时,OpenRouter 的图像生成也打通了,Codex harness 本身也补全了多个工程细节。

完整 release notes 原文转载如下。


2026.4.23 Release Notes

Image generation via Codex OAuth

  • Providers/OpenAI: add image generation and reference-image editing through Codex OAuth, so openai/gpt-image-2 works without an OPENAI_API_KEY. Fixes #70703.

  • Providers/OpenRouter: add image generation and reference-image editing through image_generate, so OpenRouter image models work with OPENROUTER_API_KEY. Fixes #55066 via #67668. Thanks @notamicrodose.

  • Image generation: let agents request provider-supported quality and output format hints, and pass OpenAI-specific background, moderation, compression, and user hints through the image_generate tool. (#70503) Thanks @ottodeng.

  • Agents/tools: add optional per-call timeoutMs support for image, video, music, and TTS generation tools so agents can extend provider request timeouts only when a specific generation needs it.

  • Dependencies/Pi: update bundled Pi packages to 0.70.0, use Pi's upstream gpt-5.5 catalog metadata for OpenAI and OpenAI Codex, and keep only local gpt-5.5-pro forward-compat handling.

  • Codex harness: add structured debug logging for embedded harness selection decisions so /status stays simple while gateway logs explain auto-selection and Pi fallback reasons. (#70760) Thanks @100yenadmin.

  • Codex harness: route native request_user_input prompts back to the originating chat, preserve queued follow-up answers, and honor newer app-server command approval amendment decisions.


几个值得注意的工程细节

1. Codex OAuth 打通意味着什么

之前 OpenClaw 用户想用 GPT-Image-2,需要自己持有 OPENAI_API_KEY,或者走 OpenAI 官方接口自行接入。这次 2026.4.23 通过 Codex 的 OAuth 路径把这件事在 provider 层做掉了——用户不需要自己管密钥,OpenClaw 层面直接透传。这意味着 Agent 工具调用里走 openai/gpt-image-2 的门槛降低了:不用配置 API Key,权限走 Codex 的 OAuth 授权流程。

2. Pi 包 0.70.0 的 catalog 更新

这次更新把绑定的 Pi 包升到了 0.70.0,其中一项重要变化是用了 Pi 上游的 gpt-5.5 catalog 元数据,专门覆盖 OpenAI 和 OpenAI Codex。这是模型支持层面的上游同步——说明 OpenClaw 的 Codex harness 在模型发现层开始与 Pi 官方 catalog 对齐,而不是单独维护一套模型列表。

3. image_generate 工具层的细节扩展

除了打通 OAuth 通道,这次还在 image_generate 工具层面补了 OpenAI 特定的参数:background(背景控制)、moderation(审核提示)、compression(输出压缩)、user hints(用户意图提示)。这些都是 OpenAI 图像 API 原生支持的选项,现在通过 OpenClaw 工具层透传,Agent 在调用时可以请求具体的质量级别和输出格式。

4. 跨 Provider 的图像生成一致性

OpenRouter 图像生成也通过 image_generate 工具打通了。这意味着 Agent 侧不需要关心底层走的是 OpenAI 还是 OpenRouter——工具抽象层统一,OPENROUTER_API_KEY 走通即可。两种 Provider 的接入方式不同(Codex OAuth vs API Key),但工具调用接口收敛到同一个工具上。


如何更新

# 通过 npm 更新
npm update -g openclaw

# 或通过 openclaw 自身
openclaw update

# 确认版本
openclaw --version

原文来源

  • Release Notes:https://github.com/openclaw/openclaw/releases/tag/v2026.4.23[1]
  • npm 包:https://npmjs.com/package/openclaw[2]

OpenClaw 连续更新,能导入 ChatGPT 了!

Hermes Agent vs OpenClaw vs Claude Code:一文讲清楚应该用哪个