---
title: "Precise Edit Image"
method: POST
path: "/media/precise-edit"
tags: ["media"]
---

# Precise Edit Image

`POST /media/precise-edit`

## Request

- Base URL: `https://api.moda.app/v1`
- URL: `https://api.moda.app/v1/media/precise-edit`
- Auth: HTTP bearer

Repaint one region of an image from a prompt, at its full resolution (metered, Ideogram direct API).

## Headers

- `Moda-Version` '2026-04-12' | '2026-05-01'

## Request body

- PreciseEditImageRequest
  - `image` string, required: file_ id or http(s) URL of the image to edit (PNG, JPEG or WebP; up to 8192x8192).
  - `prompt` string, required: What to change inside the edited area.
  - `mask` string, nullable: file_ id or http(s) URL of a mask: white marks the area to edit, black or transparent the area to keep (white strokes on a transparent layer work). Resized to the image.
  - `context_window` string, nullable: Which region to edit at full resolution: auto (fit around the mask), none (edit the whole image; over 2048x2048 of area it comes back scaled down), or y_min,x_min,y_max,x_max in the image's own pixels, rows first, max edges exclusive (each side >= 256px, area <= 4194304px, aspect within 6:1). Default: auto with a mask, none without. Pixels outside the region come back unchanged.
  - `quality` 'very_low' | 'low' | 'medium' | 'high': Rendering quality; the only field that changes the price.
  - `seed` integer, nullable
  - `model` 'ideogram-precise-edit'
  - `idempotency_key` string, nullable: A retried call with the same key replays the stored response (replayed:true) instead of paying for a second provider render.

## Response `200`

Successful Response

- object

## Other responses

- `401`: Authentication required.
- `402`: Insufficient credits for a metered operation.
- `403`: Permission denied for this scope.
- `404`: Resource not found.
- `409`: Conflict (idempotency / resource state).
- `422`: Request validation failed.
- `429`: Rate limit exceeded.
- `500`: Internal error.

## Changes

- **2026-11-03** `9ac6a3abc0f8`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/moda/apis/moda-public-api/changes/media/precise-edit/post.md)

---

[API](https://skmtc.dev/moda/apis/moda-public-api.md) - [All operations](https://skmtc.dev/moda/apis/moda-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/moda/apis/moda-public-api/revisions/9ac6a3abc0f8?raw)
