Edit an existing image with AI
edit_imageEdit an image you already have: change the background, add or remove an object, restyle it, make a variation. Pass the image URL in baseImageUrl and what to change in prompt. Returns a durable public URL ready to pass to create_post. Synchronous. Costs 20 AI credits per image (40 when reference images are attached), the same as generate_image. For a new image from text, or an edit that also needs an aspect ratio, product photos or characters, use generate_image. Nothing is charged if it fails. SPENDS AI CREDITS ONLY WITH confirm: true. Call it first without confirm: nothing runs and nothing is charged, you get the quote (what it will do and the credits). Tell the user, in your own words, exactly that — including the options you chose, so they can change them — and wait for a clear yes before calling again with the same arguments and confirm: true. One yes covers the plan they approved (e.g. every line of an approved voice-over with the chosen voice); anything new or different needs a new yes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | What to change, in detail. Describe the result you want, not the steps: "same product on a marble surface, soft daylight from the left". | |
| confirm | No | true ONLY after the user said yes to the quote (what it does and the credits). Without it nothing runs and nothing is charged. | |
| workspaceId | No | Workspace to work on (an id from list_workspaces). Not needed when this connection is tied to one workspace, or when you pass an account: the account's workspace is used. | |
| baseImageUrl | Yes | Public https URL of the image to edit. Use list_library_media or list_account_media to find one. | |
| reservationId | No | Optional. A credit reservation (from an approved production) to pay this image from, instead of the monthly pool. | |
| idempotencyKey | No | Optional. A unique id for this action (16-128 chars: letters, digits, _ : . -). If you are unsure whether a call went through (timeout, network error), repeat it with the SAME idempotencyKey and the same arguments: you get the original result and nothing is done twice. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Durable public URL of the edited image. | |
| quotaUsed | No | ||
| quotaLimit | No | ||
| confirmToken | No | ||
| estimatedCredits | No | ||
| needsConfirmation | No | true = this is only the quote: nothing was done or charged. |