Create GPT Image 2 — Edit
curl --request POST \
--url https://api.apisale.ai/v1/run/openai/gpt-image-2/edit \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"prompt": "A cinematic product photograph on a clean studio backdrop, soft directional lighting, ultra sharp detail.",
"quality": "high",
"image_size": "auto",
"num_images": 1,
"output_format": "png"
}
}
'import requests
url = "https://api.apisale.ai/v1/run/openai/gpt-image-2/edit"
payload = { "input": {
"prompt": "A cinematic product photograph on a clean studio backdrop, soft directional lighting, ultra sharp detail.",
"quality": "high",
"image_size": "auto",
"num_images": 1,
"output_format": "png"
} }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: {
prompt: 'A cinematic product photograph on a clean studio backdrop, soft directional lighting, ultra sharp detail.',
quality: 'high',
image_size: 'auto',
num_images: 1,
output_format: 'png'
}
})
};
fetch('https://api.apisale.ai/v1/run/openai/gpt-image-2/edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"run_id": "<string>",
"endpoint": "<string>",
"model": "<string>",
"capability": "<string>",
"mode": "<string>",
"status": "queued",
"created_at": "2023-11-07T05:31:56Z",
"output": {},
"error": {
"type": "<string>",
"code": 123,
"message": "<string>"
},
"billing": {
"amount": "<string>",
"currency": "usd"
},
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"elapsed_ms": 123
}Openai
GPT Image 2 — Edit
OpenAI GPT Image 2, fine typography and high-fidelity image generation / edit. Optimized for image to image via apisale.
POST
/
v1
/
run
/
openai
/
gpt-image-2
/
edit
Create GPT Image 2 — Edit
curl --request POST \
--url https://api.apisale.ai/v1/run/openai/gpt-image-2/edit \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"prompt": "A cinematic product photograph on a clean studio backdrop, soft directional lighting, ultra sharp detail.",
"quality": "high",
"image_size": "auto",
"num_images": 1,
"output_format": "png"
}
}
'import requests
url = "https://api.apisale.ai/v1/run/openai/gpt-image-2/edit"
payload = { "input": {
"prompt": "A cinematic product photograph on a clean studio backdrop, soft directional lighting, ultra sharp detail.",
"quality": "high",
"image_size": "auto",
"num_images": 1,
"output_format": "png"
} }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: {
prompt: 'A cinematic product photograph on a clean studio backdrop, soft directional lighting, ultra sharp detail.',
quality: 'high',
image_size: 'auto',
num_images: 1,
output_format: 'png'
}
})
};
fetch('https://api.apisale.ai/v1/run/openai/gpt-image-2/edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"run_id": "<string>",
"endpoint": "<string>",
"model": "<string>",
"capability": "<string>",
"mode": "<string>",
"status": "queued",
"created_at": "2023-11-07T05:31:56Z",
"output": {},
"error": {
"type": "<string>",
"code": 123,
"message": "<string>"
},
"billing": {
"amount": "<string>",
"currency": "usd"
},
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"elapsed_ms": 123
}Overview
OpenAI GPT Image 2, fine typography and high-fidelity image generation / edit. Optimized for image to image via apisale.Docs = API contract + Try it (snapshot). Explore = browser playground. Model page = product examples.
Endpoint
POST https://api.apisale.ai/v1/run/openai/gpt-image-2/edit
| Model slug | openai/gpt-image-2/edit |
| Category | Image To Image (image-to-image) |
| Lab | Openai |
| Mode | async |
Pricing
From $0.0042/image apisale price is 30% below the vendor’s official list price.| Tier | Unit | Official price | apisale price |
|---|---|---|---|
| low / <=1.1MP (all presets + 1280x720; actual $0.011-0.012) | image | $0.0060 | $0.0042 |
| low / 1.1-4.5MP (2560x1440 actual $0.0145) | image | $0.015 | $0.011 |
| low / >4.5MP (3840x2160 actual ~$0.020) | image | $0.020 | $0.014 |
| medium / <=0.8MP (landscape_4_3 etc., actual $0.04) | image | $0.053 | $0.037 |
| medium / 0.8-1.1MP (square_hd 1024x1024, actual $0.06) | image | $0.053 | $0.037 |
| medium / 1.1-4.5MP (non-monotonic: 1920x1080=0.04,2560x1440=0.06; use max) | image | $0.060 | $0.042 |
| medium / >4.5MP (3840x2160 actual $0.11) | image | $0.110 | $0.077 |
| high / <=0.8MP (landscape_4_3=0.15, portrait_4_3=0.17) | image | $0.211 | $0.148 |
| high / 0.8-1.1MP (square_hd 1024x1024 actual $0.22) | image | $0.211 | $0.148 |
| high / 1.1-4.5MP (2560x1440=0.23;1920x1080=0.16 non-monotonic, use max) | image | $0.230 | $0.161 |
| high / >4.5MP (3840x2160 actual $0.41; auto mapped here) | image | $0.410 | $0.287 |
Official price = vendor list price. apisale price = what you pay through apisale.
Volume tiers
**low / <=1.1MP (all presets + 1280x720; actual 0.011−0.012)∗∗—5000+ → $0.0034 **low / 1.1-4.5MP (2560x1440 actual 0.0145)∗∗—5000+ → $0.0084 **low / >4.5MP (3840x2160 actual ~0.020)∗∗—5000+ → $0.011 **medium / <=0.8MP (landscape_4_3 etc., actual 0.04)∗∗—5000+ → $0.030 **medium / 0.8-1.1MP (square_hd 1024x1024, actual 0.06)∗∗—5000+ → $0.030 medium / 1.1-4.5MP (non-monotonic: 1920x1080=0.04,2560x1440=0.06; use max) — 5000+→0.034 **medium / >4.5MP (3840x2160 actual 0.11)∗∗—5000+ → $0.062 high / <=0.8MP (landscape_4_3=0.15, portrait_4_3=0.17) — 5000+→0.118 **high / 0.8-1.1MP (square_hd 1024x1024 actual 0.22)∗∗—5000+ → $0.118 high / 1.1-4.5MP (2560x1440=0.23;1920x1080=0.16 non-monotonic, use max) — 5000+→0.129 **high / >4.5MP (3840x2160 actual 0.41;automappedhere)∗∗—5000+ → $0.230Request
{
"input": {
"prompt": "A cinematic product photograph on a clean studio backdrop, soft directional lighting, ultra sharp detail.",
"quality": "high",
"image_size": "auto",
"num_images": 1,
"output_format": "png"
}
}
Parameters
Fields marked * are required. UseAuthorization: Key YOUR_API_KEY for REST.
string
required
Text prompt describing the image. Maximum 32000 characters.
string
Default:
high Values: auto, low, medium, highstring
Optional mask image URL (PNG with transparency). Edited region is transparent or white.
string
Preset name or custom {width,height}. Custom: both dims multiple of 16, max edge 3840px, aspect ratio 1:3 to 3:1, total pixels 655360-8294400. Default:
auto Values: square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9, autoarray
required
Input image URLs for editing (1-16 images).
number
Number of images to generate (1-4). Default:
1 Range: 1 – 4string
Default:
png Values: jpeg, png, webpstring
Optional HTTPS webhook when the run reaches a terminal state.
boolean
Block until completion (same Run response shape).
Input schema
Input schema
{
"params": {
"prompt": {
"type": "string",
"required": true,
"max_length": 32000,
"description": "Text prompt describing the image. Maximum 32000 characters."
},
"quality": {
"type": "enum",
"values": [
"auto",
"low",
"medium",
"high"
],
"default": "high"
},
"mask_url": {
"role": "mask",
"type": "media",
"description": "Optional mask image URL (PNG with transparency). Edited region is transparent or white."
},
"image_size": {
"type": "string",
"values": [
"square_hd",
"square",
"portrait_4_3",
"portrait_16_9",
"landscape_4_3",
"landscape_16_9",
"auto"
],
"default": "auto",
"description": "Preset name or custom {width,height}. Custom: both dims multiple of 16, max edge 3840px, aspect ratio 1:3 to 3:1, total pixels 655360-8294400."
},
"image_urls": {
"type": "array<media>",
"required": true,
"max_items": 16,
"min_items": 1,
"description": "Input image URLs for editing (1-16 images)."
},
"num_images": {
"max": 4,
"min": 1,
"type": "int",
"default": 1,
"description": "Number of images to generate (1-4)."
},
"output_format": {
"type": "enum",
"values": [
"jpeg",
"png",
"webp"
],
"default": "png"
}
}
}
Submit response
Returns a Run withrun_id. Poll with GET /v1/runs/{run_id} or use Try it above.
string
required
Unique run ID — save for polling and webhooks.
string
required
queued (async) or terminal state for sync runs.object
Result when
status is succeeded — see Output schema below.Example (async submit)
{
"run_id": "run_550e8400-e29b-41d4-a716-446655440000",
"endpoint": "openai/gpt-image-2/edit",
"model": "edit",
"capability": "image",
"mode": "image-to-image",
"status": "queued",
"output": null,
"error": null,
"billing": null,
"created_at": "2026-06-27T12:00:00.000Z",
"started_at": null,
"completed_at": null,
"elapsed_ms": null
}
Output
Whenstatus is succeeded, output follows this schema:
Output schema
Output schema
{
"type": "object",
"example": {
"images": [
{
"url": "https://cdn.mountsea.ai/tasks/ms-example/0.png",
"mime": "image/png"
}
]
},
"required": [
"images"
],
"properties": {
"images": {
"type": "array",
"items": {
"type": "object",
"properties": {
"b64": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri"
},
"mime": {
"type": "string"
}
}
}
}
},
"description": "Succeeded task output: normalized images."
}
Example
curl -X POST "https://api.apisale.ai/v1/run/openai/gpt-image-2/edit" \
-H "Authorization: Key YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"prompt": "A cinematic product photograph on a clean studio backdrop, soft directional lighting, ultra sharp detail.",
"quality": "high",
"image_size": "auto",
"num_images": 1,
"output_format": "png"
}
}'
Related
Authorizations
Key sk-... (native REST) or Bearer sk-... (vendor SDKs)
Body
application/json
Response
201 - application/json
Run accepted
Unique run identifier
Model slug
Available options:
queued, processing, succeeded, failed, timeout, cancelled Show child attributes
Show child attributes
Show child attributes
Show child attributes
