---
title: "Create Image Edit"
method: POST
path: "/images/edits"
tags: ["Images"]
---

# Create Image Edit

`POST /images/edits`

## Request

- Base URL: `https://gateway.obiguard.ai/v1`
- URL: `https://gateway.obiguard.ai/v1/images/edits`
- Auth: API key in header `x-obiguard-api-key`

## Request body `multipart/form-data`

- CreateImageEditRequest
  - `image` string, binary, required: The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.
  - `prompt` string, required: A text description of the desired image(s). The maximum length is 1000 characters.
  - `mask` string, binary: An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`.
  - `model` union: The model to use for image generation. Only `dall-e-2` is supported at this time.
    - string
    - 'dall-e-2'
  - `n` integer, nullable: The number of images to generate. Must be between 1 and 10.
  - `size` '256x256' | '512x512' | '1024x1024', nullable: The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`.
  - `response_format` 'url' | 'b64_json', nullable: The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated.
  - `user` string: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids).

## Response `200`

OK

- ImagesResponse
  - `created` integer, required
  - `data` Image[], required
    - `b64_json` string: The base64-encoded JSON of the generated image, if `response_format` is `b64_json`.
    - `url` string: The URL of the generated image, if `response_format` is `url` (default).
    - `revised_prompt` string: The prompt that was used to generate the image, if there was any revision to the prompt.

---

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