> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gengen.farm/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate images

> Generate one or more images synchronously. New integrations should use
normalized `assets`, `controls`, and `providerOptions` fields and read
generated media from `outputs.images`. The returned `id` identifies this
completed request for logs; it is not a task ID to poll.




## OpenAPI

````yaml /openapi/gengen-v1.yaml post /images/generations
openapi: 3.1.0
info:
  title: GENGEN API
  version: 1.0.0
  description: |
    The public GENGEN v1 API. New integrations should use normalized camelCase
    request fields and read generated media from the standard `outputs` object.
servers:
  - url: https://gengen.farm/api/gengen/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Video generation tasks
    description: Create, inspect, list, and cancel asynchronous video generation tasks.
  - name: Text generation
    description: Create OpenAI-compatible chat completions, including streamed responses.
  - name: Image generation
    description: Generate images synchronously with normalized GENGEN request fields.
  - name: Video understanding
    description: Analyze video content through the BytePlus Responses API surface.
  - name: Files
    description: Authorize direct uploads for image, video, and audio inputs.
paths:
  /images/generations:
    post:
      tags:
        - Image generation
      summary: Generate images
      description: |
        Generate one or more images synchronously. New integrations should use
        normalized `assets`, `controls`, and `providerOptions` fields and read
        generated media from `outputs.images`. The returned `id` identifies this
        completed request for logs; it is not a task ID to poll.
      operationId: createImageGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateImageGenerationRequest'
            example:
              model: seedream-5-0-260128
              prompt: >-
                An orange tabby cat napping on a sunlit windowsill, watercolor
                style.
              assets:
                referenceImages:
                  - https://example.com/reference-cat.png
              controls:
                size: 2048x2048
                sequentialImageGeneration: disabled
                responseFormat: url
                outputFormat: jpeg
                contentPreFilter: true
                watermark: true
      responses:
        '200':
          description: The synchronous generation completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageGenerationResponse'
              example:
                id: image:550e8400-e29b-41d4-a716-446655440000
                model: seedream-5-0-260128
                status: succeeded
                outputs:
                  images:
                    - https://example.com/generated-image.jpeg
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        default:
          $ref: '#/components/responses/UnexpectedError'
components:
  schemas:
    CreateImageGenerationRequest:
      type: object
      required:
        - model
        - prompt
      description: >
        Normalized synchronous image generation request. Legacy Seedream request

        aliases remain accepted for existing clients, but new integrations
        should

        use the fields documented here.
      properties:
        model:
          type: string
          minLength: 1
          description: |
            BytePlus image model ID. Supported Seedream models are
            `seedream-5-0-260128` and `dola-seedream-5-0-pro-260628`.
          example: seedream-5-0-260128
        prompt:
          type: string
          minLength: 1
          description: Text instruction describing the desired image.
        assets:
          $ref: '#/components/schemas/ImageGenerationAssets'
        controls:
          $ref: '#/components/schemas/ImageGenerationControls'
        providerOptions:
          type: object
          description: Advanced provider-specific overrides.
          properties:
            seedream:
              type: object
              additionalProperties: true
          additionalProperties: true
      additionalProperties: true
    ImageGenerationResponse:
      type: object
      required:
        - id
        - model
        - status
        - outputs
      description: >
        Standard response fields are listed first. Compatibility aliases can
        follow

        them for existing clients.
      properties:
        id:
          type: string
          description: Synchronous request ID, normally beginning with `image:`.
        model:
          type: string
        status:
          type: string
          description: Normally `succeeded` for a successful synchronous response.
        outputs:
          $ref: '#/components/schemas/ImageGenerationOutputs'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        task_id:
          type: string
          description: Compatibility alias for `id`; it is not a pollable task ID.
        image_url:
          type: string
          format: uri
          description: Compatibility alias for the first image output.
        images:
          type: array
          items:
            type: string
            format: uri
          description: Compatibility alias for `outputs.images`.
        created:
          type: integer
          format: int64
          description: Compatibility Unix timestamp in seconds.
        data:
          type: array
          items:
            type: object
            additionalProperties: true
        usage:
          type: object
          additionalProperties: true
        error:
          oneOf:
            - type: object
              additionalProperties: true
            - type: string
            - type: 'null'
      additionalProperties: true
    ImageGenerationAssets:
      type: object
      properties:
        referenceImages:
          type: array
          maxItems: 14
          description: >
            Public image URLs or Base64 data URLs. Seedream 5.0 Pro accepts up
            to

            10 references; Seedream 5.0 Lite accepts up to 14.
          items:
            type: string
      additionalProperties: true
    ImageGenerationControls:
      type: object
      properties:
        size:
          type: string
          description: |
            A supported resolution preset such as `2K`, or pixel dimensions such
            as `2048x2048`. Valid values depend on the selected model.
          example: 2048x2048
        sequentialImageGeneration:
          type: string
          enum:
            - auto
            - disabled
          description: |
            Seedream 5.0 Lite only. Omit this field for Seedream 5.0 Pro.

            Supported values:

            - `auto` — let the model choose whether to generate a sequence
            - `disabled` — generate without sequential-image mode
        maxImages:
          type: integer
          minimum: 1
          maximum: 15
          description: |
            Maximum output count for Lite sequential generation. Input reference
            images plus generated images cannot exceed 15.
        stream:
          type: boolean
          const: false
          default: false
          description: This GENGEN endpoint supports non-streaming JSON responses only.
        outputFormat:
          type: string
          description: |
            Supported values:

            - `png` — lossless PNG output
            - `jpeg` — JPEG output with smaller file size
          enum:
            - png
            - jpeg
          default: jpeg
        responseFormat:
          type: string
          description: |
            Supported values:

            - `url` — return hosted image URLs
            - `b64_json` — return Base64-encoded image data
          enum:
            - url
            - b64_json
          default: url
        watermark:
          type: boolean
          default: true
        contentPreFilter:
          type: boolean
          default: true
          description: Seedream 5.0 Lite only; omit for Seedream 5.0 Pro.
        promptOptimization:
          type: object
          properties:
            mode:
              type: string
              description: |
                Supported values:

                - `standard` — full prompt optimization
                - `fast` — lower-latency prompt optimization
              enum:
                - standard
                - fast
              default: standard
          additionalProperties: true
      additionalProperties: true
    ImageGenerationOutputs:
      type: object
      required:
        - images
      properties:
        images:
          type: array
          items:
            type: string
            format: uri
          description: Generated image URLs or data URLs.
      additionalProperties: true
    Error:
      type: object
      required:
        - error_code
      properties:
        error_code:
          type: string
          description: Stable machine-readable error code.
        error_params:
          type: object
          description: Optional structured error context.
          additionalProperties: true
        error:
          type: string
          description: Optional human-readable message.
      additionalProperties: true
  responses:
    BadRequest:
      description: The request body, path, or query parameters are invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error_code: gengen.model_required
            error_params:
              field: model
            error: A model is required
    Unauthorized:
      description: The bearer token is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error_code: gengen.auth_required
            error: Missing Authorization bearer token
    PaymentRequired:
      description: The workspace does not have enough available balance for this request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error_code: seedance.insufficient_balance
            error: Insufficient available balance
    Forbidden:
      description: The API key is revoked, expired, or not authorized for the operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error_code: gengen.api_key_revoked
            error: GENGEN API key has been revoked
    UnexpectedError:
      description: GENGEN or an upstream provider could not complete the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: GENGEN API key
      description: A workspace API key beginning with `gengen_live_`.

````