> ## Documentation Index
> Fetch the complete documentation index at: https://heygen-1fa696a7.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create HeyGen Image

> Generate one to five portraits with identity_remix, the default and only supported mode. Provide one to five identity_images and exactly one item in reference_images. The output preserves the identity while following the reference image's clothing, pose, composition, and background. Returns a generation_id to poll. The job completes when all requested images are available; partial results are not returned.



## OpenAPI

````yaml /openapi/external-api.json post /v3/models/images
openapi: 3.1.0
info:
  title: HeyGen External API
  version: 1.0.0
  description: >-
    HeyGen's external API for programmatic AI video creation. See
    https://docs.heygen.com for full documentation.
  contact:
    name: HeyGen Product Infra
    url: https://heygen.com
servers:
  - url: https://api.heygen.com
    description: Production
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Video Agent
    description: Create videos from text prompts using AI
  - name: Videos
    description: Create, list, retrieve, and delete videos
  - name: Templates
    description: Generate videos from reusable templates by replacing their variables
  - name: Voices
    description: Text-to-speech and voice management
  - name: Audio
    description: Search the background-music and sound-effects catalog
  - name: Video Translate
    description: Translate videos into other languages
  - name: AI Clipping
    description: Turn long-form videos into ready-to-share short clips with captions
  - name: Batches
    description: Create and track batches of videos.
  - name: Video Translation Batches
    description: Create and track batches of video translations.
  - name: Lipsync Batches
    description: Create and track batches of lipsyncs.
  - name: Asset Batches
    description: Create and track batches of direct-to-S3 asset uploads.
  - name: User
    description: Account information and billing
  - name: API Keys
    description: Inspect the API key authenticating the current request
  - name: Avatars
    description: List and manage avatars and looks
  - name: Assets
    description: Upload files for use in video creation
  - name: Folders
    description: >-
      Create folders to organize videos and translations in the workspace, and
      look up any folder, Assets library folders included, by id
  - name: Webhooks
    description: Manage webhook endpoints and events
  - name: Lipsync
    description: Dub or replace audio on existing videos
  - name: Brand
    description: >-
      Brand-related resources — brand kits (colors, fonts, logos) and brand
      glossaries (custom term translations)
  - name: HyperFrames
    description: Render HyperFrames composition zips into video — separate from /v3/videos
  - name: Models
    description: ''
  - name: Filler Word Removal
    description: ''
paths:
  /v3/models/images:
    post:
      tags:
        - Models
      summary: Create HeyGen Image
      description: >-
        Generate one to five portraits with identity_remix, the default and only
        supported mode. Provide one to five identity_images and exactly one item
        in reference_images. The output preserves the identity while following
        the reference image's clothing, pose, composition, and background.
        Returns a generation_id to poll. The job completes when all requested
        images are available; partial results are not returned.
      operationId: createImageGeneration
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateImageGenerationRequest'
      responses:
        '202':
          description: Accepted — submission acknowledged; poll for completion.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CreateImageGenerationResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/StandardAPIError'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/StandardAPIError'
              example:
                error:
                  code: unauthorized
                  message: Invalid or expired API key. Verify your x-api-key header.
                  param: null
                  doc_url: null
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/StandardAPIError'
              example:
                error:
                  code: resource_not_found
                  message: Image generation not found.
                  param: null
                  doc_url: null
        '409':
          $ref: '#/components/responses/IdempotencyInProgress'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/StandardAPIError'
              example:
                error:
                  code: rate_limit_exceeded
                  message: >-
                    Too many requests. Retry after the duration specified in the
                    Retry-After header.
                  param: null
                  doc_url: null
          headers:
            Retry-After:
              description: Seconds to wait before retrying
              schema:
                type: integer
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Optional client-supplied key for safely retrying mutations. Subsequent
        calls within 24 hours that share this key replay the original response —
        even if the request body differs slightly (a warning is logged). A retry
        that arrives while the original is still in flight gets a 409
        `request_in_progress`. Keys must be 1–255 characters from
        `[A-Za-z0-9_:.-]`; a UUID is a safe default. Scope is per-endpoint and
        per-resource: the same key on a different route or path parameter is
        independent.
      schema:
        type: string
        pattern: ^[A-Za-z0-9_\-:.]{1,255}$
        maxLength: 255
        minLength: 1
      example: 550e8400-e29b-41d4-a716-446655440000
  schemas:
    CreateImageGenerationRequest:
      additionalProperties: false
      properties:
        model:
          const: heygen-image-1
          description: >-
            Required identity-focused image model. Only heygen-image-1 is
            supported.
          title: Model
          type: string
        mode:
          const: identity_remix
          default: identity_remix
          description: >-
            Generation operation. Only identity_remix is supported. Defaults to
            identity_remix when omitted.
          title: Mode
          type: string
        identity_images:
          description: One to five images of the identity to preserve.
          items:
            discriminator:
              mapping:
                asset_id: '#/components/schemas/AssetId'
                base64: '#/components/schemas/AssetBase64'
                url: '#/components/schemas/AssetUrl'
              propertyName: type
            oneOf:
              - $ref: '#/components/schemas/AssetUrl'
              - $ref: '#/components/schemas/AssetId'
              - $ref: '#/components/schemas/AssetBase64'
          maxItems: 5
          minItems: 1
          title: Identity Images
          type: array
        reference_images:
          description: >-
            Supply exactly one image whose clothing, pose, composition, and
            background should guide the result.
          items:
            discriminator:
              mapping:
                asset_id: '#/components/schemas/AssetId'
                base64: '#/components/schemas/AssetBase64'
                url: '#/components/schemas/AssetUrl'
              propertyName: type
            oneOf:
              - $ref: '#/components/schemas/AssetUrl'
              - $ref: '#/components/schemas/AssetId'
              - $ref: '#/components/schemas/AssetBase64'
          maxItems: 1
          minItems: 1
          title: Reference Images
          type: array
        aspect_ratio:
          anyOf:
            - enum:
                - '1:1'
                - '2:3'
                - '3:2'
                - '3:4'
                - '4:3'
                - '4:5'
                - '5:4'
                - '9:16'
                - '16:9'
              type: string
            - type: 'null'
          default: null
          description: >-
            Output aspect ratio. Omit to match the reference image after EXIF
            orientation. Explicit presets are exact; inferred ratios round to
            the nearest pixel. Output resolution follows the model's canvas
            policy; read width and height from each result.
          title: Aspect Ratio
        num_images:
          default: 1
          description: Number of images to generate in this job. Supports one to five.
          maximum: 5
          minimum: 1
          title: Num Images
          type: integer
        seed:
          anyOf:
            - maximum: 4294967295
              minimum: 0
              type: integer
            - type: 'null'
          default: null
          description: >-
            Seed for the first image. Each subsequent image increments the seed
            by one. A random seed is chosen when omitted.
          title: Seed
      required:
        - model
        - identity_images
        - reference_images
      title: CreateImageGenerationRequest
      type: object
    CreateImageGenerationResponse:
      properties:
        generation_id:
          description: Generation job identifier to use when polling for results.
          title: Generation Id
          type: string
        status:
          const: pending
          default: pending
          description: The request has been accepted for processing.
          title: Status
          type: string
      required:
        - generation_id
      title: CreateImageGenerationResponse
      type: object
    StandardAPIError:
      type: object
      properties:
        code:
          type: string
          description: Machine-readable error code
          example: invalid_parameter
        message:
          type: string
          description: Human-readable error message
          example: Video not found
        param:
          type:
            - string
            - 'null'
          description: Which request field caused the error
        doc_url:
          type:
            - string
            - 'null'
          description: Link to error documentation
        errors:
          type: array
          description: >-
            Per-item error details for batch/multi-node failures (e.g. graph
            compilation errors by node).
          items:
            $ref: '#/components/schemas/StandardAPIErrorDetail'
      required:
        - code
        - message
    AssetId:
      additionalProperties: false
      description: Asset input via HeyGen asset ID from the asset upload endpoint.
      properties:
        type:
          const: asset_id
          description: Input type discriminator
          title: Type
          type: string
        asset_id:
          description: HeyGen asset ID from the asset upload endpoint
          title: Asset Id
          type: string
      required:
        - type
        - asset_id
      title: AssetId
      type: object
    AssetBase64:
      additionalProperties: false
      description: Asset input via base64-encoded content.
      properties:
        type:
          const: base64
          description: Input type discriminator
          title: Type
          type: string
        media_type:
          description: MIME type of the encoded content (e.g. "image/png")
          title: Media Type
          type: string
        data:
          description: Base64-encoded file content
          title: Data
          type: string
      required:
        - type
        - media_type
        - data
      title: AssetBase64
      type: object
      x-mcp-visible: false
    AssetUrl:
      additionalProperties: false
      description: Asset input via publicly accessible HTTPS URL.
      properties:
        type:
          const: url
          description: Input type discriminator
          title: Type
          type: string
        url:
          description: Publicly accessible HTTPS URL for the asset
          title: Url
          type: string
      required:
        - type
        - url
      title: AssetUrl
      type: object
    StandardAPIErrorDetail:
      type: object
      properties:
        code:
          type: string
          description: Machine-readable error code
          example: unknown_node_type
        message:
          type: string
          description: Human-readable error message
          example: Unknown node type
        node_id:
          type: string
          description: Graph node id this error pertains to, if applicable
        port:
          type: string
          description: Port name on the node this error pertains to, if applicable
        path:
          type: string
          description: Field path within the item this error pertains to, if applicable
      required:
        - code
        - message
  responses:
    IdempotencyInProgress:
      description: >-
        A prior request with this Idempotency-Key is still in progress. Wait for
        the original request to complete, then retry.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                $ref: '#/components/schemas/StandardAPIError'
          example:
            error:
              code: request_in_progress
              message: >-
                A request with this Idempotency-Key is already in progress.
                Retry shortly.
              param: null
              doc_url: null
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: HeyGen API key. Obtain from your HeyGen dashboard.
    BearerAuth:
      type: http
      scheme: bearer
      description: OAuth2 bearer token.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.