An AI assistant can store an image you hand it — but until now it could not make one.
media/generate-image turns a text prompt into a real image with WordPress 7.0’s built-in AI client, using whichever connector the site has configured for image generation, and adds it straight to the Media Library in a single call.
At a glance
| Ability | media/generate-image |
| Toolset | Content — toolset/content |
| Group | Content › Media |
| Requires | WordPress 7.0+ and an AI connector that supports image generation |
| Capability | manage_options |
| Safety | Writes data — adds an attachment. Requires confirm: true |
| Repeatable | Not idempotent — each call generates a new image |
| Ships in | AcrossAI Abilities Manager 0.0.43 and later |
How it works
Pass a prompt and confirm: true. The ability generates the image through the AI client that ships inside WordPress — no extra plugin — and sideloads the result exactly like an uploaded file, so all the standard image sizes are created too. Pass a post_id to attach it to a post, and set_as_featured to make it that post’s featured image.
It works with whichever provider you have an API key for — Google, OpenAI, Cloudflare Workers AI and others — set up under Settings → Connectors. Each run makes a paid AI request, which is why it asks for a confirmation. When no image-capable connector is configured, it returns a clear, actionable message instead of failing — and nothing is charged.
Input
| Name | Type | Required | What it is |
|---|---|---|---|
prompt | string | Yes | What to generate, described in plain language. |
confirm | boolean | Yes | Must be true. Generation makes a paid AI request. |
aspect_ratio | string | No | 1:1, 16:9, 4:3, 3:2, 9:16 or 2:3. Model support varies. |
post_id | integer | No | Attach the image to this post. |
set_as_featured | boolean | No | With post_id, also set it as the featured image. |
title / alt_text / caption / description | string | No | Attachment metadata. |
filename | string | No | Base filename, without extension. |
provider / model | string | No | Advanced: force a specific provider and model. |
What comes back
| Name | Type | What it is |
|---|---|---|
id | integer | The new attachment’s id. |
url | string | The image’s URL. |
media | object | The attachment record. |
provider / model | string | Which provider and model generated it. |
set_as_featured | boolean | Whether it was set as the post’s featured image. |
success | boolean | Whether the call completed. |
error_code | string | Present only on failure, such as no image-capable connector configured. |
Example
Ask your assistant:
Generate a featured image of a calm mountain lake at sunrise for this post.
It resolves to one call:
{
"ability": "media/generate-image",
"parameters": {
"prompt": "a calm mountain lake at sunrise, soft mist, photorealistic",
"confirm": true,
"post_id": 128,
"set_as_featured": true,
"alt_text": "mountain lake at sunrise"
}
}Worth knowing
- Core only — it uses the AI client that ships inside WordPress 7.0, with no dependency on any other plugin.
- Works with whichever provider you have an API key for; the connector just has to offer image models (text-only ones cannot generate images).
- Gated behind
confirm: truebecause each run is a paid request; it also respects the Upload Media Abilities file-type allowlist. - The image is processed like any upload, so thumbnails and every registered size are generated.
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category