Skip to main content
POST
Edit an image

Authorizations

Authorization
string
header
required

Your Deepshi API key, sent as Authorization: Bearer <key>.

Body

multipart/form-data

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.

model
string
required

The image model id to use. See GET /v1/models.

Example:

"nano-banana-2"

prompt
string
required

Instruction describing the edit to perform.

Example:

"remove the person on the left"

image[]
file[]
required

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.

image
file[]

Same as image[], under the field name the OpenAI SDKs use when you pass a single file. Send images under either this or image[].

n
integer
default:1

Number of images to generate (1–4).

Required range: 1 <= x <= 4
response_format
enum<string>
default:b64_json

How images are returned. url returns an inline base64 data: URI, not a hosted link.

Available options:
b64_json,
url
output_format
enum<string>

Encoding of the returned image. Not all models honor every format.

Available options:
png,
jpeg,
webp
stream
boolean
default:false

Stream the result as Server-Sent Events. Use it for slow, high-resolution generations that would otherwise time out.

seed
integer

Seed for reproducible output. Omit for a random seed.

width
integer

Model-specific. Output width in pixels, for pixel-dimension models (e.g. flux-2-pro).

height
integer

Model-specific. Output height in pixels, for pixel-dimension models.

aspect_ratio
string

Model-specific. Aspect ratio for aspect-ratio and resolution-tier models.

Example:

"16:9"

resolution
string

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.

Example:

"2K"

quality
enum<string>

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.

Available options:
low,
medium,
high
image_size
string

Model-specific. Named output size for preset-size models (e.g. seedream-4.5).

Example:

"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).

created
integer<int64>

Unix timestamp when the request was created.

model
string

The image model id you requested.

size
string

The actual output dimensions, as WIDTHxHEIGHT.

data
object[]

The generated image(s).

usage
object

Token usage and the billed cost for the request.