Skip to main content
POST
Create GPT Image 2 — Edit

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

Pricing

From $0.0042/image apisale price is 30% below the vendor’s official list price.
Official price = vendor list price. apisale price = what you pay through apisale.

Volume tiers

**low / <=1.1MP (all presets + 1280x720; actual 0.0110.012)0.011-0.012)** — 5000+ → $0.0034 **low / 1.1-4.5MP (2560x1440 actual 0.0145)0.0145)** — 5000+ → $0.0084 **low / >4.5MP (3840x2160 actual ~0.020)0.020)** — 5000+ → $0.011 **medium / <=0.8MP (landscape_4_3 etc., actual 0.04)0.04)** — 5000+ → $0.030 **medium / 0.8-1.1MP (square_hd 1024x1024, actual 0.06)0.06)** — 5000+ → $0.030 medium / 1.1-4.5MP (non-monotonic: 1920x1080=0.04,2560x1440=0.04, 2560x1440=0.06; use max)5000+5000+ → 0.034 **medium / >4.5MP (3840x2160 actual 0.11)0.11)** — 5000+ → $0.062 high / <=0.8MP (landscape_4_3=0.15, portrait_4_3=0.17)5000+5000+ → 0.118 **high / 0.8-1.1MP (square_hd 1024x1024 actual 0.22)0.22)** — 5000+ → $0.118 high / 1.1-4.5MP (2560x1440=0.23;1920x1080=0.23; 1920x1080=0.16 non-monotonic, use max)5000+5000+ → 0.129 **high / >4.5MP (3840x2160 actual 0.41;automappedhere)0.41; auto mapped here)** — 5000+ → $0.230

Request

Parameters

Fields marked * are required. Use Authorization: Key YOUR_API_KEY for REST.
string
required
Text prompt describing the image. Maximum 32000 characters.
string
Default: high Values: auto, low, medium, high
string
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, auto
array
required
Input image URLs for editing (1-16 images).
number
Number of images to generate (1-4). Default: 1 Range: 1 – 4
string
Default: png Values: jpeg, png, webp
string
Optional HTTPS webhook when the run reaches a terminal state.
boolean
Block until completion (same Run response shape).

Submit response

Returns a Run with run_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)

Full lifecycle: Runs lifecycle.

Output

When status is succeeded, output follows this schema:

Example

Authorizations

Authorization
string
header
required

Key sk-... (native REST) or Bearer sk-... (vendor SDKs)

Body

application/json
input
object
required
Example:
webhook_url
string<uri>
sync
boolean
default:false

Response

201 - application/json

Run accepted

run_id
string
required

Unique run identifier

endpoint
string
required

Model slug

model
string
required
capability
string
required
mode
string
required
status
enum<string>
required
Available options:
queued,
processing,
succeeded,
failed,
timeout,
cancelled
created_at
string<date-time>
required
output
object | null
error
object | null
billing
object | null
started_at
string<date-time> | null
completed_at
string<date-time> | null
elapsed_ms
number | null