---
title: "Inpaint Endpoint"
method: POST
path: "/v1/images/edit"
tags: ["images"]
---

# Inpaint Endpoint

`POST /v1/images/edit`

## Request

- Base URL: `https://api.corent.tech` (the document declares no server; this is the origin it was published from)
- URL: `https://api.corent.tech/v1/images/edit`
- Auth: HTTP bearer

Regenerate ONLY the masked region and leave every other pixel alone.

Different from reference_image_urls on /v1/images/generate: that
REGENERATES your subject from a reference, so its logo and colour are a
likeness, not a copy. This preserves the unmasked pixels exactly, which is
what an advertisement needs when the product carries someone's trademark.

## Headers

- `Idempotency-Key` string, nullable

## Request body

- InpaintRequest
  - `image_url` string, required: Public https URL of the image to edit.
  - `mask_url` string, required: Public https URL of a black-and-white mask, same size as the image. WHITE marks the region to regenerate; BLACK is preserved byte for byte. That is the whole point: outside the mask the delivered pixels are your own file, so 'the product was not altered' is provable, not hoped for.
  - `prompt` string, required: What to generate inside the masked region.
  - `tier` string, nullable: Accepted and ignored: inpainting is flat-priced and does not route by tier.
  - `customer_id` string, nullable: Optional tag for YOUR end user, so you can attribute spend: 1 to 128 characters from A-Z a-z 0-9 . _ : @ -. Stored on the job, returned on receipts, and filterable with GET /v1/account/usage?customer_id=...

## Response `200`

Successful Response

- ImageToolResponse
  - `id` string, required
  - `status` string, required
  - `images` GeneratedImage[], required
    - `url` string, required
    - `width` integer, required
    - `height` integer, required
    - `source_url` string, nullable: To use a realistic character as a video reference on corent-seedance-2.5, pass source_url within 24 hours.
    - `source_url_expires_at` string, nullable: When source_url stops working (ISO 8601, 24 hours after the render).
  - `meta` AppRoutersImagesGenerationMeta, required
    - `model` string, required
    - `cost_cents` integer, required
    - `duration_ms` integer, required
    - `seed` integer, nullable
    - `unsupported_options` string[], nullable

## Other responses

- `400`: Invalid request (bad parameters or input).
- `401`: Missing or invalid API key.
- `402`: Insufficient prepaid balance.
- `403`: API key lacks the required capability scope.
- `422`: Prompt not allowed, or request failed validation.
- `429`: Rate limit, concurrency, or daily spend cap reached.
- `502`: Every eligible provider failed; try again.
- `503`: No provider currently available for this request.

---

[API](https://skmtc.dev/corent/apis/corent-api.md) · [All operations](https://skmtc.dev/corent/apis/corent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/corent/apis/corent-api/revisions/57168ff53efe?raw)
