openclaw - 💡(How to fix) Fix [Feature]: support gpt-image-2 in image_generate via Codex OAuth [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#70703Fetched 2026-04-24 05:54:24
View on GitHub
Comments
2
Participants
2
Timeline
3
Reactions
3
Timeline (top)
commented ×2closed ×1

OpenClaw appears to support gpt-image-2 in the shared image_generate capability now, but only through the OpenAI API-key path.

Today the bundled OpenAI image provider defaults to gpt-image-2, while provider inventory reports that openai/* image generation requires OPENAI_API_KEY. In contrast, OpenClaw already supports ChatGPT/Codex OAuth for openai-codex/* text models.

It would be very useful to support gpt-image-2 via OpenAI Codex OAuth as well, so users signed in with Codex/ChatGPT can use image generation without separately configuring OPENAI_API_KEY.

Root Cause

  • better UX: one auth story for Codex users
  • avoids requiring both Codex OAuth and an OpenAI API key
  • matches user expectations when gpt-image-2 is already surfaced as a supported image model
  • brings OpenClaw closer to parity with other Codex-integrated agents

Thanks — happy to test if this lands.

RAW_BUFFERClick to expand / collapse

summary

OpenClaw appears to support gpt-image-2 in the shared image_generate capability now, but only through the OpenAI API-key path.

Today the bundled OpenAI image provider defaults to gpt-image-2, while provider inventory reports that openai/* image generation requires OPENAI_API_KEY. In contrast, OpenClaw already supports ChatGPT/Codex OAuth for openai-codex/* text models.

It would be very useful to support gpt-image-2 via OpenAI Codex OAuth as well, so users signed in with Codex/ChatGPT can use image generation without separately configuring OPENAI_API_KEY.

current gap

  • image_generate lists an OpenAI provider with default model gpt-image-2
  • that provider requires OPENAI_API_KEY
  • Codex OAuth works for openai-codex/* model access, but not for image generation
  • result: users can see that gpt-image-2 is supported, but cannot use it through the same OAuth path they already use for Codex text models

requested behavior

Please add support for gpt-image-2 image generation through Codex OAuth.

A clean shape might be either:

  1. a separate openai-codex image-generation provider/backend, or
  2. extending the existing OpenAI image provider to route through the Codex/Responses image generation path when Codex OAuth is available

Either way, it would be ideal to preserve the current API-key-based OpenAI provider while also allowing OAuth-based image generation.

reference implementation

Hermes just shipped a version of this:

Relevant details from that PR:

  • adds a separate openai-codex image backend
  • exposes the same gpt-image-2 catalog as the API-key-based OpenAI backend
  • routes generation through the ChatGPT/Codex Responses image_generation tool path
  • works whenever the user is signed in with Codex OAuth
  • does not require OPENAI_API_KEY
  • keeps the existing API-key OpenAI backend unchanged

That seems like a very good precedent for OpenClaw.

why this matters

  • better UX: one auth story for Codex users
  • avoids requiring both Codex OAuth and an OpenAI API key
  • matches user expectations when gpt-image-2 is already surfaced as a supported image model
  • brings OpenClaw closer to parity with other Codex-integrated agents

Thanks — happy to test if this lands.

extent analysis

TL;DR

Add support for gpt-image-2 image generation through Codex OAuth by introducing a separate openai-codex image backend or extending the existing OpenAI image provider.

Guidance

  • Introduce a separate openai-codex image backend that exposes the gpt-image-2 catalog and routes generation through the ChatGPT/Codex Responses image_generation tool path.
  • Extend the existing OpenAI image provider to use Codex OAuth when available, while preserving the API-key-based OpenAI provider.
  • Ensure the new implementation does not require OPENAI_API_KEY when Codex OAuth is used.
  • Test the implementation to verify that gpt-image-2 image generation works through Codex OAuth without requiring an OpenAI API key.

Example

No code snippet is provided as the issue does not contain specific code details.

Notes

The implementation should be designed to work seamlessly with existing Codex OAuth authentication, providing a better user experience by avoiding the need for both Codex OAuth and an OpenAI API key.

Recommendation

Apply a workaround by introducing a separate openai-codex image backend, as seen in the reference implementation, to support gpt-image-2 image generation through Codex OAuth. This approach allows for a clean and separate implementation that does not disrupt the existing API-key-based OpenAI provider.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING