---
title: "Create Image Generation"
method: POST
path: "/v1/flows/image"
tags: ["Flows", "Image"]
---

# Create Image Generation

`POST /v1/flows/image`

Start an image generation with the selected model.

## Headers

- `xi-api-key` string, nullable — Your API key. This is required by most endpoints to access our API programmatically. You can view your xi-api-key using the 'Profile' tab on the website.

## Request body

- union
  - GPTImage1Request — Request body for the OpenAI GPT Image 1 model.
    - `webhook` union
      - WebhookTargetAll — Deliver the result to all of the workspace's configured flows webhooks.
        - `type` 'all' — Send the result to all of the workspace's configured flows webhooks.
      - WebhookTargetIds — Deliver the result to specific configured flows webhooks.
        - `type` 'ids' — Send the result to the listed flows webhooks.
        - `ids` string[], required — The IDs of the workspace flows webhooks to deliver the result to. Each must be one of the workspace's configured flows webhooks.
    - `prompt` string, required — A text description of the image to generate.
    - `images` ImageReference[] — Up to 5 reference images to edit or draw from.
      - union
        - GenerationReference — The output of a prior generation on this API.
          - `type` 'generation', required
          - `generation_id` string, required — The ID of the generation whose output to use, as returned when the generation was created.
        - StaticAssetReference — An asset uploaded via the assets API.
          - `type` 'asset', required
          - `asset_id` string, required — The ID of an asset uploaded via the assets API (`POST /v1/assets`), as returned in that response's `asset_id`.
        - InlineImageReference — An image passed inline as base64. The image is stored as an ephemeral asset with no guaranteed retention: it may be deleted at any time after the generation completes. To keep an input and reuse it across generations, upload it via the assets API (`POST /v1/assets`) and pass an `asset` reference instead.
          - `type` 'inline_base64', required
          - `content_base64` string, required — The media file's bytes, base64-encoded (standard alphabet). Up to 25MB decoded.
          - `mime_type` 'image/jpeg' | 'image/png' | 'image/webp' | 'image/heic' | 'image/heif', required — The MIME type of the encoded image.
    - `mask` union
      - GenerationReference — The output of a prior generation on this API.
        - `type` 'generation', required
        - `generation_id` string, required — The ID of the generation whose output to use, as returned when the generation was created.
      - StaticAssetReference — An asset uploaded via the assets API.
        - `type` 'asset', required
        - `asset_id` string, required — The ID of an asset uploaded via the assets API (`POST /v1/assets`), as returned in that response's `asset_id`.
      - InlineImageReference — An image passed inline as base64. The image is stored as an ephemeral asset with no guaranteed retention: it may be deleted at any time after the generation completes. To keep an input and reuse it across generations, upload it via the assets API (`POST /v1/assets`) and pass an `asset` reference instead.
        - `type` 'inline_base64', required
        - `content_base64` string, required — The media file's bytes, base64-encoded (standard alphabet). Up to 25MB decoded.
        - `mime_type` 'image/jpeg' | 'image/png' | 'image/webp' | 'image/heic' | 'image/heif', required — The MIME type of the encoded image.
    - `quality` 'low' | 'medium' | 'high' — The quality of the output image.
    - `background` 'transparent' | 'opaque' | 'auto' — The background of the output image. With `auto`, the model picks the background that suits the image.
    - `aspect_ratio` '1:1' | '3:2' | '2:3' — The aspect ratio of the output image.
    - `model_id` 'gpt-image-1', required — The model to use for the generation.
  - GPTImage15Request — Request body for the OpenAI GPT Image 1.5 model.
    - `webhook` union
      - WebhookTargetAll — Deliver the result to all of the workspace's configured flows webhooks.
        - `type` 'all' — Send the result to all of the workspace's configured flows webhooks.
      - WebhookTargetIds — Deliver the result to specific configured flows webhooks.
        - `type` 'ids' — Send the result to the listed flows webhooks.
        - `ids` string[], required — The IDs of the workspace flows webhooks to deliver the result to. Each must be one of the workspace's configured flows webhooks.
    - `prompt` string, required — A text description of the image to generate.
    - `images` ImageReference[] — Up to 5 reference images to edit or draw from.
      - union
        - GenerationReference — The output of a prior generation on this API.
          - `type` 'generation', required
          - `generation_id` string, required — The ID of the generation whose output to use, as returned when the generation was created.
        - StaticAssetReference — An asset uploaded via the assets API.
          - `type` 'asset', required
          - `asset_id` string, required — The ID of an asset uploaded via the assets API (`POST /v1/assets`), as returned in that response's `asset_id`.
        - InlineImageReference — An image passed inline as base64. The image is stored as an ephemeral asset with no guaranteed retention: it may be deleted at any time after the generation completes. To keep an input and reuse it across generations, upload it via the assets API (`POST /v1/assets`) and pass an `asset` reference instead.
          - `type` 'inline_base64', required
          - `content_base64` string, required — The media file's bytes, base64-encoded (standard alphabet). Up to 25MB decoded.
          - `mime_type` 'image/jpeg' | 'image/png' | 'image/webp' | 'image/heic' | 'image/heif', required — The MIME type of the encoded image.
    - `mask` union
      - GenerationReference — The output of a prior generation on this API.
        - `type` 'generation', required
        - `generation_id` string, required — The ID of the generation whose output to use, as returned when the generation was created.
      - StaticAssetReference — An asset uploaded via the assets API.
        - `type` 'asset', required
        - `asset_id` string, required — The ID of an asset uploaded via the assets API (`POST /v1/assets`), as returned in that response's `asset_id`.
      - InlineImageReference — An image passed inline as base64. The image is stored as an ephemeral asset with no guaranteed retention: it may be deleted at any time after the generation completes. To keep an input and reuse it across generations, upload it via the assets API (`POST /v1/assets`) and pass an `asset` reference instead.
        - `type` 'inline_base64', required
        - `content_base64` string, required — The media file's bytes, base64-encoded (standard alphabet). Up to 25MB decoded.
        - `mime_type` 'image/jpeg' | 'image/png' | 'image/webp' | 'image/heic' | 'image/heif', required — The MIME type of the encoded image.
    - `quality` 'low' | 'medium' | 'high' — The quality of the output image.
    - `background` 'transparent' | 'opaque' | 'auto' — The background of the output image. With `auto`, the model picks the background that suits the image.
    - `aspect_ratio` '1:1' | '3:2' | '2:3' — The aspect ratio of the output image.
    - `model_id` 'gpt-image-1.5', required — The model to use for the generation.
  - GPTImage2Request — Request body for the OpenAI GPT Image 2 model.
    - `webhook` union
      - WebhookTargetAll — Deliver the result to all of the workspace's configured flows webhooks.
        - `type` 'all' — Send the result to all of the workspace's configured flows webhooks.
      - WebhookTargetIds — Deliver the result to specific configured flows webhooks.
        - `type` 'ids' — Send the result to the listed flows webhooks.
        - `ids` string[], required — The IDs of the workspace flows webhooks to deliver the result to. Each must be one of the workspace's configured flows webhooks.
    - `prompt` string, required — A text description of the image to generate.
    - `images` ImageReference[] — Up to 10 reference images to edit or draw from.
      - union
        - GenerationReference — The output of a prior generation on this API.
          - `type` 'generation', required
          - `generation_id` string, required — The ID of the generation whose output to use, as returned when the generation was created.
        - StaticAssetReference — An asset uploaded via the assets API.
          - `type` 'asset', required
          - `asset_id` string, required — The ID of an asset uploaded via the assets API (`POST /v1/assets`), as returned in that response's `asset_id`.
        - InlineImageReference — An image passed inline as base64. The image is stored as an ephemeral asset with no guaranteed retention: it may be deleted at any time after the generation completes. To keep an input and reuse it across generations, upload it via the assets API (`POST /v1/assets`) and pass an `asset` reference instead.
          - `type` 'inline_base64', required
          - `content_base64` string, required — The media file's bytes, base64-encoded (standard alphabet). Up to 25MB decoded.
          - `mime_type` 'image/jpeg' | 'image/png' | 'image/webp' | 'image/heic' | 'image/heif', required — The MIME type of the encoded image.
    - `mask` union
      - GenerationReference — The output of a prior generation on this API.
        - `type` 'generation', required
        - `generation_id` string, required — The ID of the generation whose output to use, as returned when the generation was created.
      - StaticAssetReference — An asset uploaded via the assets API.
        - `type` 'asset', required
        - `asset_id` string, required — The ID of an asset uploaded via the assets API (`POST /v1/assets`), as returned in that response's `asset_id`.
      - InlineImageReference — An image passed inline as base64. The image is stored as an ephemeral asset with no guaranteed retention: it may be deleted at any time after the generation completes. To keep an input and reuse it across generations, upload it via the assets API (`POST /v1/assets`) and pass an `asset` reference instead.
        - `type` 'inline_base64', required
        - `content_base64` string, required — The media file's bytes, base64-encoded (standard alphabet). Up to 25MB decoded.
        - `mime_type` 'image/jpeg' | 'image/png' | 'image/webp' | 'image/heic' | 'image/heif', required — The MIME type of the encoded image.
    - `quality` 'low' | 'medium' | 'high' — The quality of the output image.
    - `model_id` 'gpt-image-2', required — The model to use for the generation.
    - `aspect_ratio` 'auto' | '1:1' | '4:5' | '5:4' | '3:4' | '4:3' | '2:3' | '3:2' | '1:2' | '2:1' | '9:16' | '16:9' | '21:9' | '1:3' | '3:1' — The aspect ratio of the output image. With `auto`, the model picks an aspect ratio based on the inputs.
    - `resolution` '1K' | '2K' | '4K' — The resolution of the output image.
  - Gemini25FlashImageRequest — Request body for the Google Gemini 2.5 Flash image model.
    - `webhook` union
      - WebhookTargetAll — Deliver the result to all of the workspace's configured flows webhooks.
        - `type` 'all' — Send the result to all of the workspace's configured flows webhooks.
      - WebhookTargetIds — Deliver the result to specific configured flows webhooks.
        - `type` 'ids' — Send the result to the listed flows webhooks.
        - `ids` string[], required — The IDs of the workspace flows webhooks to deliver the result to. Each must be one of the workspace's configured flows webhooks.
    - `prompt` string, required — A text description of the image to generate.
    - `model_id` 'gemini-2.5-flash-image', required — The model to use for the generation.
    - `images` ImageReference[] — Up to 5 reference images to edit or draw from.
      - union
        - GenerationReference — The output of a prior generation on this API.
          - `type` 'generation', required
          - `generation_id` string, required — The ID of the generation whose output to use, as returned when the generation was created.
        - StaticAssetReference — An asset uploaded via the assets API.
          - `type` 'asset', required
          - `asset_id` string, required — The ID of an asset uploaded via the assets API (`POST /v1/assets`), as returned in that response's `asset_id`.
        - InlineImageReference — An image passed inline as base64. The image is stored as an ephemeral asset with no guaranteed retention: it may be deleted at any time after the generation completes. To keep an input and reuse it across generations, upload it via the assets API (`POST /v1/assets`) and pass an `asset` reference instead.
          - `type` 'inline_base64', required
          - `content_base64` string, required — The media file's bytes, base64-encoded (standard alphabet). Up to 25MB decoded.
          - `mime_type` 'image/jpeg' | 'image/png' | 'image/webp' | 'image/heic' | 'image/heif', required — The MIME type of the encoded image.
    - `aspect_ratio` 'auto' | '1:1' | '2:3' | '3:2' | '3:4' | '4:3' | '4:5' | '5:4' | '9:16' | '16:9' | '21:9' — The aspect ratio of the output image. With `auto`, the model picks an aspect ratio based on the inputs.
  - Gemini3ProImageRequest — Request body for the Google Gemini 3 Pro image model.
    - `webhook` union
      - WebhookTargetAll — Deliver the result to all of the workspace's configured flows webhooks.
        - `type` 'all' — Send the result to all of the workspace's configured flows webhooks.
      - WebhookTargetIds — Deliver the result to specific configured flows webhooks.
        - `type` 'ids' — Send the result to the listed flows webhooks.
        - `ids` string[], required — The IDs of the workspace flows webhooks to deliver the result to. Each must be one of the workspace's configured flows webhooks.
    - `prompt` string, required — A text description of the image to generate.
    - `model_id` 'gemini-3-pro-image', required — The model to use for the generation.
    - `images` ImageReference[] — Up to 10 reference images to edit or draw from.
      - union
        - GenerationReference — The output of a prior generation on this API.
          - `type` 'generation', required
          - `generation_id` string, required — The ID of the generation whose output to use, as returned when the generation was created.
        - StaticAssetReference — An asset uploaded via the assets API.
          - `type` 'asset', required
          - `asset_id` string, required — The ID of an asset uploaded via the assets API (`POST /v1/assets`), as returned in that response's `asset_id`.
        - InlineImageReference — An image passed inline as base64. The image is stored as an ephemeral asset with no guaranteed retention: it may be deleted at any time after the generation completes. To keep an input and reuse it across generations, upload it via the assets API (`POST /v1/assets`) and pass an `asset` reference instead.
          - `type` 'inline_base64', required
          - `content_base64` string, required — The media file's bytes, base64-encoded (standard alphabet). Up to 25MB decoded.
          - `mime_type` 'image/jpeg' | 'image/png' | 'image/webp' | 'image/heic' | 'image/heif', required — The MIME type of the encoded image.
    - `aspect_ratio` 'auto' | '1:1' | '2:3' | '3:2' | '3:4' | '4:3' | '4:5' | '5:4' | '9:16' | '16:9' | '21:9' — The aspect ratio of the output image. With `auto`, the model picks an aspect ratio based on the inputs.
    - `resolution` '1K' | '2K' | '4K' — The resolution of the output image.
  - Gemini31FlashImageRequest — Request body for the Google Gemini 3.1 Flash image model.
    - `webhook` union
      - WebhookTargetAll — Deliver the result to all of the workspace's configured flows webhooks.
        - `type` 'all' — Send the result to all of the workspace's configured flows webhooks.
      - WebhookTargetIds — Deliver the result to specific configured flows webhooks.
        - `type` 'ids' — Send the result to the listed flows webhooks.
        - `ids` string[], required — The IDs of the workspace flows webhooks to deliver the result to. Each must be one of the workspace's configured flows webhooks.
    - `prompt` string, required — A text description of the image to generate.
    - `model_id` 'gemini-3.1-flash-image', required — The model to use for the generation.
    - `images` ImageReference[] — Up to 14 reference images to edit or draw from.
      - union
        - GenerationReference — The output of a prior generation on this API.
          - `type` 'generation', required
          - `generation_id` string, required — The ID of the generation whose output to use, as returned when the generation was created.
        - StaticAssetReference — An asset uploaded via the assets API.
          - `type` 'asset', required
          - `asset_id` string, required — The ID of an asset uploaded via the assets API (`POST /v1/assets`), as returned in that response's `asset_id`.
        - InlineImageReference — An image passed inline as base64. The image is stored as an ephemeral asset with no guaranteed retention: it may be deleted at any time after the generation completes. To keep an input and reuse it across generations, upload it via the assets API (`POST /v1/assets`) and pass an `asset` reference instead.
          - `type` 'inline_base64', required
          - `content_base64` string, required — The media file's bytes, base64-encoded (standard alphabet). Up to 25MB decoded.
          - `mime_type` 'image/jpeg' | 'image/png' | 'image/webp' | 'image/heic' | 'image/heif', required — The MIME type of the encoded image.
    - `aspect_ratio` 'auto' | '1:1' | '2:3' | '3:2' | '3:4' | '4:3' | '4:5' | '5:4' | '9:16' | '16:9' | '21:9' | '1:4' | '4:1' | '1:8' | '8:1' — The aspect ratio of the output image. With `auto`, the model picks an aspect ratio based on the inputs.
    - `resolution` '512' | '1K' | '2K' | '4K' — The resolution of the output image.
  - Gemini31FlashLiteImageRequest — Request body for the Google Gemini 3.1 Flash Lite image model.
    - `webhook` union
      - WebhookTargetAll — Deliver the result to all of the workspace's configured flows webhooks.
        - `type` 'all' — Send the result to all of the workspace's configured flows webhooks.
      - WebhookTargetIds — Deliver the result to specific configured flows webhooks.
        - `type` 'ids' — Send the result to the listed flows webhooks.
        - `ids` string[], required — The IDs of the workspace flows webhooks to deliver the result to. Each must be one of the workspace's configured flows webhooks.
    - `prompt` string, required — A text description of the image to generate.
    - `model_id` 'gemini-3.1-flash-lite-image', required — The model to use for the generation.
    - `images` ImageReference[] — Up to 14 reference images to edit or draw from.
      - union
        - GenerationReference — The output of a prior generation on this API.
          - `type` 'generation', required
          - `generation_id` string, required — The ID of the generation whose output to use, as returned when the generation was created.
        - StaticAssetReference — An asset uploaded via the assets API.
          - `type` 'asset', required
          - `asset_id` string, required — The ID of an asset uploaded via the assets API (`POST /v1/assets`), as returned in that response's `asset_id`.
        - InlineImageReference — An image passed inline as base64. The image is stored as an ephemeral asset with no guaranteed retention: it may be deleted at any time after the generation completes. To keep an input and reuse it across generations, upload it via the assets API (`POST /v1/assets`) and pass an `asset` reference instead.
          - `type` 'inline_base64', required
          - `content_base64` string, required — The media file's bytes, base64-encoded (standard alphabet). Up to 25MB decoded.
          - `mime_type` 'image/jpeg' | 'image/png' | 'image/webp' | 'image/heic' | 'image/heif', required — The MIME type of the encoded image.
    - `aspect_ratio` 'auto' | '1:1' | '2:3' | '3:2' | '3:4' | '4:3' | '4:5' | '5:4' | '9:16' | '16:9' | '21:9' — The aspect ratio of the output image. With `auto`, the model picks an aspect ratio based on the inputs.
    - `resolution` '1K' — The resolution of the output image.
  - BytedanceSeedream5LiteRequest — Request body for the ByteDance Seedream 5.0 Lite image model.
    - `webhook` union
      - WebhookTargetAll — Deliver the result to all of the workspace's configured flows webhooks.
        - `type` 'all' — Send the result to all of the workspace's configured flows webhooks.
      - WebhookTargetIds — Deliver the result to specific configured flows webhooks.
        - `type` 'ids' — Send the result to the listed flows webhooks.
        - `ids` string[], required — The IDs of the workspace flows webhooks to deliver the result to. Each must be one of the workspace's configured flows webhooks.
    - `prompt` string, required — A text description of the image to generate.
    - `images` ImageReference[] — Up to 10 reference images to edit or draw from.
      - union
        - GenerationReference — The output of a prior generation on this API.
          - `type` 'generation', required
          - `generation_id` string, required — The ID of the generation whose output to use, as returned when the generation was created.
        - StaticAssetReference — An asset uploaded via the assets API.
          - `type` 'asset', required
          - `asset_id` string, required — The ID of an asset uploaded via the assets API (`POST /v1/assets`), as returned in that response's `asset_id`.
        - InlineImageReference — An image passed inline as base64. The image is stored as an ephemeral asset with no guaranteed retention: it may be deleted at any time after the generation completes. To keep an input and reuse it across generations, upload it via the assets API (`POST /v1/assets`) and pass an `asset` reference instead.
          - `type` 'inline_base64', required
          - `content_base64` string, required — The media file's bytes, base64-encoded (standard alphabet). Up to 25MB decoded.
          - `mime_type` 'image/jpeg' | 'image/png' | 'image/webp' | 'image/heic' | 'image/heif', required — The MIME type of the encoded image.
    - `aspect_ratio` 'auto' | '1:1' | '3:4' | '16:9' | '4:3' | '9:16' — The aspect ratio of the output image. With `auto`, the model picks an aspect ratio based on the inputs.
    - `seed` integer, nullable — A seed for reproducible generation: the same seed and inputs give similar output across generations. Omit for random.
    - `model_id` 'bytedance-seedream-5-lite', required — The model to use for the generation.
    - `resolution` '2K' | '3K' — The resolution of the output image.
  - BytedanceSeedream5ProRequest — Request body for the ByteDance Seedream 5.0 Pro image model.
    - `webhook` union
      - WebhookTargetAll — Deliver the result to all of the workspace's configured flows webhooks.
        - `type` 'all' — Send the result to all of the workspace's configured flows webhooks.
      - WebhookTargetIds — Deliver the result to specific configured flows webhooks.
        - `type` 'ids' — Send the result to the listed flows webhooks.
        - `ids` string[], required — The IDs of the workspace flows webhooks to deliver the result to. Each must be one of the workspace's configured flows webhooks.
    - `prompt` string, required — A text description of the image to generate.
    - `images` ImageReference[] — Up to 10 reference images to edit or draw from.
      - union
        - GenerationReference — The output of a prior generation on this API.
          - `type` 'generation', required
          - `generation_id` string, required — The ID of the generation whose output to use, as returned when the generation was created.
        - StaticAssetReference — An asset uploaded via the assets API.
          - `type` 'asset', required
          - `asset_id` string, required — The ID of an asset uploaded via the assets API (`POST /v1/assets`), as returned in that response's `asset_id`.
        - InlineImageReference — An image passed inline as base64. The image is stored as an ephemeral asset with no guaranteed retention: it may be deleted at any time after the generation completes. To keep an input and reuse it across generations, upload it via the assets API (`POST /v1/assets`) and pass an `asset` reference instead.
          - `type` 'inline_base64', required
          - `content_base64` string, required — The media file's bytes, base64-encoded (standard alphabet). Up to 25MB decoded.
          - `mime_type` 'image/jpeg' | 'image/png' | 'image/webp' | 'image/heic' | 'image/heif', required — The MIME type of the encoded image.
    - `aspect_ratio` 'auto' | '1:1' | '3:4' | '16:9' | '4:3' | '9:16' — The aspect ratio of the output image. With `auto`, the model picks an aspect ratio based on the inputs.
    - `seed` integer, nullable — A seed for reproducible generation: the same seed and inputs give similar output across generations. Omit for random.
    - `model_id` 'bytedance-seedream-5-pro', required — The model to use for the generation.
    - `resolution` '1K' | '2K' — The resolution of the output image.

## Response `200`

Successful Response

- MediaGenerationCreateResponse — A newly queued media generation; fetch the GET endpoint for the output.
  - `id` string, required — The unique identifier of the generation. Pass it to the corresponding GET endpoint to retrieve the output.
  - `status` 'pending', required — A newly created generation is always `pending`.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/elevenlabs/apis/elevenlabs-api-documentation.md) · [All operations](https://skmtc.net/elevenlabs/apis/elevenlabs-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elevenlabs/elevenlabs-api-documentation/revisions/acb0175c0525/schema)
