Edit image
Creates images from a prompt and one or more reference images, sent as files in a multipart form or as links.
Creates images from a prompt and one or more reference images, sent as files in a multipart form or as links.
apiKeyAuthorizationBearer <token>Your API key, sent as Authorization: Bearer <key>.
Idempotency-Key?stringA value of your choice, up to 255 characters. Sending the same value again does not create or charge a second request; it returns 409 instead.
length <= 255multipart/form-data- body
model*stringThe model to use.
"gpt-image-2""gpt-image-2-adobe""gpt-image-2.5""gpt-image-2.5-flare""gpt-image-2.5-sunburst""gpt-image-2.6""gpt-image-2.6-flare""gpt-image-2.6-sunburst""nano-banana-2""nano-banana-2.1""nano-banana-pro""nano-banana-2-1k""nano-banana-2-2k""nano-banana-2-4k""nano-banana-pro-1k""nano-banana-pro-2k""nano-banana-pro-4k"prompt*stringWhat the image should show. Up to 32,000 characters.
length <= 32000n?integerHow many images to make. A request uses n times the model’s credits. At most 10 at 1K, 4 at 2K and 2 at 4K.
1 <= value <= 101size?stringauto lets the model choose (on a model with one resolution, that resolution). The other values are 1K, 2K and 4K sizes; each model accepts the resolutions listed on its card at /models, at one price. See the sizes guide for the ratio of each. gpt-image-2-adobe and gpt-image-2.5-flare also take a width and height of your own: multiples of 16, up to 3840 px a side, no longer than 3:1, 655,360 to 8,294,400 pixels.
"auto""auto""1024x1024""1536x1024""1024x1536""1443x1090""1090x1443""1672x941""941x1672""1408x1120""1120x1408""1920x832""832x1920""1792x896""896x1792""1152x864""864x1152""1280x720""720x1280""1120x896""896x1120""1456x624""624x1456""1536x768""768x1536""2048x2048""2048x1360""1360x2048""2304x1728""1728x2304""2048x1152""1152x2048""2240x1792""1792x2240""2912x1248""1248x2912""3072x1536""1536x3072""2048x688""688x2048""2880x2880""3504x2336""2336x3504""3264x2448""2448x3264""3840x2160""2160x3840""3200x2560""2560x3200""3840x1648""1648x3840""3840x1920""1920x3840""3840x1280""1280x3840""2048x512""512x2048""3072x384""384x3072""4096x1024""1024x4096""6144x768""768x6144""8192x2048""2048x8192""12288x1536""1536x12288"quality?stringRendering quality, honoured by gpt-image-2-adobe and the flare and sunburst variants; the other GPT models choose it themselves and Nano Banana ignores it. xhigh and max work on gpt-image-2.5-sunburst only. Every quality costs the same.
"auto""auto""low""medium""high""xhigh""max"background?stringNo model makes a transparent background at the moment, so transparent returns a 400. auto and opaque work on every model.
"auto""auto""opaque"output_format?stringFile format of the returned images. gif works on gpt-image-2.6 and its flare and sunburst variants, svg on gpt-image-2.6 only. png, jpeg and webp work on every model.
"png""png""jpeg""webp""gif""svg"output_compression?integerQuality for jpeg and webp, from 0 to 100. Default 100.
0 <= value <= 100moderation?stringHow strictly the prompt and the result are checked. low is less restrictive.
"auto""auto""low"response_format?stringb64_json returns the image data in the response. url returns a link to the image, kept for 72 hours.
"b64_json""b64_json""url"async?booleanSet to true to run the request in the background. The answer is 202 with a task right away; read the result later with GET /images/tasks/{id}. The images are returned as links, so response_format must be url or left out. The header Prefer: respond-async does the same.
falsewebhook_url?stringWith async: an https:// address that gets one POST of the finished task (the same JSON as GET /images/tasks/{id}). It is tried up to 3 times. Send webhook_secret to have the call signed; without it, confirm what you receive by fetching the task with your key.
uriwebhook_secret?stringWith webhook_url: a secret of your own, 16 to 128 characters. The call to your address then carries x-webhook-signature: t=<unix seconds>,v1=<hex>, where the hex is HMAC-SHA256 of <t>.<body> made with this secret.
16 <= length <= 128image[]*array<>Reference images: PNG, JPEG or WebP, 1 to 16 files, each up to 20 MB, 50 MB in total.
1 <= items <= 16input_fidelity?stringHow closely the result keeps the details of the reference images. Not accepted by gpt-image-2.
"low""high"The images.
application/json- response
created*integerWhen the images were made, as a Unix timestamp in seconds.
data*array<>curl -X POST 'https://api.cheapestimagen.com/v1/images/edits' \ -F 'model=gpt-image-2' \ -F 'prompt=string' \ -F 'image[]=[ "string"]'{ "created": 0, "data": [ { "b64_json": "string", "url": "http://example.com" } ]}Create image POST
Creates one or more images from a text prompt. Credits are held when the request starts and returned for every image that is not delivered.
Get task GET
Gets the state of one asynchronous request by its task id: `in_progress`, then `succeeded` with the images or `failed` with the error. A task can be read for as long as its images are kept, 72 hours. Poll every few seconds; reading a task does not count as a request in progress. To wait for several tasks, use `GET /images/tasks?ids=` and read them in one call.