惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
爱范儿
爱范儿
MongoDB | Blog
MongoDB | Blog
腾讯CDC
aimingoo的专栏
aimingoo的专栏
月光博客
月光博客
Engineering at Meta
Engineering at Meta
C
Check Point Blog
N
Netflix TechBlog - Medium
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
L
LangChain Blog
大猫的无限游戏
大猫的无限游戏
IT之家
IT之家
Microsoft Security Blog
Microsoft Security Blog
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
B
Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
WordPress大学
WordPress大学
博客园 - 司徒正美

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
docs(openai): clarify codex oauth image generation · open...
steipete · 2026-04-24 · via Recent Commits to openclaw:main

@@ -1,5 +1,5 @@

11

---

2-

summary: "Generate and edit images using configured providers (OpenAI, Google Gemini, fal, MiniMax, ComfyUI, Vydra, xAI)"

2+

summary: "Generate and edit images using configured providers (OpenAI, OpenAI Codex OAuth, Google Gemini, fal, MiniMax, ComfyUI, Vydra, xAI)"

33

read_when:

44

- Generating images via the agent

55

- Configuring image generation providers and models

@@ -10,12 +10,12 @@ title: "Image generation"

1010

The `image_generate` tool lets the agent create and edit images using your configured providers. Generated images are delivered automatically as media attachments in the agent's reply.

11111212

<Note>

13-

The tool only appears when at least one image generation provider is available. If you don't see `image_generate` in your agent's tools, configure `agents.defaults.imageGenerationModel` or set up a provider API key.

13+

The tool only appears when at least one image generation provider is available. If you don't see `image_generate` in your agent's tools, configure `agents.defaults.imageGenerationModel`, set up a provider API key, or sign in with OpenAI Codex OAuth.

1414

</Note>

15151616

## Quick start

171718-

1. Set an API key for at least one provider (for example `OPENAI_API_KEY` or `GEMINI_API_KEY`).

18+

1. Set an API key for at least one provider (for example `OPENAI_API_KEY` or `GEMINI_API_KEY`) or sign in with OpenAI Codex OAuth.

1919

2. Optionally set your preferred model:

20202121

```json5

@@ -30,6 +30,20 @@ The tool only appears when at least one image generation provider is available.

3030

}

3131

```

323233+

Use Codex OAuth instead of an OpenAI API key:

34+35+

```json5

36+

{

37+

agents: {

38+

defaults: {

39+

imageGenerationModel: {

40+

primary: "openai-codex/gpt-image-2",

41+

},

42+

},

43+

},

44+

}

45+

```

46+3347

3. Ask the agent: _"Generate an image of a friendly lobster mascot."_

34483549

The agent calls `image_generate` automatically. No tool allow-listing needed — it's enabled by default when a provider is available.

@@ -59,7 +73,7 @@ Use `action: "list"` to inspect available providers and models at runtime:

5973

| ------------- | -------- | ------------------------------------------------------------------------------------- |

6074

| `prompt` | string | Image generation prompt (required for `action: "generate"`) |

6175

| `action` | string | `"generate"` (default) or `"list"` to inspect providers |

62-

| `model` | string | Provider/model override, e.g. `openai/gpt-image-2` |

76+

| `model` | string | Provider/model override, e.g. `openai/gpt-image-2` or `openai-codex/gpt-image-2` |

6377

| `image` | string | Single reference image path or URL for edit mode |

6478

| `images` | string[] | Multiple reference images for edit mode (up to 5) |

6579

| `size` | string | Size hint: `1024x1024`, `1536x1024`, `1024x1536`, `2048x2048`, `3840x2160` |

@@ -125,9 +139,11 @@ OpenAI, Google, and xAI support up to 5 reference images via the `images` parame

125139126140

### OpenAI `gpt-image-2`

127141128-

OpenAI image generation defaults to `openai/gpt-image-2`. The older

129-

`openai/gpt-image-1` model can still be selected explicitly, but new OpenAI

130-

image-generation and image-editing requests should use `gpt-image-2`.

142+

OpenAI image generation defaults to `openai/gpt-image-2` with `OPENAI_API_KEY`.

143+

Use `openai-codex/gpt-image-2` to generate or edit images with the same Codex

144+

OAuth sign-in used by `openai-codex` chat models. The older `openai/gpt-image-1`

145+

model can still be selected explicitly, but new OpenAI image-generation and

146+

image-editing requests should use `gpt-image-2`.

131147132148

`gpt-image-2` supports both text-to-image generation and reference-image

133149

editing through the same `image_generate` tool. OpenClaw forwards `prompt`,

@@ -153,6 +169,18 @@ Edit one local reference image:

153169

/tool image_generate action=generate model=openai/gpt-image-2 prompt="Keep the subject, replace the background with a bright studio setup" image=/path/to/reference.png size=1024x1536

154170

```

155171172+

Generate with Codex OAuth:

173+174+

```

175+

/tool image_generate action=generate model=openai-codex/gpt-image-2 prompt="A clean editorial poster for OpenClaw image generation" size=3840x2160 count=1

176+

```

177+178+

Edit one local reference image with Codex OAuth:

179+180+

```

181+

/tool image_generate action=generate model=openai-codex/gpt-image-2 prompt="Keep the subject, replace the background with a bright studio setup" image=/path/to/reference.png size=1024x1536

182+

```

183+156184

Edit with multiple references:

157185158186

```