diff --git a/services/www/src/docs/content/config.mdx b/services/www/src/docs/content/config.mdx index ef5ae78742e..959762904a2 100644 --- a/services/www/src/docs/content/config.mdx +++ b/services/www/src/docs/content/config.mdx @@ -627,6 +627,7 @@ All experimental settings live under the `experimental` key: "subagent_depth": 2, "portable_shell_scanner": true, "background_compaction": true, + "image_generate": true, "location_idle_timeout": "4 hours", }, } @@ -660,6 +661,24 @@ automatic compaction doesn't pause the session. Defaults to `false`. See } ``` +### Image generation + +Set `image_generate` to `true` to give agents the [`image_generate`](/tools#image-generate) tool for creating and +editing images. It is offered only while a connected provider has an image model. Defaults to `false`. + +To set a default model, use an object with `model` as `providerID/modelID`, optionally with `#variant`. When that model +isn't available or can't handle a request, OpenCode picks another image model automatically. + +```jsonc +{ + "experimental": { + "image_generate": { + "model": "openai/gpt-image-2", + }, + }, +} +``` + ### Location idle timeout `location_idle_timeout` controls how long a project location can go without session activity before OpenCode unloads diff --git a/services/www/src/docs/content/permissions.mdx b/services/www/src/docs/content/permissions.mdx index 31d26e6dcf0..809427337c3 100644 --- a/services/www/src/docs/content/permissions.mdx +++ b/services/www/src/docs/content/permissions.mdx @@ -118,6 +118,7 @@ currently use these actions and resources: | `question` | `*` | | `webfetch` | Requested URL | | `websearch` | Search query | +| `image_generate` | Selected image model as `providerID/modelID`, plus `#variant` when set | | `external_directory` | Canonical external directory boundary, normally ending in `/*` | | `_` | `*` for an MCP tool; unsupported characters in both names become `_` | | `opencode_list_mcp_resources` | MCP server name | diff --git a/services/www/src/docs/content/tools.mdx b/services/www/src/docs/content/tools.mdx index a42134a1f6d..88e29cd319f 100644 --- a/services/www/src/docs/content/tools.mdx +++ b/services/www/src/docs/content/tools.mdx @@ -157,6 +157,25 @@ Search the web for the latest Bun release notes. Permission: `websearch` with the query as its resource. See [Websearch](/websearch) for providers, selection, rate limits, and disabling the tool. +## Images + +### Image generate + +`image_generate` creates a new image from a prompt, or edits existing ones. It +is experimental and off by default; turn it on with +[`experimental.image_generate`](/config#image-generation). It appears only +while a connected provider has an image model. + +```text +Generate a flat app icon of a paper plane on a blue background and save it to assets/icon.png. +``` + +Give it a `prompt`, and optionally `images` to edit or use as references, a +specific `model`, or a `path` to save to. It runs in the background and +notifies the session with the saved path when the image is ready. + +Permission: `image_generate` with the selected model as its resource. + ## Interaction ### Question