Skip to content

add_sticker ​

POST /add_sticker

口径:本页参数表最后核对于 v23.9(2026-10-27)。v24.0~v24.8 的改动(add_video 的 timeline_start/timeline_end 别名、apply_edl 批内失败计数、resource/search 的 limit 与 count 等价、/agent/route 类型分诊等)以 llms-full.txt 与 GET /agent/capabilities 为准。

接口说明 ​

把选中的贴纸添加到草稿,并设置显示区间、位置、缩放、旋转、透明度和翻转。sticker_id 通常来自 search_sticker 的搜索结果。

请求参数 ​

参数必填默认值说明
sticker_id是—贴纸 ID,通常来自 search_sticker
start否0源素材开始时间,单位秒
end否5.0源素材结束时间,单位秒
draft_id是—草稿 ID,创建草稿后获得
transform_y否0Y 轴位置偏移
transform_x否0X 轴位置偏移
alpha否1.0透明度,1.0 为不透明
flip_horizontal否False
flip_vertical否False
rotation否0.0旋转角度
scale_x否1.0X 轴缩放比例
scale_y否1.0Y 轴缩放比例
position_preset否—位置预设,覆盖 transform_x/y;可选 center、top-center、bottom-center、top-left、top-right、bottom-left、bottom-right
size_preset否—尺寸预设,覆盖 scale_x/y;可选 small、medium、large、full-width
motion_preset否—运镜预设,自动生成关键帧;可选 zoom_in_slowly、zoom_out_slowly、pan_left_to_right、pan_right_to_left、ken_burns、shake
track_name否'sticker_main'目标轨道名称
relative_index否0轨道叠加顺序
width否1080画布或素材宽度
height否1920画布或素材高度

定位和大小 ​

贴纸使用归一化位置,不使用像素坐标:

参数说明
transform_xX 轴位置偏移,0 表示画面中心
transform_yY 轴位置偏移,0 表示画面中心
scale_x / scale_y缩放比例,1 为原始大小
rotation旋转角度,单位度
alpha透明度,0-1
flip_horizontal / flip_vertical水平、垂直翻转
width / height画布尺寸,不是贴纸图片宽高

add_sticker 没有 x / y 参数。位置参数必须使用 transform_x / transform_y。

调用示例 ​

bash
curl -X POST https://your-domain.example/api/add_sticker \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $VECTCUT_API_KEY" \
  -d '{
    "draft_id": "dfd_cat_demo_001",
    "sticker_id": "7050494369782123814",
    "start": 0,
    "end": 3,
    "scale_x": 0.8,
    "scale_y": 0.8,
    "transform_x": 0,
    "transform_y": 0.2
  }'

返回格式 ​

json
{
  "success": true,
  "output": {
    "draft_id": "dfd_cat_demo_001",
    "draft_url": "https://your-domain.example/api/draft/downloader?draft_id=dfd_cat_demo_001"
  },
  "error": ""
}

个人自建服务