Genjutsu

Genjutsu

Create and query Genjutsu tasks through the SJinn REST API

Tool Overview

Create Genjutsu tasks with POST https://sjinn.ai/api/un-api/create_tool_task, using Authorization: Bearer YOUR_API_KEY. An active membership and sufficient credits are required.

The currently supported task type is motion_transfer, which uses a source video's motion and reference images to generate a new video. The parameters and pricing below apply to this task type.

Parameters

Set tool_type to genjutsu-api and provide these fields in input:

ParameterTypeRequiredDescription
video_urlstringYesOne source video, nominally 4–30 seconds long. Measured durations up to 30.2 seconds are accepted.
image_urlsstring[]Yes1–30 reference images, in reference order.
promptstringYesDescribe the appearance and motion transfer you want. Must contain non-whitespace text.
resolutionstringYes480p, 720p, or 1080p.
task_typestringNoOnly motion_transfer is supported; defaults to this value.

All media URLs must be complete, publicly accessible HTTP/HTTPS URLs without embedded credentials. The server measures source duration before charging; caller-provided duration and credit fields do not affect billing. Output duration is determined by the workflow.

Source audio is always preserved in the depth-video reference. This does not force the final output's audio track. keep_origin_audio, provider selection, and the completion webhook are controlled by SJinn.

Pricing

ResolutionCredits per second
480P200
720P380
1080P900

Cost is ceil(source_duration) × resolution rate. A 5.2-second video at 720P costs 6 × 380 = 2280 credits. Videos over 30 seconds, up to the 30.2-second tolerance, are billed for 31 seconds.

Request Example

curl -X POST https://sjinn.ai/api/un-api/create_tool_task \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tool_type": "genjutsu-api",
    "input": {
      "video_url": "https://example.com/source.mp4",
      "image_urls": ["https://example.com/character.png"],
      "prompt": "Use the reference character while following the source video motion.",
      "resolution": "720p"
    }
  }'

Response and Task Status

{
  "success": true,
  "errorMsg": "",
  "error_code": 0,
  "data": {
    "task_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}

Poll POST /api/un-api/query_tool_task_status with the same authorization header and { "task_id": "YOUR_TASK_ID" }. Task records use task_type: "genjutsu-api"; status 0 means processing, 1 means completed, and 2 means failed. Completed videos appear in data.output_urls. Failed workflows refund the task's credits.

Task creation may take several minutes while probing the source video and submitting the workflow; generation then completes asynchronously. Save the returned task ID and poll it. An uncertain submission remains pending for reconciliation. If creation times out or a task remains pending, contact support before resubmitting to avoid duplicate paid workflows.

Related Links