Skip to content

[Feature]: support gpt-image-2 in image_generate via Codex OAuth #70703

Description

@barronlroth

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions