# GPT Image 2 Edit > GPT Image 2.0, OpenAI's latest image model, is capable of making fine-grained, detailed edits to images. ## Overview - **Endpoint**: `https://api.runflow.io/v1/run/openai/gpt-image-2/edit` - **Model ID**: `openai/gpt-image-2/edit` - **Provider**: OpenAI - **License**: commercial - **Last Updated**: 2026-04-21 ## Pricing - **Base price**: $0.133/image - **Note**: High quality (default) ## Input Schema ### `prompt` (string, required) The prompt for image generation ### `image_urls` (image_list, required) The URLs of the images to use as a reference for the generation. ### `num_images` (integer, optional) Number of images to generate - **Default**: `1` - **Min**: 1 - **Max**: 4 ### `output_format` (string, optional) Output format for the images - **Default**: `png` ### `image_size` (string, optional) The size of the generated image. Use 'auto' to infer from input images. - **Default**: `auto` ### `mask_url` (image, optional) The URL of the mask image to use for the generation. This indicates what part of the image to edit. ### `quality` (string, optional) Quality for the generated image - **Default**: `high` ### `sync_mode` (boolean, optional) If `True`, the media will be returned as a data URI and the output data won't be available in the request history. - **Default**: `false` ## Usage Examples ### cURL ```bash curl -X POST https://api.runflow.io/v1/run/openai/gpt-image-2/edit \ -H "Authorization: Bearer $RUNFLOW_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A professional headshot, soft studio lighting", "output_format": "png" }' ``` ### Python ```python import requests response = requests.post( "https://api.runflow.io/v1/run/openai/gpt-image-2/edit", headers={"Authorization": "Bearer RUNFLOW_API_KEY"}, json={ "prompt": "A professional headshot, soft studio lighting", "output_format": "png", }, ) data = response.json() print(data["images"][0]["url"]) ``` ### JavaScript ```javascript const response = await fetch( "https://api.runflow.io/v1/run/openai/gpt-image-2/edit", { method: "POST", headers: { "Authorization": "Bearer RUNFLOW_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ prompt: "A professional headshot, soft studio lighting", output_format: "png", }), } ); const data = await response.json(); console.log(data.images[0].url); ``` ## Additional Resources - [Playground](https://www.runflow.io/models/openai/gpt-image-2/edit) - [API Reference](https://www.runflow.io/models/openai/gpt-image-2/edit/api) - [Documentation](https://docs.runflow.io) - [OpenAPI](https://api.runflow.io/v1/openapi.json)