---
title: "Modify an existing image according to text instructions: supply a source image (URL or base64) and a prompt describing the changes (e.g. \"add clouds\", \"warmer color scheme\"), with an optional reference_image for extra style or content guidance. Synchronous: the call blocks and returns an array of image results, each with a url; request n (1-4) to control the number of edited variations. Provided images are uploaded and validated, and any image larger than 15MB is rejected with HTTP 400. Credits are charged only on success, scaled to the number of images produced. Use editImage to transform a specific existing image; use createImage to generate from text alone, generateWithStyle to borrow a reference's art style, and removeBackground for the dedicated background-removal case. Pass an optional request_id to tag the results so you can retrieve them later via getImageResults. Requires an API key (user scope)."
method: POST
path: "/assets/image/edit"
tags: ["Images"]
---

# Modify an existing image according to text instructions: supply a source image (URL or base64) and a prompt describing the changes (e.g. "add clouds", "warmer color scheme"), with an optional reference_image for extra style or content guidance. Synchronous: the call blocks and returns an array of image results, each with a url; request n (1-4) to control the number of edited variations. Provided images are uploaded and validated, and any image larger than 15MB is rejected with HTTP 400. Credits are charged only on success, scaled to the number of images produced. Use editImage to transform a specific existing image; use createImage to generate from text alone, generateWithStyle to borrow a reference's art style, and removeBackground for the dedicated background-removal case. Pass an optional request_id to tag the results so you can retrieve them later via getImageResults. Requires an API key (user scope).

`POST /assets/image/edit`

## Request body

- EditImagePayload — Payload for editing an existing image based on text instructions
  - `image` string, required — URL or base64-encoded source image to edit.
  - `prompt` string, required — Text description of the changes to make (e.g., "remove the background", "add clouds to the sky", "make it darker", "change the color scheme to warmer tones").
  - `reference_image` string — Optional URL or base64-encoded reference image for style or content guidance.
  - `n` number — Number of edited variations to generate (1-4).
  - `augment_prompt` boolean — Augment the prompt behind the scenes. Disable to have more control.
  - `request_id` string — Optional client-provided identifier for this request. Use this to retrieve results later via the results endpoint.

## Response `200`

Success

- ImageResult[]
  - `url` string
  - `request_id` string
  - `created_at` integer

## Other responses

- `400` — Error

---

[API](https://skmtc.net/ludo/apis/ludo-ai-api.md) · [All operations](https://skmtc.net/ludo/apis/ludo-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ludo/ludo-ai-api/revisions/3af866d68651/schema)
