API docs / Image models

GPT Image 2 (Edit image) API

Edit one or more images with instructions.

Model id
openai/gpt-image-2/edit
Provider
OpenAI
Output
Image
Price
From 7 credits per run, the same as on voor.ai. Options such as length or resolution can change it.

Request

POST https://voor.ai/v1/generations with "model": "openai/gpt-image-2/edit". Poll GET /v1/tasks/{id} or receive the signed webhook. See the overview for keys, idempotency, webhooks and errors.

curl https://voor.ai/v1/generations \
  -H "Authorization: Bearer $VOOR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "model": "openai/gpt-image-2/edit",
  "input": {
    "prompt": "A red fox standing in fresh snow at golden hour, soft light",
    "reference_images": [
      "https://example.com/input.png"
    ]
  },
  "callback_url": "https://example.com/webhooks/voor"
}'

# Then poll the task (or wait for the webhook):
curl https://voor.ai/v1/tasks/TASK_ID \
  -H "Authorization: Bearer $VOOR_API_KEY"

Input parameters

NameTypeDetails
promptrequiredstring

The prompt for image generation

Up to 32000 characters

reference_imagesrequiredarray of URLs

Upload the original image first. Add more images only when you want them used as extra references.

Up to 10 files · Accepts image/*

maskarray of URLs

After the original image is uploaded, paint the area you want to replace. Leave this empty to edit without a mask.

Up to 1 files · Accepts image/*

aspect_ratiostring

The size of the generated image. Use 'auto' to infer from input images.

Default: auto

One of: 1:1 (HD), 1:1, 3:4, 9:16, 4:3, 16:9, auto

output_countnumber

Number of images to generate

Default: 1

Min 1 · Max 4

qualitystring

Quality for the generated image

Default: low

One of: low, medium, high

output_formatstring

Output format for the images

Default: png

One of: jpeg, png, webp