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

# Genjutsu Object Swap

> Higgsfield Genjutsu Object Swap replaces a targeted object, product, or element inside a 4-30s source MP4 video using 1-10 reference images while keeping the rest of the shot intact.

> [!NOTE]
>
> Pass exactly 1 public HTTPS MP4 video in `video_urls` (`4–30s`) and `1–10` public HTTPS replacement images in `image_urls`. Use `@video_1` and `@image_1` in the optional `prompt` (up to 5000 characters) to specify what to replace. Supports `480p`, `720p` (default), and `1080p`; output duration and aspect ratio follow the source video.


## OpenAPI

````yaml api-reference/openapi/genjutsu--genjutsu-1-0-object-swap.yaml POST /v1/videos/generations
openapi: 3.1.0
info:
  title: Genjutsu Object Swap API
  version: 1.0.0
  description: >-
    Higgsfield Genjutsu Object Swap replaces specific objects or products in a
    4-30s source MP4 video using 1-10 reference images while keeping the
    surrounding shot intact. In APIPod, the public model ID is
    genjutsu-1.0-object-swap.
servers:
  - url: https://api.apipod.ai
    description: Production
security: []
paths:
  /v1/videos/generations:
    post:
      tags:
        - Genjutsu Object Swap
      summary: Create Generation Task
      description: >-
        Replace targeted objects in 1 source MP4 video (4-30s) using 1-10
        reference images. Supports 480p, 720p, and 1080p; output duration and
        aspect ratio follow the source video. Public model ID is
        genjutsu-1.0-object-swap.
      operationId: create-genjutsu-genjutsu-1-0-object-swap
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              title: Genjutsu Object Swap
              properties:
                model:
                  type: string
                  title: Model ID
                  description: Public APIPod model ID.
                  const: genjutsu-1.0-object-swap
                video_urls:
                  type: array
                  title: Source Video
                  description: >-
                    Required. Exactly 1 public HTTPS MP4 video URL (4-30s).
                    Output duration and aspect ratio follow this video.
                  items:
                    type: string
                    description: Public HTTPS MP4 video URL.
                  minItems: 1
                  maxItems: 1
                image_urls:
                  type: array
                  title: Reference Images
                  description: >-
                    Required. 1-10 public HTTPS reference image URLs of the
                    replacement object or product.
                  items:
                    type: string
                    description: Public HTTPS image URL.
                  minItems: 1
                  maxItems: 10
                prompt:
                  type: string
                  title: Prompt
                  description: >-
                    Optional text guidance up to 5000 characters. Reference
                    assets with @video_1 and @image_1.
                  maxLength: 5000
                resolution:
                  type: string
                  title: Resolution
                  description: Output resolution (480p, 720p, or 1080p; default 720p).
                  enum:
                    - 480p
                    - 720p
                    - 1080p
                  default: 720p
                callback_url:
                  type: string
                  title: Callback URL
                  description: >-
                    Optional webhook URL to receive task completion
                    notifications.
              required:
                - model
                - video_urls
                - image_urls
            example:
              model: genjutsu-1.0-object-swap
              video_urls:
                - https://cdn.example.com/source-table.mp4
              image_urls:
                - https://cdn.example.com/ceramic-cup.png
              prompt: >-
                Replace the red mug in @video_1 with the ceramic cup from
                @image_1.
              resolution: 720p
      responses:
        '200':
          description: Task accepted
          content:
            application/json:
              schema:
                type: object
                title: Task Submit Response
                properties:
                  code:
                    type: integer
                  data:
                    type: object
                    properties:
                      task_id:
                        type: string
                        description: generation task id
                  message:
                    type: string
                required:
                  - code
                  - message
                  - data
              example:
                code: 200
                message: success
                data:
                  task_id: vid_task_01JEXAMPLE
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |-
            curl https://api.apipod.ai/v1/videos/generations \
              -H "Authorization: Bearer $APIPOD_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
              "model": "genjutsu-1.0-object-swap",
              "video_urls": ["https://cdn.example.com/source-table.mp4"],
              "image_urls": ["https://cdn.example.com/ceramic-cup.png"],
              "prompt": "Replace the red mug in @video_1 with the ceramic cup from @image_1.",
              "resolution": "720p"
            }'
        - lang: Python
          label: Python
          source: |-
            import os import requests
            response = requests.post(
                "https://api.apipod.ai/v1/videos/generations",
                headers={
                    "Authorization": f"Bearer {os.environ['APIPOD_API_KEY']}",
                    "Content-Type": "application/json",
                },
                json={
                    "model": "genjutsu-1.0-object-swap",
                    "video_urls": ["https://cdn.example.com/source-table.mp4"],
                    "image_urls": ["https://cdn.example.com/ceramic-cup.png"],
                    "prompt": "Replace the red mug in @video_1 with the ceramic cup from @image_1.",
                    "resolution": "720p",
                },
                timeout=60,
            ) response.raise_for_status() print(response.json())
        - lang: JavaScript
          label: Node.js
          source: >-
            const response = await
            fetch("https://api.apipod.ai/v1/videos/generations", {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.APIPOD_API_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                model: "genjutsu-1.0-object-swap",
                video_urls: ["https://cdn.example.com/source-table.mp4"],
                image_urls: ["https://cdn.example.com/ceramic-cup.png"],
                prompt: "Replace the red mug in @video_1 with the ceramic cup from @image_1.",
                resolution: "720p",
              }),
            });

            if (!response.ok) {
              throw new Error(`APIPod request failed: ${response.status} ${await response.text()}`);
            }

            console.log(await response.json());
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: APIPod API key
      description: Use your APIPod API key as a Bearer token in the Authorization header.

````

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