主题
query_script
POST /query_script
口径:本页参数表最后核对于 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 为准。
接口说明
读取草稿当前的 JSON 脚本,用于确认轨道、片段 ID、素材引用和编辑结果。大模型在添加蒙版、关键帧或美颜前,通常先用这个接口拿到真实的 segment_id,不要凭猜测填写。
请求参数
| 参数 | 必填 | 默认值 | 说明 |
|---|---|---|---|
draft_id | 是 | — | 草稿 ID,创建草稿后获得 |
force_update | 否 | False | 是否强制刷新素材元数据;只有确实需要重新探测媒体信息时才传 true |
调用示例
bash
curl -X POST https://your-domain.example/api/query_script \
-H "Content-Type: application/json" \
-H "X-API-Key: $VECTCUT_API_KEY" \
-d '{
"draft_id": "dfd_cat_demo_001",
"force_update": false
}'返回格式
json
{
"success": true,
"output": {
"canvas_config": {
"width": 1080,
"height": 1920,
"ratio": "original"
},
"duration": 5000000,
"fps": 30,
"tracks": [],
"materials": {
"videos": [],
"audios": [],
"texts": []
}
},
"error": ""
}output 已经是对象,调用方不需要再执行 json.loads。
query_script 内部沿用剪映草稿的时间格式,duration、target_timerange.start、target_timerange.duration 通常是微秒。上例里的 duration: 5000000 表示 5 秒:
text
5,000,000 microseconds / 1,000,000 = 5 seconds写入接口仍使用秒。只有读取 query_script,或明确处理旧版 target_timerange_unit: "us" 时,才需要做微秒换算。