Image tools
Every /images endpoint - what it does, the fields it takes and what it costs.
Every endpoint here starts a job and answers 201 with it (see Jobs, tools and usage). Photos are passed as …_upload_id - see Uploads.
Models. Where a tool has a model field it is optional: leave it out to use the same default model as the app, or name one of the tool's models (GET /tools lists them with their prices). An unknown name is refused with 400 INVALID_MODEL and the list of valid ones.
Consent. Tools that work on a real person's face or body need "consent_confirmed": true - you confirm you have the right to use the pictures.
The exact price of each model is in GET /tools; the job's credits is what it costs.
POST /images/generate
Creates new pictures from a description. Like Image Generator. Cost: from 20 credits per picture (780 with the default model), times count.
| Field | ||
|---|---|---|
prompt | required | What to show |
model | A model of this tool | |
aspect_ratio | One of the model's aspect_ratios, e.g. 1:1, 16:9 | |
resolution | One of the model's resolutions (1K, 2K, 4K), each with its own credits_per_image; omitted = its default_resolution. Capped by the plan | |
count | How many pictures (default 1) | |
style | A style key from GET /tools | |
safety_tolerance | 1 (strict) - 6 (permissive), where the model offers it | |
quality | Where the model offers it | |
reference_upload_ids | Pictures to guide the result, up to the model's max_reference_images |
POST /images/edit
Changes a photo as described. Like Image Editor. Cost: from 20 credits per picture (1,000 with the default model).
| Field | ||
|---|---|---|
image_upload_id | required | The photo |
prompt | required | The change, e.g. Change the jacket to deep red |
model | A model of this tool | |
reference_upload_ids | Other pictures the edit can use (the photo is image 1) |
POST /images/face-swap
Puts the face from one photo onto another. Like Face Swap. Cost: from 20 credits per picture (25 with the default model).
| Field | ||
|---|---|---|
face_upload_id | required | The face to put in |
target_upload_id | required | The photo whose face is replaced |
consent_confirmed | required | true |
model | A model of this tool | |
face_gender | Required by models that list face_genders |
POST /images/face-edit
Changes a face's expression and head angle. Like Face Editor. Cost: 50 credits per picture.
| Field | ||
|---|---|---|
image_upload_id | required | The photo |
consent_confirmed | required | true |
controls | { "<control key>": <percent> }, each within the model's min-max (GET /tools), e.g. { "smile": 60 }. At least one control must move | |
toggles | { "<toggle key>": true } | |
model | A model of this tool |
POST /images/clothes
Dresses the person in another garment. Like Clothes Changer. Cost: from 300 credits per picture (1,400 with the default model).
| Field | ||
|---|---|---|
person_upload_id | required | A full-body photo of the person |
garment_upload_id | required | The garment |
consent_confirmed | required | true |
garment_type | top, bottom or full, for models that list garment_types | |
instructions | Extra instructions, for models with takes_instructions | |
model | A model of this tool |
POST /images/headshot
Turns a photo into a portrait in a chosen style. Like Headshot. Cost: from 600 credits per picture (796 with the default model).
| Field | ||
|---|---|---|
image_upload_id | required | One person, face clearly visible |
style | required | A style key from GET /tools, e.g. linkedin, passport |
consent_confirmed | required | true |
model | A model of this tool |
POST /images/upscale
Makes a photo larger and sharper. Like Image Upscaler. Cost: from 20 credits per photo, priced by the size of the result.
| Field | ||
|---|---|---|
image_upload_id | required | The photo |
mode | preserve, balanced or creative - one of the model's modes | |
scale | One of the model's scales, e.g. 2 | |
model | A model of this tool |
POST /images/retouch
Removes blemishes, or gives the skin a clean natural look. Cost: 600 credits per picture.
| Field | ||
|---|---|---|
image_upload_id | required | The photo |
operation | retouch or skin - one of the model's operations | |
mode | For skin: subtle, balanced or realistic | |
model | A model of this tool |
POST /images/restore
Repairs an old, damaged or faded photo. Like Restore Image. Cost: 1,000 credits per picture; a larger scale costs more.
| Field | ||
|---|---|---|
image_upload_id | required | The photo |
level | light, medium or strong | |
scale | 1 (default), 2 or 4 - where the model lists it | |
model | A model of this tool |
POST /images/remove-background
Cuts the subject out on a transparent background (PNG). Like Remove Background. Cost: 20 credits per picture.
| Field | ||
|---|---|---|
image_upload_id | required | The photo |
POST /images/expand
Gives a photo a larger canvas and fills the new space. Like the canvas of Photo Studio. The ai fill costs 1,000 credits per picture; the others are free.
| Field | ||
|---|---|---|
image_upload_id | required | The photo |
canvas_width, canvas_height | required | The new size in pixels, at least the photo's own |
offset_x, offset_y | required | Where the photo's top-left corner sits on the canvas |
fill | required | ai, white, black, color, blur or transparent |
color | #RRGGBB, for color |
POST /images/to-text
Copies every word out of a picture, or describes a photo with no text. Like Image to Text. Cost: 50 credits per picture. The result is in the job's text.
| Field | ||
|---|---|---|
image_upload_id | required | The picture |