Unlike generation, an edit request is sent as
multipart/form-data because it uploads image files. deepshi-image-1 is a good default; it accepts up to five reference images.
Step 1: Send an edit request
Send amodel, a prompt, and at least one image file:
curl
data[0].b64_json:
Step 2: Save the result
Decodeb64_json and write it to a file:
Reference images
Most image models support editing. How many reference images each one accepts varies, from 1 up to 14; sending more than a model accepts returns400. To send more than one, pass multiple image[] parts:
edit block from GET /v1/models:
deepshi-banana-pro is generate-only and does not support editing. A model that can’t edit
has "edit": { "supported": false } in GET /v1/models.Sizing, parameters, and pricing
An edit request takes the same sizing fields as generation (width and height, aspect_ratio, resolution, or image_size, depending on the model) and the same common parameters. The Deepshi models (deepshi-image-1, deepshi-banana-pro) support only n: 1.
Pricing also works the same way as generation, and every response includes usage.cost.total_cost in USD. See Pricing.
Next steps
Image generation
Generate images from a text prompt.
Image models
See which models support editing and how many reference images they take.