---
title: "Edit an existing image"
method: POST
path: "/images/edits"
tags: ["images"]
---

# Edit an existing image

`POST /images/edits`

## Request

- Base URL: `https://api.krater.ai/v1`
- URL: `https://api.krater.ai/v1/images/edits`
- Auth: HTTP bearer

Transform an existing image with a text prompt. Pass the source image as a public URL in image_url (a single URL, or an array of URLs for models that accept multiple reference images). Credits vary by model, from about 6 to 70 per edit.

## Request body

- ImageEditRequest
  - `prompt` string, required: How to transform the image.
  - `image_url` union, required: Public URL of the source image, or an array of URLs for models that accept multiple references.
    - string, uri
    - string[]
  - `model` string: Image model identifier.
  - `strength` number: How strongly to transform the source image.
  - `size` string: Output size or aspect ratio, model dependent.
  - `resolution` string: Output resolution for models that support it.
  - `quality` string: Quality setting for models that support it.
  - `style` string: Style preset for models that support it.
  - `version` string: Specific model version to pin.

## Response `200`

Edited image URLs.

- ImageResponse
  - `created` integer, required: Unix timestamp.
  - `data` object[], required
    - `url` string, uri, required: URL of the generated image.

## Other responses

- `400`: Invalid request body or parameters.
- `401`: Missing or invalid API key. Pass Authorization: Bearer kr_live_...
- `402`: Not enough credits, or the API key's daily credit cap is reached.
- `429`: Rate limit exceeded (default 60 requests per minute per key). Includes a Retry-After header.

---

[API](https://skmtc.dev/krater/apis/krater-api.md) - [All operations](https://skmtc.dev/krater/apis/krater-api/llms.txt) - [OpenAPI document](https://skmtc.dev/krater/apis/krater-api/revisions/66005541188c?raw)
