---
title: "Generate, edit or fill an image for review"
method: POST
path: "/image-generations"
tags: ["Image generation"]
---

# Generate, edit or fill an image for review

`POST /image-generations`

## Request

- Base URL: `https://app.openpo.st/api/v1`
- URL: `https://app.openpo.st/api/v1/image-generations`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `openpost_session`

## Headers

- `Idempotency-Key` string, required

## Request body

- ImageGenerationRequest
  - `$schema` string, uri: A URL to the JSON Schema for this object.
  - `background` 'auto' | 'opaque' | 'transparent', required
  - `mask_png` string: Base64 PNG; transparent pixels are selected. Fill only.
  - `model` 'gpt-image-2.5-flare' | 'gpt-image-2.5-sunburst', required
  - `operation` 'generate' | 'edit' | 'fill', required
  - `page_id` string, required
  - `project_id` string, required
  - `prompt` string, required
  - `quality` 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto', required
  - `size` 'square_hd' | 'portrait_4_3' | 'portrait_16_9' | 'landscape_4_3' | 'landscape_16_9' | 'auto', required
  - `source_media_id` string
  - `target_fingerprint` string: Browser snapshot fingerprint used to prevent stale application
  - `target_layer_id` string
  - `workspace_id` string, required

## Response `200`

OK

- ImageGenerationRun
  - `$schema` string, uri: A URL to the JSON Schema for this object.
  - `billing_state` string, required
  - `cost_microusd` integer, nullable, required
  - `created_at` string, date-time, required
  - `error_message` string, required
  - `id` string, required
  - `model` string, required
  - `operation` string, required
  - `page_id` string, required
  - `project_id` string, required
  - `prompt` string, required
  - `result_media_id` string, required
  - `source_media_id` string, required
  - `state` string, required
  - `target_fingerprint` string, required
  - `target_layer_id` string, required
  - `workspace_id` string, required

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `422`: Unprocessable Entity
- `500`: Internal Server Error
- `503`: Service Unavailable

---

[API](https://skmtc.dev/openpo/apis/openpost-api.md) · [All operations](https://skmtc.dev/openpo/apis/openpost-api/llms.txt) · [OpenAPI document](https://skmtc.dev/openpo/apis/openpost-api/revisions/67d3964458a7?raw)
