### Parameter Examples Source: https://docs.jcaigc.cn/docs/audio_infos.html Individual examples for specific request parameters. ```json ["https://assets.jcaigc.cn/bgm.mp3", "https://assets.jcaigc.cn/sfx.mp3"] ``` ```json [{"start": 0, "end": 5000000}, {"start": 5000000, "end": 10000000}] ``` ```json "reverb", "echo", "bass_boost" ``` ```json 0.8 ``` -------------------------------- ### cURL Example: Get All Entrance Animations Source: https://docs.jcaigc.cn/docs/get_text_animations.zh.html Retrieve all entrance animations (mode 0). ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_text_animations \ -H "Content-Type: application/json" \ -d '{ "mode": 0, "type": "in" }' ``` -------------------------------- ### Request Parameters Example Source: https://docs.jcaigc.cn/docs/add_keyframes.html Example JSON payload for the request, including the draft URL and the keyframes string. ```json { "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258", "keyframes": "[{\"property\":\"position.x\",\"time\":0,\"value\":0},{\"property\":\"position.x\",\"time\":1000000,\"value\":100}]" } ``` -------------------------------- ### cURL example with mask and transition for video_infos Source: https://docs.jcaigc.cn/docs/video_infos.html cURL example with mask and transition settings. Uses a circle mask, the transition named '叠化', and a volume of 0.8. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/video_infos \ -H "Content-Type: application/json" \ -d '{ "video_urls": ["https://assets.jcaigc.cn/clip1.mp4", "https://assets.jcaigc.cn/clip2.mp4"], "timelines": [{"start": 0, "end": 3000000}, {"start": 3000000, "end": 6000000}], "mask": "circle", "transition": "叠化", "volume": 0.8 }' ``` -------------------------------- ### Request Parameters Example Source: https://docs.jcaigc.cn/docs/keyframes_infos.html Example JSON payload for the keyframes_infos request. ```json { "ctype": "position", "offsets": [0.0, 0.5, 1.0], "values": [0.0, 0.5, 1.0], "segment_infos": [ {"id": "segment1", "start": 0, "end": 5000000} ], "height": 1080, "width": 1920 } ``` -------------------------------- ### Request Body Example Source: https://docs.jcaigc.cn/docs/create_draft.html Example request body showing the default resolution (1920x1080). Both width and height are optional; defaults are 1920 and 1080 respectively. ```json { "width": 1920, "height": 1080 } ``` -------------------------------- ### Basic cURL example for video_infos Source: https://docs.jcaigc.cn/docs/video_infos.html Basic cURL example for generating video information without mask or transition settings. Uses the default height (1080) and width (1920). ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/video_infos \ -H "Content-Type: application/json" \ -d '{ "video_urls": ["https://assets.jcaigc.cn/intro.mp4"], "timelines": [{"start": 0, "end": 5000000}], "height": 1080, "width": 1920 }' ``` -------------------------------- ### Success Response Example Source: https://docs.jcaigc.cn/docs/create_draft.html Example success response (HTTP 200) containing the draft URL and help document URL. The draft_url has a limited validity period. ```json { "draft_url": "https://cm.jcaigc.cn/openapi/v1/get_draft?draft_id=2025092811473036584258", "tip_url": "https://help.assets.jcaigc.cn/draft-usage" } ``` -------------------------------- ### Request Body Example Source: https://docs.jcaigc.cn/docs/get_text_animations.zh.html Example JSON request body for the API. ```json { "mode": 0, "type": "in" } ``` -------------------------------- ### Success Response Example Source: https://docs.jcaigc.cn/docs/get_text_animations.zh.html Example of a successful 200 response containing the list of animation effects. ```json { "effects": [ { "resource_id": "7314291622525538843", "type": "in", "category_id": "ruchang", "category_name": "入场", "duration": 500000, "id": "35395178", "name": "冰雪飘动", "request_id": "", "start": 0, "icon_url": "https://lf5-hl-hw-effectcdn-tos.byteeffecttos.com/obj/ies.fe.effect/459c196951cadbd024456a63db89481f", "material_type": "sticker", "panel": "", "path": "", "platform": "all" }, { "resource_id": "7397306443147252233", "type": "in", "category_id": "ruchang", "category_name": "入场", "duration": 500000, "id": "77035159", "name": "变色输入", "request_id": "", "start": 0, "icon_url": "https://lf5-hl-hw-effectcdn-tos.byteeffecttos.com/obj/ies.fe.effect/c15f5c313f8170c558043abf300a0692", "material_type": "sticker", "panel": "", "path": "", "platform": "all" } ] } ``` -------------------------------- ### Basic Video Generation cURL Example Source: https://docs.jcaigc.cn/docs/gen_video.html A cURL command to submit a video generation task using the API. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/gen_video \ -H "Content-Type: application/json" \ -d '{ "draft_url": "YOUR_DRAFT_URL" }' ``` -------------------------------- ### cURL 基本获取草稿文件列表 Source: https://docs.jcaigc.cn/docs/get_draft.zh.html 使用 cURL 发送 GET 请求获取指定草稿的文件列表。 ```bash curl -X GET "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2f52a63b-8c6a-4417-8b01-1b2a569ccb6c" \ -H "Content-Type: application/json" ``` -------------------------------- ### cURL example 3: minimal request with only audio Source: https://docs.jcaigc.cn/docs/easy_create_material.zh.html Minimal JSON body snippet for adding only audio material. Only the required audio_url parameter is provided. ```json "audio_url": "https://assets.jcaigc.cn/audio.wav" ``` -------------------------------- ### cURL example 2: add audio and text only Source: https://docs.jcaigc.cn/docs/easy_create_material.zh.html JSON body snippet for adding only audio and text materials. Includes text content, color, and font size. ```json "audio_url": "https://assets.jcaigc.cn/background_music.mp3", "text": "欢迎观看", "text_color": "#0066ff", "font_size": 18 ``` -------------------------------- ### JavaScript: Fetch and Apply Text Effects Source: https://docs.jcaigc.cn/docs/get_text_effects.html Example workflow showing how to fetch the text effects list and use a selected effect when calling the add_captions API. ```javascript // 1. Fetch text effects list const effectsResponse = await fetch('/openapi/capcut-mate/v1/get_text_effects', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ mode: 0 }) }); const effects = await effectsResponse.json(); // 2. User selects a text effect const selectedEffect = effects.text_effects[0]; // 3. Apply the effect when adding captions await fetch('/openapi/capcut-mate/v1/add_captions', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ draft_id: "your_draft_id", captions: [...], text_effect: selectedEffect.title // or selectedEffect.id }) }); ``` -------------------------------- ### Request body example Source: https://docs.jcaigc.cn/docs/timelines.html Example JSON request body for the TIMELINES API. duration is in microseconds, num is the number of segments, start defaults to 0, and type defaults to "equal". ```json { "duration": 10000000, "num": 3, "start": 0, "type": "equal" } ``` -------------------------------- ### POST /openapi/capcut-mate/v1/easy_create_material Source: https://docs.jcaigc.cn/docs/easy_create_material.zh.html 在现有草稿中添加多种类型的素材内容,包括音频、视频、图片和文字。该接口可以一次性向草稿添加多种媒体素材,自动处理素材的时长、尺寸等属性,并智能管理不同类型的媒体轨道。是视频创作的核心接口之一。 ```APIDOC ## POST /openapi/capcut-mate/v1/easy_create_material ### Description 在现有草稿中添加多种类型的素材内容,包括音频、视频、图片和文字。该接口可以一次性向草稿添加多种媒体素材,自动处理素材的时长、尺寸等属性,并智能管理不同类型的媒体轨道。是视频创作的核心接口之一。 ### Method POST ### Endpoint https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/easy_create_material ### Parameters #### Request Body - **draft_url** (string) - Required - 目标草稿的完整URL - **audio_url** (string) - Required - 音频文件URL,不能为空或null - **text** (string) - Optional - 要添加的文字内容 - **img_url** (string) - Optional - 图片文件URL - **video_url** (string) - Optional - 视频文件URL - **text_color** (string) - Optional - 文字颜色(十六进制格式) - **font_size** (integer) - Optional - 字体大小 - **text_transform_y** (integer) - Optional - 文字Y轴位置偏移 ### Request Example { "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258", "audio_url": "https://assets.jcaigc.cn/audio.mp3", "text": "Hello World", "img_url": "https://s.coze.cn/t/JTa5Ne6_liY/", "video_url": "https://assets.jcaigc.cn/video.mp4", "text_color": "#ff0000", "font_size": 20, "text_transform_y": 100 } ### Response #### Success Response (200) - **draft_url** (string) - 更新后的草稿URL #### Response Example { "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258" } #### Error Response (4xx/5xx) - **detail** (string) - 错误信息描述 #### Error Response Example { "detail": "错误信息描述" } ### Error Codes - **400** - draft_url是必填项 - 缺少草稿URL参数 - 提供有效的draft_url - **400** - audio_url是必填项 - 缺少音频URL参数 - 提供有效的audio_url - **400** - 无效的草稿信息,请检查草稿参数是否正确 - 草稿参数校验失败 - 检查草稿参数是否符合要求 - **404** - 草稿不存在 - 指定的草稿URL无效 - 检查草稿URL是否正确 - **500** - 素材创建失败 - 内部处理错误 - 联系技术支持 ### Notes - 音频必填: audio_url是必填参数,不能为空或null - 素材URL必须可公开访问,建议使用HTTPS协议 - text_color使用标准十六进制格式(如 #ffffff、#000000) - font_size建议范围10-50 - text_transform_y用于调整文字在画面中的垂直位置 - 不同素材类型有不同的默认显示时长: 音频自动获取原始时长, 视频固定5秒, 图片默认3秒, 文字默认5秒 - 系统自动创建不同类型素材的轨道 - 避免同时添加大量素材 ``` -------------------------------- ### cURL Example: Get Free Loop Animations Source: https://docs.jcaigc.cn/docs/get_text_animations.zh.html Retrieve only free loop animations (mode 2). ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_text_animations \ -H "Content-Type: application/json" \ -d '{ "mode": 2, "type": "loop" }' ``` -------------------------------- ### cURL Example: Get VIP Exit Animations Source: https://docs.jcaigc.cn/docs/get_text_animations.zh.html Retrieve only VIP exit animations (mode 1). ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_text_animations \ -H "Content-Type: application/json" \ -d '{ "mode": 1, "type": "out" }' ``` -------------------------------- ### filter_infos array structure example Source: https://docs.jcaigc.cn/docs/add_filters.html Shows the JSON structure of the filter_infos array with fields filter_title, start, end, and intensity. Comments indicate required parameters and default intensity. ```json [ { "filter_title": "1980", // Filter name/title, required parameter "start": 0, // Filter start time (microseconds), required parameter "end": 5000000, // Filter end time (microseconds), required parameter "intensity": 80 // Filter intensity (0-100), optional, default 100 } ] ``` -------------------------------- ### 接口信息:POST /openapi/capcut-mate/v1/audio_timelines Source: https://docs.jcaigc.cn/docs/audio_timelines.zh.html 该接口用于根据音频文件时长计算时间线。请求方法为POST,路径为/openapi/capcut-mate/v1/audio_timelines。 ```http POST /openapi/capcut-mate/v1/audio_timelines ``` -------------------------------- ### POST /openapi/capcut-mate/v1/gen_video_status 接口地址 Source: https://docs.jcaigc.cn/docs/gen_video_status.zh.html 接口的请求方法为 POST,路径为 /openapi/capcut-mate/v1/gen_video_status。 ```bash POST /openapi/capcut-mate/v1/gen_video_status ``` -------------------------------- ### POST /openapi/capcut-mate/v1/add_videos Source: https://docs.jcaigc.cn/docs/add_videos.zh.html 批量向现有草稿中添加视频素材。该接口支持多个视频的批量处理,包括时间范围控制、透明度调整、遮罩效果、转场动画、音量控制、缩放变换等高级功能。 ```APIDOC ## POST /openapi/capcut-mate/v1/add_videos ### Description 批量向现有草稿中添加视频素材。该接口支持多个视频的批量处理,包括时间范围控制、透明度调整、遮罩效果、转场动画、音量控制、缩放变换等高级功能。 ### Method POST ### Endpoint /openapi/capcut-mate/v1/add_videos ### Parameters #### Request Body - **draft_url** (string) - Required - 目标草稿的完整URL - **video_infos** (string) - Required - 视频信息数组的JSON字符串 - **scene_timelines** (array[object]) - Optional - 场景时间线数组,用于视频变速,与video_infos一一对应 - **alpha** (number) - Optional - 全局透明度(0-1),默认值1.0 - **scale_x** (number) - Optional - X轴缩放比例,默认值1.0 - **scale_y** (number) - Optional - Y轴缩放比例,默认值1.0 - **transform_x** (number) - Optional - X轴位置偏移(像素),默认值0 - **transform_y** (number) - Optional - Y轴位置偏移(像素),默认值0 #### video_infos 数组结构 - **video_url** (string) - Required - 视频文件的URL地址 - **width** (number) - Optional - 视频宽度(像素),不传则自动获取视频文件尺寸 - **height** (number) - Optional - 视频高度(像素),不传则自动获取视频文件尺寸 - **start** (number) - Required - 视频开始播放时间(微秒) - **end** (number) - Required - 视频结束播放时间(微秒) - **duration** (number) - Optional - 视频总时长(微秒),默认值为end-start - **mask** (string) - Optional - 遮罩类型 - **transition** (string) - Optional - 转场名称,须为支持的转场名称列表中的值 - **transition_duration** (number) - Optional - 转场持续时间(微秒),默认值500000 - **volume** (number) - Optional - 音量大小(0-1),默认值1.0 #### scene_timelines 数组结构 - **start** (number) - Required - 场景开始时间(微秒) - **end** (number) - Required - 场景结束时间(微秒) ### Request Example { "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258", "video_infos": "[{\"video_url\":\"https://assets.jcaigc.cn/video1.mp4\",\"width\":1024,\"height\":1024,\"start\":0,\"end\":5000000,\"duration\":5000000,\"mask\":\"圆形\",\"transition\":\"叠化\",\"transition_duration\":500000,\"volume\":0.8}]", "scene_timelines": [{"start":0,"end":2500000}], "alpha": 0.5, "scale_x": 1.0, "scale_y": 1.0, "transform_x": 100, "transform_y": 200 } ### Response #### Success Response (200) 未在文档中明确说明响应结构。 #### Response Example 未在文档中提供响应示例。 ``` -------------------------------- ### 添加整段文本阴影 Source: https://docs.jcaigc.cn/docs/add_captions.zh.html 通过设置 has_shadow 为 true 使用默认的 shadow_info 为字幕添加阴影效果。 ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/add_captions \ -H "Content-Type: application/json" \ -d '{ "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258", "captions": "[{\"start\":0,\"end\":5000000,\"text\":\"你好,剪映\"}]", "text_color": "#ffffff", "font_size": 20, "has_shadow": true }' ``` -------------------------------- ### GET /openapi/capcut-mate/v1/get_draft Source: https://docs.jcaigc.cn/docs/get_draft.html Documentation for the GET /openapi/capcut-mate/v1/get_draft endpoint, which retrieves the file list for a specified draft ID. ```APIDOC ## GET /openapi/capcut-mate/v1/get_draft ### Description Get draft file list. This interface is used to get all file lists corresponding to the specified draft ID, allowing you to view material files, configuration files, etc. in the draft. Usually used for draft content preview, file management or status checking. ### Method GET ### Endpoint /openapi/capcut-mate/v1/get_draft ### Parameters #### Query Parameters - **draft_id** (string) - Required - Draft ID, length 20-32 characters ### Request Example ``` curl -X GET "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2f52a63b-8c6a-4417-8b01-1b2a569ccb6c" \ -H "Content-Type: application/json" ``` ### Response #### Success Response (200) - **files** (array) - List of files related to the draft #### Response Example ``` { "files": [ "2f52a63b-8c6a-4417-8b01-1b2a569ccb6c.json", "video_123456789.mp4", "audio_987654321.mp3", "image_555666777.jpg", "thumbnail_888999000.png" ] } ``` #### Error Response (4xx/5xx) ``` { "detail": "Error message description" } ``` ### Error Codes - **400** - draft_id is required - Missing draft_id parameter - Provide a valid draft_id - **400** - Invalid draft_id length - draft_id length not within 20-32 characters range - Check if draft_id format is correct - **400** - Invalid draft_id format - draft_id format is incorrect - Ensure using correct draft ID format - **404** - Draft does not exist - Specified draft ID cannot be found - Confirm that draft ID is correct and exists - **500** - Failed to get file list - Internal service error - Contact technical support or retry later - **503** - Service unavailable - System maintenance - Retry later ``` -------------------------------- ### POST /openapi/capcut-mate/v1/add_videos 接口调用 Source: https://docs.jcaigc.cn/docs/add_videos.zh.html 向现有草稿批量添加视频素材的HTTP接口。使用POST方法,请求体为JSON格式,包含draft_url、video_infos等参数。 ```http POST /openapi/capcut-mate/v1/add_videos ``` -------------------------------- ### cURL: Timeline with start time Source: https://docs.jcaigc.cn/docs/timelines.html cURL command to create a timeline with duration 20000000 microseconds, 4 segments, start 5000000, and type equal. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/timelines \ -H "Content-Type: application/json" \ -d '{ "duration": 20000000, "num": 4, "start": 5000000, "type": "equal" }' ``` -------------------------------- ### POST /openapi/capcut-mate/v1/add_audios Source: https://docs.jcaigc.cn/docs/add_audios.zh.html 批量向现有草稿中添加音频素材。该接口支持添加多个音频文件到剪映草稿,为视频创建背景音乐、音效、旁白等音频内容。音频将被添加到独立的音频轨道中,不会影响视频内容。 ```APIDOC ## POST /openapi/capcut-mate/v1/add_audios ### Description 批量向现有草稿中添加音频素材。该接口支持添加多个音频文件到剪映草稿,为视频创建背景音乐、音效、旁白等音频内容。音频将被添加到独立的音频轨道中,不会影响视频内容。 ### Method POST ### Endpoint /openapi/capcut-mate/v1/add_audios ### Parameters #### Request Body - **draft_url** (string) - Required - 目标草稿的完整URL - **audio_infos** (string) - Required - 音频信息数组的JSON字符串 #### audio_infos 数组结构 - **audio_url** (string) - Required - 音频文件的URL地址 - **start** (number) - Required - 音频开始播放时间(微秒) - **end** (number) - Required - 音频结束播放时间(微秒) - **duration** (number) - Optional - 音频总时长(微秒),如果不提供将自动获取 - **volume** (number) - Optional - 音量大小(0.0-2.0),默认值1.0 - **audio_effect** (string) - Optional - 音频效果名称,默认值None ### Request Example { "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258", "audio_infos": "[{\"audio_url\":\"https://assets.jcaigc.cn/audio1.mp3\",\"start\":0,\"end\":5000000,\"duration\":10000000,\"volume\":1.0,\"audio_effect\":\"reverb\"}]" } ### Response #### Success Response (200) - **draft_url** (string) - 更新后的草稿URL - **track_id** (string) - 音频轨道ID - **audio_ids** (array) - 添加的音频ID列表 #### Response Example { "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258", "track_id": "audio-track-uuid", "audio_ids": ["audio1-uuid", "audio2-uuid", "audio3-uuid"] } #### Error Response (4xx/5xx) - **detail** (string) - 错误信息描述 #### Error Response Example { "detail": "错误信息描述" } ### Error Codes - **400** - draft_url是必填项 - 缺少草稿URL参数 - 提供有效的草稿URL - **400** - audio_infos是必填项 - 缺少音频信息参数 - 提供有效的音频信息JSON - **400** - audio_infos格式错误 - JSON格式不正确 - 检查JSON字符串格式 - **400** - 音频配置验证失败 - 音频参数不符合要求 - 检查每个音频的参数 - **400** - audio_url是必填项 - 音频URL缺失 - 为每个音频提供URL - **400** - 时间范围无效 - end必须大于start - 确保结束时间大于开始时间 - **400** - 音量值无效 - volume不在0.0-2.0范围内 - 使用0.0-2.0之间的音量值 - **404** - 草稿不存在 - 指定的草稿URL无效 - 检查草稿URL是否正确 - **404** - 音频资源不存在 - 音频URL无法访问 - 检查音频URL是否可访问 - **500** - 音频处理失败 - 内部处理错误 - 联系技术支持 ### Notes - **JSON格式** : audio_infos必须是合法的JSON字符串 - **时间单位** : 所有时间参数使用微秒(1秒 = 1,000,000微秒) - **音频格式** : 确保音频文件格式被支持(如MP3、WAV、AAC等) - **文件大小** : 大音频文件可能影响处理速度 - **网络访问** : 音频URL必须可以正常访问 - **音量范围** : 音量值必须在0.0-2.0范围内 - **轨道限制** : 同一时间段可能存在音频重叠 ``` -------------------------------- ### POST /openapi/capcut-mate/v1/audio_timelines Source: https://docs.jcaigc.cn/docs/audio_timelines.zh.html 根据音频文件时长计算时间线。该接口通过分析输入音频文件的时长信息,自动计算并生成合适的时间线配置,用于视频编辑中音频素材的精确时间安排。 ```APIDOC ## POST /openapi/capcut-mate/v1/audio_timelines ### Description 根据音频文件时长计算时间线。该接口通过分析输入音频文件的时长信息,自动计算并生成合适的时间线配置,用于视频编辑中音频素材的精确时间安排。 ### Method POST ### Endpoint /openapi/capcut-mate/v1/audio_timelines ### Parameters #### Request Body - **links** (array[object]) - Required - 音频链接信息数组 - **url** (string) - Required - 音频文件URL地址 - **duration** (number) - Required - 音频时长(微秒) ### Request Example { "links": [ { "url": "https://assets.jcaigc.cn/audio1.mp3", "duration": 5000000 }, { "url": "https://assets.jcaigc.cn/audio2.mp3", "duration": 3000000 } ] } ### Response #### Success Response (200) - **timelines** (array) - 分段音频时间线数组 - **start** (number) - 时间段开始时间(微秒) - **end** (number) - 时间段结束时间(微秒) - **all_timelines** (array) - 完整音频时间线数组 - **start** (number) - 时间段开始时间(微秒) - **end** (number) - 时间段结束时间(微秒) #### Response Example { "timelines": [ { "start": 0, "end": 5000000 }, { "start": 5000000, "end": 8000000 } ], "all_timelines": [ { "start": 0, "end": 8000000 } ] } #### Error Response (4xx/5xx) { "detail": "错误信息描述" } ### Error Codes - **400** - links是必填项 - 缺少音频链接参数 - 提供有效的links数组 - **400** - links格式错误 - JSON格式不正确 - 检查JSON数组格式 - **400** - url是必填项 - 音频URL缺失 - 为每个音频提供URL - **400** - duration是必填项 - 音频时长缺失 - 为每个音频提供时长 - **400** - duration必须大于0 - 时长参数无效 - 使用大于0的时长值 - **404** - 音频资源不存在 - 音频URL无法访问 - 检查音频URL是否可访问 - **500** - 音频时间线计算失败 - 内部处理错误 - 联系技术支持 ### Notes - 所有时间参数使用微秒(1秒 = 1,000,000微秒) - links数组为必填参数,且每个元素都需要url和duration - 确保提供的duration参数准确反映音频实际时长 - 音频URL必须可以正常访问(用于验证) - 时间线按音频顺序连续排列,无间隔 - 完整时间线的end值等于所有音频时长之和 ``` -------------------------------- ### GET /openapi/capcut-mate/v1/get_draft Source: https://docs.jcaigc.cn/docs/get_draft.zh.html 获取草稿文件列表。该接口用于获取指定草稿ID对应的所有文件列表,可以查看草稿中包含的素材文件、配置文件等信息。通常用于草稿内容的预览、文件管理或状态检查。 ```APIDOC ## [GET] /openapi/capcut-mate/v1/get_draft ### Description 获取草稿文件列表。该接口用于获取指定草稿ID对应的所有文件列表,可以查看草稿中包含的素材文件、配置文件等信息。通常用于草稿内容的预览、文件管理或状态检查。 ### Method GET ### Endpoint /openapi/capcut-mate/v1/get_draft ### Parameters #### Query Parameters - **draft_id** (string) - Required - 草稿ID,长度为20-32位字符,通常为UUID格式或类似的唯一标识符。示例:2f52a63b-8c6a-4417-8b01-1b2a569ccb6c。获取方式:通常从draft_url中提取或由create_draft接口返回。 ### Request Example curl -X GET "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2f52a63b-8c6a-4417-8b01-1b2a569ccb6c" \ -H "Content-Type: application/json" ### Response #### Success Response (200) - **files** (array) - 草稿相关的文件列表 #### Response Example { "files": [ "2f52a63b-8c6a-4417-8b01-1b2a569ccb6c.json", "video_123456789.mp4", "audio_987654321.mp3", "image_555666777.jpg", "thumbnail_888999000.png" ] } #### Error Response (4xx/5xx) { "detail": "错误信息描述" } ### Error Codes - **400** - draft_id是必填项 - 缺少draft_id参数 - 提供有效的draft_id - **400** - draft_id长度无效 - draft_id长度不在20-32位范围内 - 检查draft_id格式是否正确 - **400** - draft_id格式无效 - draft_id格式不正确 - 确保使用正确的草稿ID格式 - **404** - 草稿不存在 - 指定的草稿ID无法找到 - 确认草稿ID是否正确且存在 - **500** - 获取文件列表失败 - 内部服务错误 - 联系技术支持或稍后重试 - **503** - 服务不可用 - 系统维护中 - 稍后重试 ``` -------------------------------- ### JSON request body with all asset types Source: https://docs.jcaigc.cn/docs/easy_create_material.zh.html Example JSON body for a request that adds all supported asset types: audio, text, image, and video. Includes optional parameters for text color, font size, and vertical position. ```json "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258", "audio_url": "https://assets.jcaigc.cn/audio.mp3", "text": "Hello World", "img_url": "https://s.coze.cn/t/JTa5Ne6_liY/", "video_url": "https://assets.jcaigc.cn/video.mp4", "text_color": "#ff0000", "font_size": 20, "text_transform_y": 100 ``` -------------------------------- ### POST /openapi/capcut-mate/v1/create_draft Source: https://docs.jcaigc.cn/docs/create_draft.html Creates a new Jianying draft project with customizable video width and height. Returns the draft URL and help document URL for subsequent video editing operations. ```APIDOC ## POST /openapi/capcut-mate/v1/create_draft ### Description Creates a new Jianying draft project with customizable video width and height. Returns the draft URL and help document URL for subsequent video editing operations. ### Method POST ### Endpoint /openapi/capcut-mate/v1/create_draft ### Parameters #### Request Body - **width** (number) - Optional - Video width in pixels, must be greater than or equal to 1. Default: 1920. - **height** (number) - Optional - Video height in pixels, must be greater than or equal to 1. Default: 1080. ### Request Example { "width": 1920, "height": 1080 } ### Response #### Success Response (200) - **draft_url** (string) - Newly created draft URL, used for subsequent editing operations. - **tip_url** (string) - Draft usage help documentation URL. #### Response Example { "draft_url": "https://cm.jcaigc.cn/openapi/v1/get_draft?draft_id=2025092811473036584258", "tip_url": "https://help.assets.jcaigc.cn/draft-usage" } #### Error Response (4xx/5xx) { "detail": "Error message description" } ### Error Codes - **400** - width must be greater than or equal to 1 - Invalid width parameter - Provide a width value greater than or equal to 1. - **400** - height must be greater than or equal to 1 - Invalid height parameter - Provide a height value greater than or equal to 1. - **400** - Parameter type error - Parameter type is incorrect - Ensure width and height are numeric types. - **500** - Draft creation failed - Internal service error - Contact technical support. - **503** - Service unavailable - System maintenance - Retry later. ``` -------------------------------- ### cURL: Rotation Animation Source: https://docs.jcaigc.cn/docs/add_keyframes.html Example request to animate the rotation (rotation.z) of a draft. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/add_keyframes \ -H "Content-Type: application/json" \ -d '{ "draft_url": "YOUR_DRAFT_URL", "keyframes": "[{\"property\":\"rotation.z\",\"time\":0,\"value\":0},{\"property\":\"rotation.z\",\"time\":3000000,\"value\":360}]" }' ``` -------------------------------- ### Request Parameters JSON Source: https://docs.jcaigc.cn/docs/gen_video.html Example of the JSON payload required for the video generation request. ```json { "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258" } ``` -------------------------------- ### Required parameters only Source: https://docs.jcaigc.cn/docs/add_captions.html Minimal request to add captions, specifying only draft_url and captions. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/add_captions \ -H "Content-Type: application/json" \ -d '{ "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258", "captions": "[{\"start\":0,\"end\":5000000,\"text\":\"Hello, CapCut\"}]" }' ``` -------------------------------- ### POST /openapi/capcut-mate/v1/add_keyframes 接口信息 Source: https://docs.jcaigc.cn/docs/add_keyframes.zh.html 接口的HTTP方法和路径。 ```http POST /openapi/capcut-mate/v1/add_keyframes ``` -------------------------------- ### Filter with Custom Intensity cURL Source: https://docs.jcaigc.cn/docs/add_filters.html Example of adding a filter with a specific intensity value. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/add_filters \ -H "Content-Type: application/json" \ -d '{ "draft_url": "YOUR_DRAFT_URL", "filter_infos": "[{\"filter_title\":\"森山\",\"start\":0,\"end\":5000000,\"intensity\":60}]" }' ``` -------------------------------- ### POST /openapi/capcut-mate/v1/add_keyframes Source: https://docs.jcaigc.cn/docs/add_keyframes.zh.html 向现有草稿中添加关键帧。该接口用于在指定的片段上添加关键帧动画,支持多种属性类型的关键帧设置,如位置、缩放、旋转、透明度等。 ```APIDOC ## [POST] /openapi/capcut-mate/v1/add_keyframes ### Description 向现有草稿中添加关键帧。该接口用于在指定的片段上添加关键帧动画,支持多种属性类型的关键帧设置,如位置、缩放、旋转、透明度等。 ### Method POST ### Endpoint /openapi/capcut-mate/v1/add_keyframes ### Parameters #### Request Body - **draft_url** (string) - Required - 目标草稿的完整URL - **keyframes** (string) - Required - 关键帧信息列表的JSON字符串 ### Request Example { "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258", "keyframes": "[{\"segment_id\":\"d62994b4-25fe-422a-a123-87ef05038558\",\"property\":\"KFTypePositionX\",\"offset\":5000000,\"value\":-0.1}]" } ### Response #### Success Response (200) - **draft_url** (string) - 更新后的草稿URL - **keyframes_added** (integer) - 添加的关键帧数量 - **affected_segments** (array) - 受影响的片段ID列表 #### Response Example { "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258", "keyframes_added": 3, "affected_segments": ["segment_001", "segment_002"] } #### Error Response (4xx/5xx) - **detail** (string) - 错误信息描述 #### Error Response Example { "detail": "错误信息描述" } ### Error Codes | 错误码 | 错误信息 | 说明 | 解决方案 | |--------|----------|------|----------| | 400 | draft_url是必填项 | 缺少草稿URL参数 | 提供有效的draft_url | | 400 | keyframes是必填项 | 缺少关键帧参数 | 提供有效的keyframes数据 | | 400 | 无效的关键帧信息,请检查keyframes字段值是否正确 | 关键帧数据格式错误 | 检查关键帧数据格式是否符合要求 | | 404 | 草稿不存在 | 指定的草稿URL无效 | 检查草稿URL是否正确 | | 404 | 片段未找到 | 指定的segment_id在草稿中不存在 | 确认片段ID是否正确 | | 400 | 无效的片段类型 | 该片段不支持关键帧功能 | 确保为目标片段是视觉片段(视频、图片、贴纸、文本) | | 400 | 无效的关键帧属性类型 | 指定的property类型不受支持 | 检查属性类型是否在支持列表中 | | 500 | 关键帧添加失败 | 内部处理错误 | 联系技术支持 | ``` -------------------------------- ### 接口信息:POST /openapi/capcut-mate/v1/audio_infos Source: https://docs.jcaigc.cn/docs/audio_infos.zh.html 接口的 HTTP 方法和路径。 ```http POST /openapi/capcut-mate/v1/audio_infos ```