API docs / Image models

GPT Image 2 (Text to image) API

Create an image from a text prompt.

Model id
openai/gpt-image-2
Provider
OpenAI
Output
Image
Price
From 5 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". 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",
  "input": {
    "prompt": "A red fox standing in fresh snow at golden hour, soft light"
  },
  "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_imagesarray 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. Supports preset names or explicit {width, height}. Both dimensions must be multiples of 16, max edge 3840px, aspect ratio <= 3:1, total pixels between 655,360 and 8,294,400.

Default: 4:3

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

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