Genjutsu 1.0 / Lite
curl --request POST \
--url https://apistable.ai/api/v1/tasks/create_task \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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'
}
})
};
fetch('https://apistable.ai/api/v1/tasks/create_task', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apistable.ai/api/v1/tasks/create_task"
payload = {
"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"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"code": 200,
"msg": "success",
"data": {
"task_id": "<string>"
}
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}Genjutsu
Genjutsu 1.0 / Lite
基于源视频与参考图片进行动作迁移或物体替换,在同一接口内支持 Genjutsu 1.0 与 1.0 Lite。
POST
/
api
/
v1
/
tasks
/
create_task
Genjutsu 1.0 / Lite
curl --request POST \
--url https://apistable.ai/api/v1/tasks/create_task \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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'
}
})
};
fetch('https://apistable.ai/api/v1/tasks/create_task', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apistable.ai/api/v1/tasks/create_task"
payload = {
"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"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"code": 200,
"msg": "success",
"data": {
"task_id": "<string>"
}
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}{
"code": 123,
"msg": "<string>",
"data": null
}参数与输入模式
请求必填model 与 input,省略的可选字段使用模型默认值。完整字段定义见下方 Body 区域。
| 请求场景 | 必填 input 字段 |
|---|---|
动作迁移(仅 1.0) | mode: "motion_control"、video_url(MP4/MOV/WebM/MKV,≤30 秒)、reference_image_urls(1–20 张) |
物体替换(1.0) | mode: "replace_object"、video_url(MP4/MOV/WebM/MKV,4–30 秒)、reference_image_urls(1–20 张) |
物体替换(1.0-lite) | version: "1.0-lite"、mode: "replace_object"、video_url(MP4/MOV/WebM/MKV,4–30 秒)、reference_image_urls(1–10 张) |
特殊模式
1.0-lite限制:仅支持720p/1080p,且参考图宽高比须< 3.3:1;传入motion_control、480p或超过 10 张图返回 HTTP 400。- 提示词指代与严格校验:可选
prompt支持@Image1… 与@Video1;传入aspect_ratio、duration或seed返回 HTTP 400。
使用场景示例
将下方示例提交至POST /api/v1/tasks/create_task,并替换为你自己的素材链接。
{
"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"
}
}
{
"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."
}
}
{
"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"
}
}
通过查询任务或 callback_url(Webhook 验签)获取结果,提交错误见创建任务。生成链接保留 14 天;超过 24 小时未完成的任务自动失败且不扣费。
在线试用与价格
每个成功视频分别按源视频(视频/音频轨较长者)计费秒数结算:motion_control 四舍五入到整秒(最少 4 秒),replace_object 向上取整。参考图与提示词不加价,失败项扣费为 0。余额查询见积分余额。| 版本与分辨率 | 积分 / 秒 | 价格 / 秒 |
|---|---|---|
1.0 · 480p | 29.3 | 折合 ≈ **$0.133** · 常规 $0.147 |
1.0 · 720p(默认) | 68.3 | 折合 ≈ **$0.310** · 常规 $0.342 |
1.0 · 1080p | 195.0 | 折合 ≈ **$0.886** · 常规 $0.975 |
1.0-lite · 720p | 23.4 | 折合 ≈ **$0.106** · 常规 $0.117 |
1.0-lite · 1080p | 46.8 | 折合 ≈ **$0.213** · 常规 $0.234 |
在线试用
切换 1.0 与 1.0 Lite,上传源视频并实时测算报价。
查看价格
查看 1.0 与 1.0 Lite 每秒费率与充值折合价。
授权
登录 APIstable 后,在 API Key 管理 创建并复制密钥。
每次调用都要在 HTTP 请求头传入:
Authorization: Bearer YOUR_API_KEY
将 YOUR_API_KEY 替换为你创建的 API Key。
请求体
application/json
回调
POST{$request.body#/callback_url}Webhook
请求体
application/json
任务成功或失败后,APIstable 向创建任务时传入的 callback_url 发送 JSON POST。验签后返回 HTTP 2xx 确认接收。
用 data.status 判断生成结果。成功时为 succeeded,生成视频链接位于 data.result.urls。全部失败时为 failed,data.result 为 null,data.message 提供失败原因。
签名和去重使用 X-APIstable-Signature、X-APIstable-Timestamp 和 X-APIstable-Event-Id。详见 Webhook 安全与验签。
Webhook 请求体示例
{
"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
}
]
}
}
}
响应
2XX
已接收 Webhook。