Skip to content

[Bug]: openai/gpt-image-2 via OpenAI Codex OAuth returns HTTP 403; agent image_generate may still fall back despite mediaGenerationAutoProviderFallback=false #71290

@khaledazar

Description

@khaledazar

Bug type

Bug / regression in newly added Codex OAuth image generation path

Summary

I’m trying to use:

  • model: openai/gpt-image-2
  • auth: OpenAI Codex OAuth
  • no OPENAI_API_KEY
  • no Gemini fallback

OpenClaw does select the Codex OAuth image path, but direct image generation fails with HTTP 403.

Separately, the chat-agent image_generate tool may still fall back to Gemini even when:

  • agents.defaults.mediaGenerationAutoProviderFallback=false
  • no image fallbacks are configured
  • explicit model is openai/gpt-image-2

These appear to be two related but distinct issues.


Goal / expected behavior

OpenClaw should successfully generate images with:

  • openai/gpt-image-2
  • authenticated through OpenAI Codex OAuth

without requiring OPENAI_API_KEY, and without silently falling through to Gemini when fallback is disabled.


OpenClaw version

2026.4.23 (a979721)

Operating system

Linux VPS

Install method

Global npm install


Relevant config

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions