- Bản v2026.4.23 của OpenClaw gỡ bỏ yêu cầu OPENAI_API_KEY cho image generation: chỉ cần Codex OAuth là chạy gpt-image-2.
- Thêm OpenRouter thành image provider và hints quality/format/background thống nhất qua image_generate.
TL;DR
OpenClaw vừa phát hành v2026.4.23 (2026-04-23) với ba thay đổi lớn cho image generation: (1) openai/gpt-image-2 chạy qua Codex OAuth — không cần OPENAI_API_KEY; (2) OpenRouter trở thành image provider chính thức qua image_generate với chỉ OPENROUTER_API_KEY; (3) agents pass được các hint quality, outputFormat, background, moderation, compression — OpenClaw tự forward sang provider nào hỗ trợ. Tổng cộng 9 provider image được thống nhất sau một tool call.
What's new
Trước v2026.4.23, muốn dùng image generation trong OpenClaw bạn cần tự cắm OPENAI_API_KEY, OpenRouter không generate được ảnh, và các hint đặc thù của OpenAI như background không có cách truyền qua tool gốc. Bản mới fix cả ba:
- Codex OAuth cho image: nếu bạn đã có profile
openai-codex(đăng nhập bằng ChatGPT subscription), OpenClaw reuse cùng OAuth đó và route request ảnh qua Codex Responses backend. Không cần API key riêng, không cần setup billing. - OpenRouter image_generate: model ảnh trên OpenRouter gọi qua chat-completions image API với prefix
openrouter/. Built-in shortcuts gồmgoogle/gemini-3.1-flash-image-preview,google/gemini-3-pro-image-preview, vàopenai/gpt-5.4-image-2. - Unified hints:
quality,outputFormat,background,moderation,compressionđều pass qua cùng một interface. Provider nào không support thì OpenClaw bỏ qua hint đó thay vì throw error.
Ngoài ra bản này còn sửa multipart upload cho reference-image edit của gpt-image-2, khôi phục thứ tự vision prompt cho OpenRouter multimodal, phát hiện Azure OpenAI image endpoint với deployment-scoped URL, và thêm per-call timeoutMs cho generation dài.
Why it matters
Hai nhóm user hưởng lợi trực tiếp. ChatGPT Plus/Pro subscribers trước đây muốn generate ảnh agentic phải mở tài khoản API, nạp tiền, quản lý key — giờ OAuth một lần là xong, cost tính vào subscription cap thay vì API dollar. Teams dùng OpenRouter làm router chính giờ có thể route draft rẻ qua Gemini Flash Image, render final qua gpt-image-2, toàn bộ qua một API key duy nhất — không phải ôm nhiều SDK provider song song.
Về mặt agent design, unified hint interface quan trọng hơn nhiều người nghĩ. Trước đây, một agent muốn support nhiều provider phải tự viết adapter cho từng cái. Giờ agent chỉ cần biết một set hint chuẩn, OpenClaw đảm nhận phần forward + fallback.
Technical facts
Một số số liệu đáng nhớ:
| Property | Value |
|---|---|
| Release tag | v2026.4.23 (2026-04-23) |
| Default OpenAI image model | openai/gpt-image-2 |
| Reference images / call — OpenAI | up to 4 |
| Reference images / call — OpenRouter | up to 5 |
| Reference images / call — xAI grok-imagine | up to 5 |
| Total providers supported | 9 (OpenAI, OpenRouter, Gemini, fal, MiniMax, ComfyUI, Vydra, xAI, Azure OpenAI) |
Ví dụ call edit với 2 reference image:
/tool image_generate action=generate model=openai/gpt-image-2 \
prompt="Combine character identity with color palette" \
images='["/path/to/character.png","/path/to/palette.jpg"]' \
size=1536x1024Lưu ý: OpenClaw không pass-through nguyên xi size hay aspectRatio — nó remap sang supported size gần nhất của provider. Muốn chính xác 1:1, bạn cần chọn size provider officially hỗ trợ.
Comparison
| Feature | OpenClaw v2026.4.23 | Codex CLI | Claude Code |
|---|---|---|---|
Unified image_generate tool | ✅ 9 providers | ❌ OpenAI only | ❌ Not built-in |
| OAuth-based image gen (no API key) | ✅ Codex OAuth | ✅ Native | N/A |
| OpenRouter image models | ✅ Built-in shortcuts | ❌ | ❌ |
| Reference-image edit | ✅ up to 5 images | ✅ gpt-image-2 | N/A |
| Provider hint passthrough | ✅ unified | OpenAI native | N/A |
Use cases
- Agentic content pipeline: agent viết blog, gọi
image_generatevớiquality=high, outputFormat=png, background=transparentđể sinh OG banner cùng lúc. - Cost routing: draft rẻ qua
openrouter/google/gemini-3.1-flash-image-preview, final render quaopenai/gpt-image-2— cùng một tool call, khác model param. - Reference-based character design: pass character sheet + palette, OpenClaw forward thành multipart upload cho gpt-image-2.
- Enterprise Azure: release này auto-detect deployment-scoped image URL, nghĩa là on-prem Azure OpenAI chạy ngay không cần custom config.
- ChatGPT Plus không có API spend: dev hobby dùng OAuth để không phải nạp $5 API credit riêng.
Limitations & pricing
- Aspect ratio remap: OpenClaw không literal pass
size— tỉ lệ lẻ bị round. Cần control chính xác thì chọn size provider officially hỗ trợ. - Hint coverage khác nhau:
backgroundchỉ OpenAI hỗ trợ;compressionchỉ một số provider. OpenClaw silent-drop hint không support. - gpt-image-2 pricing (OpenAI API): input $8.00 / 1M tokens, cached input $2.00 / 1M, output $30.00 / 1M.
- Codex OAuth route: tính vào ChatGPT subscription cap — không rõ quota image cụ thể; OpenAI chưa publish số.
- OpenClaw open-source free, bạn chỉ trả tiền cho provider.
What's next
Về phía OpenAI, gpt-image-2 sẽ mở cho tier Enterprise và Education trong các tuần tới — hiện mới có API + Codex. Về phía OpenClaw, roadmap gần gồm mở rộng ComfyUI workflow integration và hoàn thiện xAI grok-imagine-image (đã có trong release này nhưng dừng ở cơ bản).
Nếu bạn đang build agent multi-modal hay content pipeline, bản này đáng update ngay: downgrade từ 3 SDK provider về 1 tool call, và bonus có thể generate ảnh bằng ChatGPT subscription thay vì API dollars.
Nguồn: docs.openclaw.ai, GitHub release v2026.4.23, OpenAI — gpt-image-2 announcement.
