# GPT Image 2.5 Flare Image Editing

> Image Generation

Edit a single image, optionally constrained by a `mask`, or compose
multiple reference images into a new image by repeating the multipart
`image[]` field.

## Endpoint

`POST https://api.modelverse.cn/v1/images/edits`

## Request Body

## Responses

- **200** — Image edit response.
- **400** — Invalid request parameters or editing error.
- **default** — Error response.

## OpenAPI Definition

```json
{
  "openapi": "3.1.0",
  "x-language": "en-US",
  "info": {
    "title": "ModelVerse gpt-image-2.5-flare Image API",
    "version": "1.0.0",
    "description": "Self-contained OpenAPI 3.1 schema for the ModelVerse OpenAI-compatible\\r\\n    `gpt-image-2.5-flare` image generation and image editing APIs.\n"
  },
  "servers": [
    {
      "url": "https://api.modelverse.cn",
      "description": "ModelVerse API endpoint documented for this model."
    }
  ],
  "tags": [
    {
      "name": "gpt-image-2.5-flare",
      "description": "Image generation, localized image editing, and multi-image composition with gpt-image-2.5-flare."
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/images/generations": {
      "post": {
        "tags": [
          "gpt-image-2.5-flare"
        ],
        "operationId": "createGptImage25FlareImageGeneration",
        "summary": "GPT Image 2.5 Flare Image Generation",
        "description": "Generate one or more images from a text prompt. The documented\n`gpt-image-2.5-flare` response returns base64 image data in `data[].b64_json`.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GptImage25FlareGenerationRequest"
              },
              "examples": {
                "flower": {
                  "summary": "Generate a PNG image",
                  "value": {
                    "model": "gpt-image-2.5-flare",
                    "prompt": "a beautiful flower",
                    "size": "1024x1024",
                    "quality": "high",
                    "background": "transparent",
                    "output_format": "png",
                    "output_compression": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Image generation response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GptImage25FlareImagesResponse"
                },
                "examples": {
                  "generatedImage": {
                    "summary": "Generated image with token usage",
                    "value": {
                      "created": 1750667997,
                      "data": [
                        {
                          "b64_json": "{image_base64_string}"
                        }
                      ],
                      "background": "transparent",
                      "output_format": "png",
                      "quality": "high",
                      "size": "1024x1024",
                      "usage": {
                        "total_tokens": 4169,
                        "input_tokens": 9,
                        "output_tokens": 4160,
                        "input_tokens_details": {
                          "text_tokens": 9
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters or generation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GptImage25FlareErrorResponse"
                },
                "examples": {
                  "documentedError": {
                    "$ref": "#/components/examples/GptImage25FlareError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GptImage25FlareErrorResponse"
                },
                "examples": {
                  "documentedError": {
                    "$ref": "#/components/examples/GptImage25FlareError"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/images/edits": {
      "post": {
        "tags": [
          "gpt-image-2.5-flare"
        ],
        "operationId": "createGptImage25FlareImageEdit",
        "summary": "GPT Image 2.5 Flare Image Editing",
        "description": "Edit a single image, optionally constrained by a `mask`, or compose\nmultiple reference images into a new image by repeating the multipart\n`image[]` field.\n",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/GptImage25FlareEditRequest"
              },
              "encoding": {
                "image": {
                  "contentType": "image/png"
                },
                "mask": {
                  "contentType": "image/png"
                },
                "image[]": {
                  "contentType": "image/png",
                  "style": "form",
                  "explode": true
                }
              },
              "examples": {
                "localizedEdit": {
                  "summary": "Localized edit with an optional mask",
                  "value": {
                    "image": "/path/to/your/image.png",
                    "mask": "/path/to/your/mask.png",
                    "model": "gpt-image-2.5-flare",
                    "prompt": "Add a beach ball in the center",
                    "size": "1024x1024",
                    "n": 1,
                    "quality": "low",
                    "background": "opaque",
                    "output_format": "png",
                    "output_compression": 100
                  }
                },
                "multiImageComposition": {
                  "summary": "Compose multiple images by repeating image[]",
                  "value": {
                    "model": "gpt-image-2.5-flare",
                    "image[]": [
                      "./body-lotion.png",
                      "./bath-bomb.png",
                      "./incense-kit.png",
                      "./soap.png"
                    ],
                    "prompt": "a beautiful gift basket containing all these products arranged elegantly"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Image edit response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GptImage25FlareImagesResponse"
                },
                "examples": {
                  "editedImage": {
                    "summary": "Generated image with token usage",
                    "value": {
                      "created": 1750668025,
                      "data": [
                        {
                          "b64_json": "{edited_image_base64}"
                        }
                      ],
                      "background": "opaque",
                      "output_format": "png",
                      "quality": "low",
                      "size": "1024x1024",
                      "usage": {
                        "total_tokens": 8290,
                        "input_tokens": 4170,
                        "output_tokens": 4120,
                        "input_tokens_details": {
                          "text_tokens": 10,
                          "image_tokens": 4160
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters or editing error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GptImage25FlareErrorResponse"
                },
                "examples": {
                  "documentedError": {
                    "$ref": "#/components/examples/GptImage25FlareError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GptImage25FlareErrorResponse"
                },
                "examples": {
                  "documentedError": {
                    "$ref": "#/components/examples/GptImage25FlareError"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "GptImage25FlareModel": {
        "type": "string",
        "enum": [
          "gpt-image-2.5-flare"
        ],
        "description": "The model to use for image generation. Supports gpt-image-2.5-flare and its snapshot versions.\n"
      },
      "GptImage25FlarePrompt": {
        "type": "string",
        "maxLength": 32000,
        "description": "A text description of the desired image(s). Maximum length is 32000 characters for gpt-image-2.5-flare.\n"
      },
      "GptImage25FlareImageCount": {
        "type": "integer",
        "minimum": 1,
        "maximum": 10,
        "default": 1,
        "description": "The number of images to generate. Must be between 1 and 10.\n"
      },
      "GptImage25FlareSize": {
        "type": "string",
        "default": "auto",
        "description": "The size of the generated images. Supports arbitrary resolutions as `WIDTHxHEIGHT` strings (e.g., 1536x864).\nWidth and height must both be divisible by 16, and the aspect ratio must be between 1:3 and 3:1.\nMaximum supported resolution is 3840x2160.\n",
        "x-max-aspect-ratio": "3:1",
        "x-min-aspect-ratio": "1:3",
        "oneOf": [
          {
            "const": "auto"
          },
          {
            "pattern": "^[1-9][0-9]*x[1-9][0-9]*$"
          }
        ],
        "examples": [
          "1024x1024",
          "1024x1536",
          "1536x1024",
          "2048x2048",
          "2048x1152",
          "2160x3840",
          "2560x1440",
          "3840x2160"
        ]
      },
      "GptImage25FlareQuality": {
        "type": "string",
        "enum": [
          "low",
          "medium",
          "high",
          "xhigh",
          "max"
        ],
        "description": "The quality of the image to be generated.\n- `low`: Low quality\n- `medium`: Medium quality\n- `high`: High quality (may take longer)\n- `xhigh`: Extra high quality\n- `max`: Maximum quality\n"
      },
      "GptImage25FlareBackground": {
        "type": "string",
        "enum": [
          "transparent",
          "opaque",
          "auto"
        ],
        "default": "auto",
        "description": "Set the background of the generated image(s).\n- `transparent`: Transparent background (requires output_format to be png)\n- `opaque`: Opaque background\n- `auto`: Automatically determine the best background (default)\n"
      },
      "GptImage25FlareModeration": {
        "type": "string",
        "enum": [
          "low",
          "auto"
        ],
        "default": "auto",
        "description": "Control the content-moderation level for images generated.\n- `low`: Less restrictive filtering\n- `auto`: Default moderation level\n"
      },
      "GptImage25FlareOutputFormat": {
        "type": "string",
        "enum": [
          "png",
          "jpeg"
        ],
        "default": "png",
        "description": "The format in which the generated images are returned.\n"
      },
      "GptImage25FlareOutputCompression": {
        "type": "integer",
        "minimum": 0,
        "maximum": 100,
        "default": 100,
        "description": "The compression level (0-100%) for the generated images. Only supported for jpeg formats.\n`0` disables compression, `100` applies maximum compression.\n"
      },
      "GptImage25FlareGenerationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "model",
          "prompt"
        ],
        "properties": {
          "model": {
            "$ref": "#/components/schemas/GptImage25FlareModel"
          },
          "prompt": {
            "$ref": "#/components/schemas/GptImage25FlarePrompt"
          },
          "n": {
            "$ref": "#/components/schemas/GptImage25FlareImageCount"
          },
          "size": {
            "$ref": "#/components/schemas/GptImage25FlareSize"
          },
          "quality": {
            "$ref": "#/components/schemas/GptImage25FlareQuality"
          },
          "background": {
            "$ref": "#/components/schemas/GptImage25FlareBackground"
          },
          "moderation": {
            "$ref": "#/components/schemas/GptImage25FlareModeration"
          },
          "output_format": {
            "$ref": "#/components/schemas/GptImage25FlareOutputFormat"
          },
          "output_compression": {
            "$ref": "#/components/schemas/GptImage25FlareOutputCompression"
          }
        }
      },
      "GptImage25FlareEditRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "model",
          "prompt"
        ],
        "anyOf": [
          {
            "required": [
              "image"
            ]
          },
          {
            "required": [
              "image[]"
            ]
          }
        ],
        "properties": {
          "image": {
            "type": "string",
            "format": "binary",
            "description": "Image file to edit for single-image local editing."
          },
          "image[]": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "format": "binary"
            },
            "description": "Repeated multipart image field for multi-image composition."
          },
          "mask": {
            "type": "string",
            "format": "binary",
            "description": "Optional mask file that limits the edited region."
          },
          "model": {
            "$ref": "#/components/schemas/GptImage25FlareModel"
          },
          "prompt": {
            "$ref": "#/components/schemas/GptImage25FlarePrompt"
          },
          "n": {
            "$ref": "#/components/schemas/GptImage25FlareImageCount"
          },
          "size": {
            "$ref": "#/components/schemas/GptImage25FlareSize"
          },
          "quality": {
            "$ref": "#/components/schemas/GptImage25FlareQuality"
          },
          "background": {
            "$ref": "#/components/schemas/GptImage25FlareBackground"
          },
          "moderation": {
            "$ref": "#/components/schemas/GptImage25FlareModeration"
          },
          "output_format": {
            "$ref": "#/components/schemas/GptImage25FlareOutputFormat"
          },
          "output_compression": {
            "$ref": "#/components/schemas/GptImage25FlareOutputCompression"
          }
        }
      },
      "GptImage25FlareImagesResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "created",
          "data"
        ],
        "properties": {
          "created": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp in seconds for when the request was created."
          },
          "data": {
            "type": "array",
            "minItems": 1,
            "description": "Generated image data. Returns base64 image data.",
            "items": {
              "$ref": "#/components/schemas/GptImage25FlareImageData"
            }
          },
          "background": {
            "type": "string",
            "enum": [
              "transparent",
              "opaque"
            ],
            "description": "Background type of the generated image."
          },
          "output_format": {
            "type": "string",
            "enum": [
              "png",
              "jpeg"
            ],
            "description": "The output format of the image generation."
          },
          "quality": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high",
              "xhigh",
              "max"
            ],
            "description": "The quality of the image generated."
          },
          "size": {
            "type": "string",
            "description": "Image size as a WIDTHxHEIGHT string."
          },
          "usage": {
            "$ref": "#/components/schemas/GptImage25FlareUsage"
          }
        }
      },
      "GptImage25FlareImageData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "b64_json"
        ],
        "properties": {
          "b64_json": {
            "type": "string",
            "description": "Base64-encoded image data, optionally prefixed as a data URL."
          }
        }
      },
      "GptImage25FlareUsage": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "total_tokens": {
            "type": "integer"
          },
          "input_tokens": {
            "type": "integer"
          },
          "output_tokens": {
            "type": "integer"
          },
          "input_tokens_details": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "text_tokens": {
                "type": "integer"
              },
              "image_tokens": {
                "type": "integer"
              }
            }
          },
          "output_tokens_details": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "text_tokens": {
                "type": "integer"
              },
              "image_tokens": {
                "type": "integer"
              }
            }
          }
        }
      },
      "GptImage25FlareErrorResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/GptImage25FlareError"
          }
        }
      },
      "GptImage25FlareError": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message."
          },
          "type": {
            "type": "string",
            "description": "Error type."
          },
          "param": {
            "type": "string",
            "description": "Request ID or related parameter."
          },
          "code": {
            "type": "string",
            "description": "Error code."
          }
        }
      }
    },
    "examples": {
      "GptImage25FlareError": {
        "summary": "Documented error response",
        "value": {
          "error": {
            "message": "error_message",
            "type": "error_type",
            "param": "request_id",
            "code": "error_code"
          }
        }
      }
    }
  }
}
```
