主题
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 | 否 | 0 | Y 轴位置偏移 |
transform_x | 否 | 0 | X 轴位置偏移 |
alpha | 否 | 1.0 | 透明度,1.0 为不透明 |
flip_horizontal | 否 | False | |
flip_vertical | 否 | False | |
rotation | 否 | 0.0 | 旋转角度 |
scale_x | 否 | 1.0 | X 轴缩放比例 |
scale_y | 否 | 1.0 | Y 轴缩放比例 |
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_x | X 轴位置偏移,0 表示画面中心 |
transform_y | Y 轴位置偏移,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": ""
}