GPT Image 1 Edit

Edit and compose images using natural language with GPT Image 1 Edit, OpenAI’s powerful inpainting and multi-reference editing model. Perfect for marketing visuals, product updates, and creative asset generation.


API

If you're looking for an API, you can choose from your desired programming language.

POST
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 import requests import base64 # Use this function to convert an image file from the filesystem to base64 def image_file_to_base64(image_path): with open(image_path, 'rb') as f: image_data = f.read() return base64.b64encode(image_data).decode('utf-8') # Use this function to fetch an image from a URL and convert it to base64 def image_url_to_base64(image_url): response = requests.get(image_url) image_data = response.content return base64.b64encode(image_data).decode('utf-8') # Use this function to convert a list of image URLs to base64 def image_urls_to_base64(image_urls): return [image_url_to_base64(url) for url in image_urls] api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/gpt-image-1-edit" # Request payload data = { "prompt": "Make a picture of a 3D action figure toy, named 'Teena'. Display it in transparent blister packaging with 'Teena' in white text at the top. Action figure wears a trendy, chic outfit featuring a stylish crop top with high-waisted skinny jeans and fashionable heels. Include accessories: a smartphone with selfie stick, a small ring light, and a designer handbag beside the figure. Use minimalist cardboard packaging design in cute toy store style. Cartoonish, cute yet neat appearance.", "image_urls": [ "https://segmind-resources.s3.amazonaws.com/output/cf5d6d3d-9be2-4538-b6b2-3d8ff11594b9-Beach-walk.png" ], "size": "auto" } headers = {'x-api-key': api_key} response = requests.post(url, json=data, headers=headers) print(response.content) # The response is the generated image
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


promptstr * Affects Pricing

Text prompt used to generate the image.


image_urlsstr *

A list of images.


maskstr *

Input Image.


sizeenum:str ( default: auto ) Affects Pricing

Select image resolution. Square is the fastest to generate.

Allowed values:

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

GPT-Image-1 Edit: Precision Image Editing with the Power of Language and Vision

GPT-Image-1 Edit is OpenAI’s powerful inpainting and multi-reference image editing model that brings Photoshop-like control into the realm of natural language. Built for developers, creators, and AI toolmakers, it enables detailed visual edits, image composition, and object-level replacements—all guided by intuitive prompts. Whether you're modifying product shots, refining creative assets, or combining multiple visual inputs into a single composition, GPT-Image-1 Edit makes it seamless.

How It Works

Unlike the standard image generation model, GPT-Image-1 Edit focuses on transforming existing images. It supports four core editing capabilities:

  1. Inpainting with Masks: Upload an image and a corresponding mask (with an alpha channel). The model uses the prompt to fill the transparent areas of the mask with entirely new content—ideal for object replacement, background changes, or localized edits.

  2. Multi-Image Composition: Upload multiple reference images and describe how they should be combined. GPT-Image-1 Edit intelligently merges them into a single, coherent image. For example, uploading a soap bar, bath bomb, and lotion can generate a photorealistic gift basket.

  3. Style-Guided Transformation: Use one or more images to define the visual style, and let the model adapt another image accordingly.

  4. Partial Overwrites: Provide an image and ask the model to modify specific elements—like changing the sky in a landscape or replacing a product label.

The API uses standard multipart/form-data for image uploads and supports images up to 25MB with alpha channels for masks. Like the generation model, output can be customized in terms of format (PNG, JPEG, WebP), background transparency, and compression levels.

Use Cases and Applications

  • Marketing & Product Imagery: Instantly update packaging, create seasonal variants, or adapt visuals for different campaigns
  • eCommerce: Showcase products in different scenes, colors, or setups without redoing photoshoots
  • Editorial: Retouch or recompose photos with better framing, lighting, or subject arrangement
  • UI/UX & Game Design: Tweak icons, characters, or assets in existing compositions without starting from scratch
  • Creative Tools: Build powerful AI-powered editors or creative apps with intuitive prompt-based editing

Why It Matters

GPT-Image-1 Edit blurs the line between generative and traditional design tools. It empowers creators to edit with words, reduce manual retouching time, and generate asset variants rapidly. With its fine control over visual composition and the ability to combine references, it becomes a core building block for next-gen design tools, AI-assisted workflows, and content platforms looking to scale visual operations.

Cookie settings

We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept all", you consent to our use of cookies.