Model IDDocumentation Index
Fetch the complete documentation index at: https://docs.gmicloud.ai/llms.txt
Use this file to discover all available pages before exploring further.
gpt-image-2-edit API Usage Guide
Overview
gpt-image-2-edit uses OpenAI’s GPT Image 2 model to edit or transform an existing image based on a text prompt. It supports two modes:- Image Edit: Modify an image according to a prompt (e.g. change background, style transfer)
- Inpainting: Edit a specific region of an image using a mask (white pixels are edited, black pixels are preserved)
Authentication
Submit Image Edit Request
Endpoint
Image Edit (no mask)
Inpainting (with mask)
Request Parameters
| Parameter | Type | Required | Description | Default | Constraints |
|---|---|---|---|---|---|
model | string | Yes | Model identifier | - | Must be "gpt-image-2-edit" |
payload.prompt | string | Yes | Text instruction describing the desired edit | - | - |
payload.image | string | Yes | Input image as base64-encoded string or publicly accessible URL | - | Must be a valid image |
payload.mask | string | No | Mask image for inpainting. White pixels are edited, black pixels are preserved. Must match the dimensions of image. | - | Same size as input image |
payload.size | string (enum) | No | Dimensions of the output image | "1024x1024" | "1024x1024", "1024x1536", "1536x1024" |
payload.quality | string (enum) | No | Image quality level, affects detail and cost | "medium" | "low", "medium", "high", "auto" |
payload.n | integer | No | Number of images to generate | 1 | Min: 1, Max: 10 |