Image Editing
Edit existing images using GPT Image series models based on text prompts.Endpoint
POST /v1/images/edits
Authentication
All requests require a Bearer token in the Authorization header:Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model ID, e.g., gpt-image-1 |
| image | file/string | Yes | Image to edit, can be a file or URL |
| prompt | string | Yes | Text describing how to edit the image |
| mask | file/string | No | Mask image specifying the area to edit |
| n | integer | No | Number of images to generate, default 1 |
| size | string | No | Image size, default 1024x1024 |
| response_format | string | No | Response format, options: url, b64_json, default url |
Request Example
Response Example
Response Fields
| Field | Type | Description |
|---|---|---|
| created | integer | Creation timestamp |
| data | array | List of edited images |
| data[].url | string | Image URL |
| data[].b64_json | string | Base64 encoded image |
| data[].revised_prompt | string | Model’s revised prompt |