Edit an image
Edit or transform an existing image from a prompt and one or more input images. Sent as multipart/form-data. Supports the same model-specific sizing and quality parameters as image generation; how many reference images a model accepts varies (see the edit block in GET /v1/models).
Authorizations
Your Deepshi API key, sent as Authorization: Bearer <key>.
Body
- Option 1
- Option 2
Image edit request, sent as multipart/form-data. model, prompt, and at least one input image are required. Send the image files under either image[] or image — both are accepted.
The image model id to use. See GET /v1/models.
"nano-banana-2"
Instruction describing the edit to perform.
"remove the person on the left"
One or more input images to edit, each sent as a separate image[] part. How many reference images a model accepts varies from 1 up to 14. See the edit block in GET /v1/models.
Same as image[], under the field name the OpenAI SDKs use when you pass a single file. Send images under either this or image[].
Number of images to generate (1–4).
1 <= x <= 4How images are returned. url returns an inline base64 data: URI, not a hosted link.
b64_json, url Encoding of the returned image. Not all models honor every format.
png, jpeg, webp Stream the result as Server-Sent Events. Use it for slow, high-resolution generations that would otherwise time out.
Seed for reproducible output. Omit for a random seed.
Model-specific. Output width in pixels, for pixel-dimension models (e.g. flux-2-pro).
Model-specific. Output height in pixels, for pixel-dimension models.
Model-specific. Aspect ratio for aspect-ratio and resolution-tier models.
"16:9"
Model-specific. Resolution tier for resolution-tier models (e.g. nano-banana-2, nano-banana-pro, grok-imagine-quality). Determines the billed price for those models.
"2K"
Model-specific. Quality tier for the GPT Image models (gpt-image-1.5, gpt-image-2). Higher tiers cost more, and the price depends on the image size and quality you pick. Omit to use the model's default tier.
low, medium, high Model-specific. Named output size for preset-size models (e.g. seedream-4.5).
"auto_2K"
Response
The edited image(s). When stream: true, the response is a Server-Sent Events stream (text/event-stream): periodic keepalive comments followed by a terminal image_generation.completed event carrying the final image (see the ImageStreamEvent schema).