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

# Genjutsu 1.0 / Lite

> Transfer motion or replace objects in a source video using reference images across Genjutsu 1.0 and 1.0 Lite.

## Parameters and input modes

`model` and `input` are required; omitted optional fields use model defaults. See the Body section below for full field definitions.

| Request type | Required input fields |
| - | - |
| Motion control (`1.0` only) | `mode: "motion_control"`, `video_url` (MP4/MOV/WebM/MKV, ≤30s), `reference_image_urls` (1–20) |
| Replace object (`1.0`) | `mode: "replace_object"`, `video_url` (MP4/MOV/WebM/MKV, 4–30s), `reference_image_urls` (1–20) |
| Replace object (`1.0-lite`) | `version: "1.0-lite"`, `mode: "replace_object"`, `video_url` (MP4/MOV/WebM/MKV, 4–30s), `reference_image_urls` (1–10) |

## Special modes

* **Version `1.0-lite` limits**: Supports `720p`/`1080p` only and requires reference image aspect ratios `< 3.3:1`. Combining `1.0-lite` with `motion_control`, `480p`, or more than 10 images returns HTTP 400.
* **Prompt references & strict fields**: Optional `prompt` supports `@Image1`… and `@Video1`. `aspect_ratio`, `duration`, and `seed` are rejected with HTTP 400.

## Use cases

Submit an example to `POST /api/v1/tasks/create_task` with your own media URLs.

```json Motion control (1.0) theme={null}
{
  "model": "genjutsu",
  "input": {
    "version": "1.0",
    "mode": "motion_control",
    "video_url": "https://cdn.example.com/source-motion.mp4",
    "reference_image_urls": [
      "https://cdn.example.com/character.jpg"
    ],
    "resolution": "720p"
  }
}
```

```json Replace object (1.0) theme={null}
{
  "model": "genjutsu",
  "input": {
    "version": "1.0",
    "mode": "replace_object",
    "video_url": "https://cdn.example.com/product-shot.mp4",
    "reference_image_urls": [
      "https://cdn.example.com/new-bottle.png"
    ],
    "resolution": "720p",
    "prompt": "Replace the clear bottle in @Video1 with the frosted glass bottle from @Image1, keeping hand grip and lighting consistent."
  }
}
```

```json Replace object (1.0 Lite) theme={null}
{
  "model": "genjutsu",
  "input": {
    "version": "1.0-lite",
    "mode": "replace_object",
    "video_url": "https://cdn.example.com/product-shot.mp4",
    "reference_image_urls": [
      "https://cdn.example.com/new-bottle.png"
    ],
    "resolution": "720p"
  }
}
```

> Track results via [Query task](https://docs.apistable.ai/query-task.md) or `callback_url` ([Webhook security](https://docs.apistable.ai/webhook-secret.md)); see [Create task](https://docs.apistable.ai/create-task.md) for submission errors. Output URLs remain valid for 14 days; tasks unfinished after 24 hours fail at no charge.

## Playground and pricing

Each successful output is billed separately per measured source-video second (longer of video or audio track): `motion_control` rounds to the nearest whole second (minimum 4s), and `replace_object` rounds up. Reference images and prompts add no charge; failed outputs cost 0. Check balances via [Available Credits](https://docs.apistable.ai/credits.md).

| Version & resolution | Credits / s | Price / s |
| - | - | - |
| `1.0` · `480p` | 29.3 | With bonus ≈ \*\*$0.133** · Regular $0.147 |
| `1.0` · `720p` (default) | 68.3 | With bonus ≈ \*\*$0.310** · Regular $0.342 |
| `1.0` · `1080p` | 195.0 | With bonus ≈ \*\*$0.886** · Regular $0.975 |
| `1.0-lite` · `720p` | 23.4 | With bonus ≈ \*\*$0.106** · Regular $0.117 |
| `1.0-lite` · `1080p` | 46.8 | With bonus ≈ \*\*$0.213** · Regular $0.234 |

> [card] [Try in Playground](https://apistable.ai/models/genjutsu#try)
>
> Switch between 1.0 and 1.0 Lite, upload a source clip, and measure quotes.

> [card] [View pricing](https://apistable.ai/models/genjutsu#pricing)
>
> Review 1.0 and 1.0 Lite per-second rates and bonus pricing.


## OpenAPI

````yaml openapi-genjutsu.json POST /api/v1/tasks/create_task
openapi: 3.1.0
info:
  title: APIstable API
  version: 1.0.0-preview
  description: >-
    Public /api/v1 protocol. Valid API keys have the same account-scoped access.
    Read the selected model documentation for its ID, supported inputs, result
    format and availability before submitting. No client submission idempotency
    or max_credits. Availability, pricing, file retention and callback formats
    follow the selected model contract. Unconfigured operations return 503.
servers:
  - url: https://apistable.ai
    description: API Stable API
security: []
paths:
  /api/v1/tasks/create_task:
    post:
      summary: Genjutsu 1.0 / Lite
      description: >-
        Transfer motion or replace objects in a source video using reference
        images across Genjutsu 1.0 and 1.0 Lite.
      operationId: genjutsu
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              additionalProperties: false
              properties:
                model:
                  type: string
                  enum:
                    - genjutsu
                  example: genjutsu
                  description: The APIstable model ID for this endpoint.
                input:
                  type: object
                  properties:
                    nsfw_check:
                      type: boolean
                      description: >-
                        Optional APIstable safety screening; defaults to false.
                        When true, screening failures reject the request; only
                        text and up to 20 images are screened; audio and video
                        are not screened (HTTP 400 above this limit). Playground
                        always enables screening.
                    output_count:
                      default: 1
                      type: integer
                      minimum: 1
                      maximum: 4
                      description: >-
                        Number of independent videos: integer 1–4, default 1.
                        Successful outputs are billed individually; failed
                        outputs cost nothing.
                    version:
                      default: '1.0'
                      type: string
                      enum:
                        - '1.0'
                        - 1.0-lite
                      description: >-
                        Model version: `1.0` (default) supports `motion_control`
                        and `replace_object` at `480p`/`720p`/`1080p` with 1–20
                        images; `1.0-lite` supports `replace_object` only at
                        `720p`/`1080p` with 1–10 images (aspect ratio < 3.3:1).
                    mode:
                      type: string
                      enum:
                        - motion_control
                        - replace_object
                      description: >-
                        Required workflow mode: `motion_control` (motion
                        transfer, `1.0` only) or `replace_object` (object
                        replacement, `1.0` and `1.0-lite`). Combining `1.0-lite`
                        with `motion_control` returns HTTP 400.
                    video_url:
                      type: string
                      format: uri
                      description: >-
                        Required source video (MP4, MOV, WebM, or MKV). Maximum
                        30s for `motion_control` and 4–30s for `replace_object`.
                        Returns HTTP 400 if video or audio tracks cannot be
                        measured.
                    reference_image_urls:
                      minItems: 1
                      maxItems: 20
                      type: array
                      items:
                        type: string
                        format: uri
                      description: >-
                        Required reference images: 1–20 images on `1.0`; 1–10
                        images on `1.0-lite` with aspect ratio < 3.3:1 in either
                        orientation.
                    resolution:
                      default: 720p
                      type: string
                      enum:
                        - 480p
                        - 720p
                        - 1080p
                      description: >-
                        Output resolution and per-second billing tier. Default
                        `720p`. `1.0` supports `480p`, `720p`, `1080p`;
                        `1.0-lite` supports `720p` and `1080p` only (`480p`
                        returns HTTP 400).
                    prompt:
                      type: string
                      maxLength: 5000
                      description: >-
                        Optional text instruction (up to 5,000 characters).
                        Reference images in array order as `@Image1`, `@Image2`…
                        and the source video as `@Video1`.
                  required:
                    - mode
                    - video_url
                    - reference_image_urls
                  additionalProperties: false
                  description: >-
                    Genjutsu video-to-video input. Rules for each field are
                    listed below.
                  not:
                    anyOf:
                      - properties:
                          version:
                            const: 1.0-lite
                          mode:
                            const: motion_control
                        required:
                          - version
                      - properties:
                          version:
                            const: 1.0-lite
                          resolution:
                            const: 480p
                        required:
                          - version
                      - properties:
                          version:
                            const: 1.0-lite
                          reference_image_urls:
                            minItems: 11
                        required:
                          - version
                          - reference_image_urls
                callback_url:
                  type: string
                  format: uri
                  description: >-
                    Optional public HTTPS endpoint for signed completion
                    callbacks; no redirects or private IPs.
            example:
              model: genjutsu
              input:
                version: '1.0'
                mode: motion_control
                video_url: https://cdn.example.com/source-motion.mp4
                reference_image_urls:
                  - https://cdn.example.com/character.jpg
                resolution: 720p
      responses:
        '200':
          description: Accepted task. Poll the common task endpoint or use callback_url.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - msg
                  - data
                additionalProperties: false
                properties:
                  code:
                    const: 200
                  msg:
                    const: success
                  data:
                    type: object
                    required:
                      - task_id
                    additionalProperties: false
                    properties:
                      task_id:
                        type: string
        '400':
          description: >-
            40001 invalid JSON, 40002 invalid input/callback or input rejected
            by screening, 40003 unsupported parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: '40201: Insufficient credits (live acceptance).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: '40301: Website session requests require the APIstable site origin.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: '40401: Unknown model or resource not found in this account.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: '40901: Resource incompatible with this operation.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: '41001: Source audio or temporary resource has expired.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: '41301: Request too large.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: '42201: Requested capability combination is not enabled.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: '42901: Rate/concurrency limit (live acceptance).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: '50301: Service unavailable. No live submission or charge.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      callbacks:
        Webhook:
          '{$request.body#/callback_url}':
            post:
              requestBody:
                required: true
                description: >-
                  When the task succeeds or fails, APIstable sends a JSON POST
                  to the `callback_url` supplied at creation. Verify the
                  signature and return HTTP 2xx to acknowledge delivery.


                  Read `data.status` to determine the generation outcome.
                  Successful tasks report `succeeded` with generated video URLs
                  in `data.result.urls`. For a failed task, `data.result` is
                  `null` and `data.message` contains the failure reason.


                  Use `X-APIstable-Signature`, `X-APIstable-Timestamp`, and
                  `X-APIstable-Event-Id` to verify and deduplicate deliveries.
                  See [Webhook security](/webhook-secret).


                  **Webhook payload example**


                  ```json

                  {
                    "code": 200,
                    "msg": "success",
                    "data": {
                      "task_id": "c6adbc82-8b9a-4d6f-8b60-1114c8c4aafb",
                      "model": "genjutsu",
                      "status": "succeeded",
                      "created_at": "2026-11-25T08:30:00.000Z",
                      "completed_at": "2026-11-25T08:32:00.000Z",
                      "duration": 120000,
                      "charged_credits": 341.5,
                      "message": "",
                      "input": "{\"version\":\"1.0\",\"mode\":\"motion_control\",\"video_url\":\"https://cdn.example.com/source-motion.mp4\",\"reference_image_urls\":[\"https://cdn.example.com/character.jpg\"],\"resolution\":\"720p\"}",
                      "result": {
                        "urls": [
                          "https://cdn.example.com/generated/video.mp4"
                        ],
                        "items": [
                          {
                            "id": "e7aacd19-819a-4747-bbbf-46fb6f2995a5",
                            "urls": [
                              "https://cdn.example.com/generated/video.mp4"
                            ],
                            "last_frame_url": null,
                            "draft": false,
                            "draft_expires_at": null
                          }
                        ]
                      }
                    }
                  }

                  ```
                content:
                  application/json:
                    schema:
                      type: object
                      required:
                        - code
                        - msg
                        - data
                      properties:
                        code:
                          type: integer
                          const: 200
                        msg:
                          type: string
                          const: success
                        data:
                          type: object
                          additionalProperties: false
                          required:
                            - task_id
                            - model
                            - status
                            - created_at
                            - completed_at
                            - duration
                            - charged_credits
                            - message
                            - input
                            - result
                          properties:
                            task_id:
                              type: string
                            model:
                              type: string
                              const: genjutsu
                            status:
                              type: string
                              enum:
                                - succeeded
                                - failed
                            created_at:
                              type: string
                              format: date-time
                            completed_at:
                              type:
                                - string
                                - 'null'
                              format: date-time
                            duration:
                              type:
                                - integer
                                - 'null'
                              minimum: 0
                              description: >-
                                Total elapsed milliseconds; null while
                                processing.
                            charged_credits:
                              type:
                                - number
                                - 'null'
                              minimum: 0
                              description: Final charged Credits; null until completion.
                            message:
                              type: string
                              description: >-
                                Failure reason for failed tasks, or an
                                actionable pending-settlement message while
                                processing; empty on success.
                            input:
                              type: string
                              contentMediaType: application/json
                              description: JSON-serialized accepted model input.
                            result:
                              type:
                                - object
                                - 'null'
                              required:
                                - urls
                                - items
                              properties:
                                urls:
                                  type: array
                                  items:
                                    type: string
                                    format: uri
                                items:
                                  type: array
                                  maxItems: 1
                                  items:
                                    type: object
                                    required:
                                      - id
                                      - urls
                                      - last_frame_url
                                      - draft
                                      - draft_expires_at
                                    properties:
                                      id:
                                        type: string
                                        format: uuid
                                      urls:
                                        type: array
                                        items:
                                          type: string
                                          format: uri
                                      last_frame_url:
                                        type:
                                          - string
                                          - 'null'
                                        format: uri
                                      draft:
                                        type: boolean
                                      draft_expires_at:
                                        type:
                                          - string
                                          - 'null'
                                        format: date-time
                    example:
                      code: 200
                      msg: success
                      data:
                        task_id: c6adbc82-8b9a-4d6f-8b60-1114c8c4aafb
                        model: genjutsu
                        status: succeeded
                        created_at: '2026-11-25T08:30:00.000Z'
                        completed_at: '2026-11-25T08:32:00.000Z'
                        duration: 120000
                        charged_credits: 341.5
                        message: ''
                        input: >-
                          {"version":"1.0","mode":"motion_control","video_url":"https://cdn.example.com/source-motion.mp4","reference_image_urls":["https://cdn.example.com/character.jpg"],"resolution":"720p"}
                        result:
                          urls:
                            - https://cdn.example.com/generated/video.mp4
                          items:
                            - id: e7aacd19-819a-4747-bbbf-46fb6f2995a5
                              urls:
                                - https://cdn.example.com/generated/video.mp4
                              last_frame_url: null
                              draft: false
                              draft_expires_at: null
              responses:
                2XX:
                  description: Webhook acknowledged.
              method: post
              type: path
            path: '{$request.body#/callback_url}'
      security:
        - bearerAuth: []
components:
  schemas:
    Error:
      type: object
      required:
        - code
        - msg
        - data
      properties:
        code:
          type: integer
        msg:
          type: string
        data:
          type: 'null'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Sign in to APIstable, then create and copy a key from [API Key
        management](https://apistable.ai/console/keys).


        Send this HTTP header with every request:


        ```http

        Authorization: Bearer YOUR_API_KEY

        ```


        Replace YOUR_API_KEY with the key you created.

````

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