Skip to main content
POST
/
images
/
edits
Edit image
curl --request POST \
  --url https://www.dench.com/api/v1/images/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "Make the background transparent",
  "input_images_base64": [
    "iVBORw0KGgoAAAANSUhEUg..."
  ]
}
'
{
  "ok": true,
  "model": "gpt-image-2",
  "endpoint": "edits",
  "prompt": "Make the background transparent",
  "quality": "auto",
  "requestedSize": "1024x1024",
  "format": "png",
  "mimeType": "image/png",
  "estimatedCostUsd": 0.066,
  "b64_json": "iVBORw0KGgoAAAANS...",
  "path": "/image-generations/20260612-app-icon-edit.png",
  "signedUrl": "https://happy-animal-123.convex.cloud/api/storage/img124",
  "sizeBytes": 198432
}

Authorizations

Authorization
string
header
required

Workspace-scoped Dench API key from workspace settings. This is the same key used by DENCH_API_KEY in sandboxes.

Body

application/json
prompt
string
required

Image prompt.

Required string length: 1 - 32000
input_images_base64
string[]
required

Base64-encoded source images (1-8).

Required array length: 1 - 8 elements
size
string

e.g. 1024x1024, 1536x1024, auto.

quality
enum<string>
Available options:
auto,
low,
medium,
high
format
enum<string>
Available options:
png,
jpeg,
webp
output_compression
integer
Required range: 0 <= x <= 100
background
enum<string>
Available options:
auto,
opaque,
transparent
savePath
string

Workspace path to write the image.

mask_base64
string

Optional base64 mask image.

Response

Successful response

Gateway image envelope wrapping the OpenAI image result.

ok
boolean
required
model
string
required
endpoint
enum<string>
required
Available options:
generations,
edits
prompt
string
required
b64_json
string
required

Base64-encoded image bytes.

path
string
required

Workspace path where the image was saved.

signedUrl
string | null
required
revisedPrompt
string
quality
string
requestedSize
string
format
string
mimeType
string
estimatedCostUsd
number
storageId
string
contentHash
string
sizeBytes
number
usage
object
{key}
any