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

# Video Swap

> Replace people, outfits, objects, or the setting in an existing video with up to four reference images, keeping its motion, timing, camera, and sound. Krea works out what each reference replaces; use the prompt only to state your own mapping, such as "@Image2 replaces the man on the left". The source video must be 4 to 29 seconds long with `seedance-2-5` (Standard) and 4 to 15 seconds with `wan30` (Lite). `minimax_h3max_recast` (Recast) swaps people only, one reference photo per new person from left to right, takes a 5 to 30 second source with no single shot over 15 seconds, and renders at 768p or 1080p. The price is the chosen model's price for the source's length, plus a per-second swap fee for Standard and Lite.



## OpenAPI

````yaml https://api.krea.ai/openapi.json post /generate/video/krea/video-swap
openapi: 3.1.0
info:
  title: Krea API
  version: v1
servers:
  - url: https://api.krea.ai
    description: Krea API
security:
  - bearerAuth: []
tags:
  - name: General
    description: Core API operations including job management and billing information
  - name: Krea
    description: Krea-owned generation models including Krea 2
  - name: Assets
    description: >-
      Asset management endpoints for uploading and managing images, videos,
      audio files, and 3D models
  - name: Styles
    description: Style (LoRA) generation and management endpoints
  - name: Node Apps
    description: Executing custom node apps built in our nodes tool
  - name: Image
    description: Image generation endpoints
  - name: Image Enhance
    description: Image enhance endpoints
  - name: Video
    description: Video generation endpoints
  - name: Video Enhance
    description: Video enhance and upscale endpoints
  - name: 3D
    description: 3D model generation endpoints
  - name: Audio
    description: Speech and audio generation endpoints
  - name: Usage
    description: Workspace usage reporting
  - name: Agent
    description: Krea Agent sessions
  - name: Utilities
    description: Miscellaneous utility endpoints
paths:
  /generate/video/krea/video-swap:
    post:
      tags:
        - Video
      summary: Video Swap
      description: >-
        Replace people, outfits, objects, or the setting in an existing video
        with up to four reference images, keeping its motion, timing, camera,
        and sound. Krea works out what each reference replaces; use the prompt
        only to state your own mapping, such as "@Image2 replaces the man on the
        left". The source video must be 4 to 29 seconds long with `seedance-2-5`
        (Standard) and 4 to 15 seconds with `wan30` (Lite).
        `minimax_h3max_recast` (Recast) swaps people only, one reference photo
        per new person from left to right, takes a 5 to 30 second source with no
        single shot over 15 seconds, and renders at 768p or 1080p. The price is
        the chosen model's price for the source's length, plus a per-second swap
        fee for Standard and Lite.
      parameters:
        - name: X-Webhook-URL
          in: header
          required: false
          schema:
            type: string
            format: uri
          description: >-
            URL to receive a POST request when the job completes. The webhook
            will receive the job data including results. Deliveries are signed
            with Ed25519 (EdDSA); verify them with the keys at
            https://api.krea.ai/.well-known/jwks.json (see X-Krea-Webhook-*
            headers). Treat requests without these headers as unauthenticated.
      requestBody:
        content:
          application/json:
            example: {}
            schema:
              type: object
              properties:
                source_video:
                  type: string
                  maxLength: 1024
                  format: uri
                  description: >-
                    Can be an external URL, base64 data URI, or uploaded asset
                    URL.
                references:
                  minItems: 1
                  maxItems: 4
                  type: array
                  items:
                    type: string
                    maxLength: 1024
                    format: uri
                    description: >-
                      Can be an external URL, base64 data URI, or uploaded asset
                      URL.
                model:
                  default: seedance-2-5
                  description: >-
                    "seedance-2-5" (Standard, the default), "wan30" (Lite) or
                    "minimax_h3max_recast" (Recast, people only).
                  type: string
                  enum:
                    - seedance-2-5
                    - wan30
                    - minimax_h3max_recast
                resolution:
                  default: 720p
                  description: >-
                    Standard and Lite render at 480p, 720p or 1080p. Recast
                    renders at 768p or 1080p, and takes 720p as 768p.
                  type: string
                  enum:
                    - 480p
                    - 720p
                    - 768p
                    - 1080p
                prompt:
                  description: >-
                    Optional direction, such as which reference replaces whom.
                    References are @Image1 to @Image4 in the order given.
                  type: string
                  maxLength: 1000
              required:
                - source_video
                - references
              additionalProperties: false
      responses:
        '200':
          description: >-
            The resulting job data. This will be returned in a pending state
            until the job is completed. See
            [`/jobs/{id}`](#tag/default/get/jobs/{id}) for retrieving the
            results.
          content:
            application/json:
              schema:
                type: object
                properties:
                  job_id:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  status:
                    type: string
                    enum:
                      - backlogged
                      - queued
                      - scheduled
                      - processing
                      - sampling
                      - intermediate-complete
                      - completed
                      - failed
                      - cancelled
                  created_at:
                    type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                  completed_at:
                    type: 'null'
                  result:
                    type: 'null'
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Why the job failed. `invalid_request` means the
                          request broke a rule, such as a media limit or a file
                          that cannot be read or downloaded. `validation_failed`
                          means a value is outside its parameter's schema. For
                          both codes, change the parameter named in `param`
                          before you resubmit. Other codes are `content_policy`,
                          `model_unavailable`, `insufficient_balance`,
                          `timeout`, `auto_cancelled`, `provider_error`,
                          `internal`, and `node_app_node_failed`. Treat an
                          unknown code as `internal`.
                      message:
                        type: string
                      param:
                        description: >-
                          The request parameter to change, present with
                          `invalid_request` and `validation_failed`.
                        type: string
                    required:
                      - code
                    additionalProperties: false
                  progress:
                    anyOf:
                      - type: number
                        minimum: 0
                        maximum: 1
                      - type: 'null'
                required:
                  - job_id
                  - status
                  - created_at
                  - completed_at
                  - result
                additionalProperties: false
        '400':
          description: The request body is invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '401':
          description: You are not authenticated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '402':
          description: You have run out of credits.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '429':
          description: You have reached the maximum number of concurrent jobs.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      scheme: bearer
      bearerFormat: Bearer
      type: http

````

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