GPT Image 1.5 Edit
Transform image edits with precision using natural language instructions for seamless creative workflows.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/gpt-image-1.5-edit"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "A photorealistic wide drone shot of a colossal man (exact face/body from the reference) casually sitting across a London street, one knee raised, hand resting. He wears a navy overcoat, knit sweater, dark trousers, boots, and a minimalist beanie. Tiny cars, buses, bikes, and pedestrians move around him, with classic London red-brick buildings, black lamps, and cobblestone streets dwarfed by his size. Soft overcast London daylight highlights wet pavement.",
12 "image_urls": [
13 "https://segmind-resources.s3.amazonaws.com/input/92a8e420-2d12-48c0-97f5-73c6c4820c34-black-man-image.jpeg"
14 ],
15 "mask": null,
16 "size": "auto",
17 "quality": "high",
18 "background": "opaque",
19 "output_compression": 100,
20 "output_format": "png",
21 "moderation": "auto"
22}
23
24response = requests.post(url, headers=headers, json=data)
25
26if response.status_code == 200:
27 result = response.json()
28 print(json.dumps(result, indent=2))
29else:
30 print(f"Error: {response.status_code}")
31 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/gpt-image-1.5-edit"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "A photorealistic wide drone shot of a colossal man (exact face/body from the reference) casually sitting across a London street, one knee raised, hand resting. He wears a navy overcoat, knit sweater, dark trousers, boots, and a minimalist beanie. Tiny cars, buses, bikes, and pedestrians move around him, with classic London red-brick buildings, black lamps, and cobblestone streets dwarfed by his size. Soft overcast London daylight highlights wet pavement.",
12 "image_urls": [
13 "https://segmind-resources.s3.amazonaws.com/input/92a8e420-2d12-48c0-97f5-73c6c4820c34-black-man-image.jpeg"
14 ],
15 "mask": null,
16 "size": "auto",
17 "quality": "high",
18 "background": "opaque",
19 "output_compression": 100,
20 "output_format": "png",
21 "moderation": "auto"
22}
23
24response = requests.post(url, headers=headers, json=data)
25
26if response.status_code == 200:
27 result = response.json()
28 print(json.dumps(result, indent=2))
29else:
30 print(f"Error: {response.status_code}")
31 print(response.text)API Endpoint
https://api.segmind.com/v1/gpt-image-1.5-editParameters
image_urlsrequiredstring[]Links to reference images.
maskrequiredstring (uri)Image to be used as a base. Leave null to upload later.
promptrequiredstringText prompt guides image generation. Example: 'A cyberpunk city skyline at night.'
""backgroundoptionalstringBackground type for the image. Transparent is useful for overlays.
"opaque""transparent""opaque"moderationoptionalstringSets moderation strictness. 'low' relaxes content restrictions.
"auto""low""auto"output_compressionoptionalintegerDefines output image compression level. Use 100 for best quality.
95output_formatoptionalstringSpecifies the output image format. Use 'png' for high-quality needs.
"png""png""jpeg""webp"qualityoptionalstringSets visual quality. 'auto' balances detail and performance.
"high""low""medium""high""auto"sizeoptionalstringChoose image resolution. 'auto' balances speed and quality.
"auto""1024x1024""1536x1024""1024x1536""auto"Response Type
Returns: Image
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out