### Start the Jianying Assistant Client Source: https://github.com/hommy-master/capcut-mate/blob/main/README.md Commands to start the Jianying Assistant client project: first run the web development server, then start the application. ```bash npm run web:dev npm start ``` -------------------------------- ### Install dependencies with uv Source: https://github.com/hommy-master/capcut-mate/blob/main/README.md Install project dependencies using uv sync. For Windows, additionally run 'uv pip install -e .[windows]'. ```bash # Install dependencies uv sync # Additional execution for Windows uv pip install -e .[windows] ``` -------------------------------- ### Start the CapCut Mate server Source: https://github.com/hommy-master/capcut-mate/blob/main/README.md Start the server using uv run main.py. ```bash uv run main.py ``` -------------------------------- ### Install Dependencies for Jianying Assistant Client Source: https://github.com/hommy-master/capcut-mate/blob/main/README.md Commands to install dependencies for the Jianying Assistant client. Includes setting the Electron mirror for Windows (set) and for Linux/macOS (export), followed by npm install. ```bash # Switch npm mirror source - for Windows set ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ # Switch yarn mirror source - for Linux or macOS export ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/" # Install dependencies npm install --verbose ``` -------------------------------- ### Install uv on Linux/macOS Source: https://github.com/hommy-master/capcut-mate/blob/main/README.md Install the uv package manager on Linux or macOS using curl and sh. ```bash sh -c "$(curl -LsSf https://astral.sh/uv/install.sh)" ``` -------------------------------- ### Request JSON example for add_text_style Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/add_text_style.md Example request body showing text, keyword, font_size, keyword_color, and keyword_font_size parameters. ```json { "text": "五个快乐到死的顶级思维", "keyword": "快乐|顶级思维", "font_size": 12, "keyword_color": "#ff7100", "keyword_font_size": 15 } ``` -------------------------------- ### cURL example: Timeline with start time Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/timelines.md cURL command to create a timeline with a start time of 5000000 microseconds, duration 20000000, num 4, and type 0. ```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": 0 }' ``` -------------------------------- ### Install uv on Windows Source: https://github.com/hommy-master/capcut-mate/blob/main/README.md Install the uv package manager on Windows using PowerShell. Run this command in PowerShell with execution policy bypass. ```powershell powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" ``` -------------------------------- ### Request body example Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/search_sticker.md Example JSON request body with a keyword parameter. ```json { "keyword": "人" } ``` -------------------------------- ### Request parameters JSON example Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/get_url.md Example JSON body for the GET_URL API request, containing the 'output' parameter with a sample string. ```json { "output": "[魂牵梦萦https://sf.com;中国人https://jcaigc.cn],\"[]\"" } ``` -------------------------------- ### Example JSON request body for add_videos Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/add_videos.md Example request body showing all parameters: draft_url, video_infos as a JSON string, scene_timelines, alpha, scale_x, scale_y, transform_x, and transform_y. Note that video_infos is a string containing a JSON array. ```json { "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 } ``` -------------------------------- ### Request Body Example Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/objs_to_str_list.md Example JSON request body with an outputs array containing objects with output URLs. ```json { "outputs": [ { "output": "https://assets.jcaigc.cn/min.mp4" }, { "output": "https://assets.jcaigc.cn/max.mp4" } ] } ``` -------------------------------- ### Request body example Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/create_draft.md Example JSON request body with width and height parameters. Both are optional with defaults 1920 and 1080. ```json { "width": 1920, "height": 1080 } ``` -------------------------------- ### Success response example Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/create_draft.md Example JSON response for a successful draft creation. Contains code, message, draft_url, and tip_url. ```json { "code": 0, "message": "success", "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258", "tip_url": "https://docs.jcaigc.cn/" } ``` -------------------------------- ### Request JSON example Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/get_text_animations.md Example request body showing the mode and type parameters. mode=0 returns all animations, type='in' filters for entrance animations. ```json { "mode": 0, "type": "in" } ``` -------------------------------- ### Request body example Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/gen_video.md Example JSON payload for the gen_video request. Includes draft_url and apiKey parameters. ```json { "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258", "apiKey": "123e4567-e89b-12d3-a456-426614174000" } ``` -------------------------------- ### cURL: Basic Get Draft File List Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/get_draft.md Example cURL command to retrieve the draft file list using a basic draft_id. ```bash curl -X GET "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258" \ -H "Content-Type: application/json" ``` -------------------------------- ### Speed Change Example (JSON) Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/add_videos.md Example showing how to set video speed to 2x using scene_timelines. The video timeline is 0-2000000 microseconds and scene_timeline is 0-1000000, resulting in 2x speed and 1 second playback. ```json // Original video: 2 seconds on timeline (0-2000000) // To make it 2x speed (play in 1 second): { "video_infos": "[{\"video_url\":\"...\", \"start\":0, \"end\":2000000}]", "scene_timelines": [{"start":0, "end":1000000}] } // Result: Video plays at 2x speed, actual playback duration is 1 second ``` -------------------------------- ### Success response example Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/search_sticker.md Example JSON response for a successful search, containing a list of stickers with title, sticker_id, and image_url. ```json { "code": 0, "message": "success", "data": [ { "title": "大笑", "sticker_id": "7521200021564427545", "image_url": "https://p3-heycan-jy-sign.byteimg.com/tos-cn-i-3jr8j4ixpe/29351205dbd943658d94c8feb17e5ed4~tplv-3jr8j4ixpe-resize:1920:1920.png?x-expires=1797257777&x-signature=r18I9uLQzgm%2FcvF8WNLbgw8BRwg%3D" } ] } ``` -------------------------------- ### cURL example: Basic timeline creation Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/timelines.md cURL command to create a basic timeline with duration 15000000, num 5, start 0, and type 0. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/timelines \ -H "Content-Type: application/json" \ -d '{ "duration": 15000000, "num": 5, "start": 0, "type": 0 }' ``` -------------------------------- ### Request body example for audio_timelines Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/audio_timelines.md Example JSON request body with a links array containing two audio file URLs. The links parameter is required and each element must be a string URL. ```json { "links": [ "https://assets.jcaigc.cn/audio1.mp3", "https://assets.jcaigc.cn/audio2.mp3" ] } ``` -------------------------------- ### Request Body Example Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/get_effects.md Example JSON request body with mode set to 0 (all effects). ```json { "mode": 0 } ``` -------------------------------- ### Error Response Example Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/get_effects.md Example JSON response for an error, showing code 2041 and message 'Get effect list failed'. ```json { "code": 2041, "message": "Get effect list failed" } ``` -------------------------------- ### curl Example for Uploading a File Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/upload_file.md Example curl command to upload a file (demo.mp4) with an apiKey. The file is sent in the 'file' field and the key in the 'apiKey' field. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/upload_file \ -F "file=@demo.mp4" \ -F "apiKey=123e8567-e89b-12d3-a856-826618178000" ``` -------------------------------- ### Request parameters JSON example Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/timelines.md Example JSON body for the timelines API request. Shows the required fields: duration, num, start, and type. ```json { "duration": 10000000, "num": 3, "start": 0, "type": 0 } ``` -------------------------------- ### cURL Example: Add All Types of Materials Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/easy_create_material.md Sends a POST request to the easy_create_material endpoint with audio, text, image, video, and styling parameters. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/easy_create_material \ -H "Content-Type: application/json" \ -d '{ "draft_url": "YOUR_DRAFT_URL", "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 }' ``` -------------------------------- ### Request JSON body for audio_infos Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/audio_infos.md Example request body with mp3_urls, timelines, audio_effect, and volume. Timelines use microseconds. ```json { "mp3_urls": ["https://assets.jcaigc.cn/audio1.mp3", "https://assets.jcaigc.cn/audio2.mp3"], "timelines": [ {"start": 0, "end": 3000000}, {"start": 3000000, "end": 8000000} ], "audio_effect": "reverb", "volume": 0.8 } ``` -------------------------------- ### Success response JSON example Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/get_url.md Example JSON response for a successful GET_URL API call, showing the 'code', 'message', and 'output' fields. ```json { "code": 0, "message": "success", "output": "[魂牵梦萦https://sf.com;中国人https://jcaigc.cn],\"[]\"" } ``` -------------------------------- ### Request body example for keyframes_infos Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/keyframes_infos.md Example JSON request body showing all parameters: ctype, offsets, values, segment_infos, height, and width. Required fields are ctype, offsets, values, and segment_infos. ```json { "ctype": "KFTypePositionX", "offsets": "0|50|100", "values": "0|960|1920", "segment_infos": [ {"id": "segment1", "start": 0, "end": 5000000} ], "height": 1080, "width": 1920 } ``` -------------------------------- ### Error response example Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/gen_video.md Example error response for an invalid draft URL. ```json { "code": 2001, "message": "Invalid draft URL" } ``` -------------------------------- ### Request body example for effect_infos Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/effect_infos.md Example JSON request body with effects and timelines arrays. ```json { "effects": ["blur", "vignette"], "timelines": [ {"start": 0, "end": 3000000}, {"start": 3000000, "end": 6000000} ] } ``` -------------------------------- ### Request body example for filter_infos Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/filter_infos.md Example JSON request body with filters, timelines, and intensities. ```json { "filters": ["复古", "黑白"], "timelines": [ {"start": 0, "end": 3000000}, {"start": 3000000, "end": 6000000} ], "intensities": [80, 100] } ``` -------------------------------- ### cURL example for basic video generation Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/gen_video.md cURL command to submit a video generation task with a draft URL and API key. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/gen_video \ -H "Content-Type: application/json" \ -d '{ "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258", "apiKey": "123e4567-e89b-12d3-a456-426614174000" }' ``` -------------------------------- ### Docker deployment of CapCut Mate Source: https://github.com/hommy-master/capcut-mate/blob/main/README.md Clone the repository and start the Docker containers using docker-compose. After deployment, access the API documentation at http://localhost:30000/docs. ```bash git clone https://github.com/Hommy-master/capcut-mate.git cd capcut-mate docker-compose pull && docker-compose up -d ``` -------------------------------- ### cURL Example: Minimal Request (Audio Only) Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/easy_create_material.md Sends a POST request with only the required draft_url and audio_url parameters. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/easy_create_material \ -H "Content-Type: application/json" \ -d '{ "draft_url": "YOUR_DRAFT_URL", "audio_url": "https://assets.jcaigc.cn/audio.wav" }' ``` -------------------------------- ### cURL Example: All Effects Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/get_effects.md cURL command to retrieve all effects by setting mode to 0. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_effects \ -H "Content-Type: application/json" \ -d '{ "mode": 0 }' ``` -------------------------------- ### Success Response Example Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/get_effects.md Example JSON response for a successful request, showing the effects array with fields like name, is_vip, resource_id, effect_id, icon_url, and has_params. ```json { "code": 0, "message": "success", "effects": [ { "name": "1998", "is_vip": false, "resource_id": "6981791065204331044", "effect_id": "1183068", "icon_url": "", "has_params": true } ] } ``` -------------------------------- ### Error response example Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/create_draft.md Example JSON response for a failed draft creation. Contains error code 2002 and message. ```json { "code": 2002, "message": "Draft creation failed" } ``` -------------------------------- ### Success Response (200) for STR_TO_LIST Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/str_to_list.md Example success response with code 0 and the input string as a single-element list. ```json { "code": 0, "message": "success", "infos": [ "{ \"infos\": [ \"https://assets.jcaigc.cn/min.mp4\", \"https://assets.jcaigc.cn/max.mp4\" ] }" ] } ``` -------------------------------- ### cURL example: audio information with effects Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/audio_infos.md cURL command with multiple audio URLs, timelines, audio_effect 'reverb', and volume 0.9. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/audio_infos \ -H "Content-Type: application/json" \ -d '{ "mp3_urls": ["https://assets.jcaigc.cn/intro.mp3", "https://assets.jcaigc.cn/content.mp3"], "timelines": [{"start": 0, "end": 2000000}, {"start": 2000000, "end": 12000000}], "audio_effect": "reverb", "volume": 0.9 }' ``` -------------------------------- ### Success response (200) Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/gen_video.md Example success response indicating the video generation task has been submitted. ```json { "code": 0, "message": "视频生成任务已提交,请使用draft_url查询进度" } ``` -------------------------------- ### Success response (200) for audio_infos Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/audio_infos.md Example success response with code 0 and a JSON string in the infos field. ```json { "code": 0, "message": "success", "infos": "[{\"audio_url\":\"https://assets.jcaigc.cn/audio1.mp3\",\"start\":0,\"end\":3000000,\"audio_effect\":\"reverb\",\"volume\":0.8},{\"audio_url\":\"https://assets.jcaigc.cn/audio2.mp3\",\"start\":3000000,\"end\":8000000,\"audio_effect\":\"reverb\",\"volume\":0.8}]" } ``` -------------------------------- ### cURL example: all filters Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/get_filters.md cURL command to call the GET_FILTERS API with mode 0 to retrieve all filters. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_filters \ -H "Content-Type: application/json" \ -d '{ "mode": 0 }' ``` -------------------------------- ### Success response (200) Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/get_text_effects.md Example success response containing a list of text effects with id, title, and is_vip fields. ```json { "code": 0, "message": "success", "text_effects": [ { "id": "7539407429763796249", "title": "红黄火焰综艺花字", "is_vip": true }, { "id": "7351316503771368713", "title": "综艺-黑暗斑驳红色", "is_vip": true } ] } ``` -------------------------------- ### Success response JSON example Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/timelines.md Example of a successful 200 response from the timelines API, showing the segmented timelines array and the all_timelines array. ```json { "code": 0, "message": "success", "timelines": [ { "start": 0, "end": 3333333 }, { "start": 3333333, "end": 6666666 }, { "start": 6666666, "end": 10000000 } ], "all_timelines": [ { "start": 0, "end": 10000000 } ] } ``` -------------------------------- ### cURL example: search stickers with keyword "动物" Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/search_sticker.md cURL command to search stickers using the keyword "动物". ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/search_sticker \ -H "Content-Type: application/json" \ -d '{ "keyword": "动物" }' ``` -------------------------------- ### Request JSON for STR_TO_LIST Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/str_to_list.md Example request body with the required 'obj' parameter containing a JSON string. ```json { "obj": "{ \"infos\": [ \"https://assets.jcaigc.cn/min.mp4\", \"https://assets.jcaigc.cn/max.mp4\" ] }" } ``` -------------------------------- ### cURL multiple audio timeline calculation Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/audio_timelines.md cURL example to calculate timelines for three audio files. Demonstrates using a larger links array. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/audio_timelines \ -H "Content-Type: application/json" \ -d '{ "links": [ "https://assets.jcaigc.cn/opening.mp3", "https://assets.jcaigc.cn/content.mp3", "https://assets.jcaigc.cn/ending.mp3" ] }' ``` -------------------------------- ### cURL example: search stickers with keyword "人" Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/search_sticker.md cURL command to search stickers using the keyword "人". ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/search_sticker \ -H "Content-Type: application/json" \ -d '{ "keyword": "人" }' ``` -------------------------------- ### Success Response (200) Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/add_audios.md Example of a successful response from the add_audios API, containing a draft URL, track ID, and list of audio IDs. ```json { "code": 0, "message": "success", "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"] } ``` -------------------------------- ### cURL Example: Add Only Audio and Text Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/easy_create_material.md Sends a POST request with only audio and text parameters, including text color and font size. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/easy_create_material \ -H "Content-Type: application/json" \ -d '{ "draft_url": "YOUR_DRAFT_URL", "audio_url": "https://assets.jcaigc.cn/background_music.mp3", "text": "Welcome to watch", "text_color": "#0066ff", "font_size": 18 }' ``` -------------------------------- ### Error response Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/get_filters.md Example error response with code 2040 and message 'Get filter list failed'. ```json { "code": 2040, "message": "Get filter list failed" } ``` -------------------------------- ### cURL Basic Image Addition Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/add_images.md Minimal cURL example to add an image to a draft. Requires a draft URL and image_infos with image_url, start, and end. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/add_images \ -H "Content-Type: application/json" \ -d '{ "draft_url": "YOUR_DRAFT_URL", "image_infos": "[{\"image_url\":\"https://assets.jcaigc.cn/photo1.jpg\",\"start\":0,\"end\":5000000}]" }' ``` -------------------------------- ### Success response (200) for get_draft Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/get_draft.md Example JSON response returned when the request succeeds, containing a list of file URLs. ```json { "code": 0, "message": "success", "files": [ "https://capcut-mate.jcaigc.cn/output/draft/2025092811473036584258/draft_info.json", "https://capcut-mate.jcaigc.cn/output/draft/2025092811473036584258/draft_content.json", "https://capcut-mate.jcaigc.cn/output/draft/2025092811473036584258/draft_meta_info.json" ] } ``` -------------------------------- ### Success Response JSON Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/gen_video_active_count.md Example of a successful response with HTTP 200, showing a count of 3 active tasks. ```json { "code": 0, "message": "success", "count": 3 } ``` -------------------------------- ### cURL Basic Usage Example Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/objs_to_str_list.md cURL command to call the objs_to_str_list endpoint with a JSON body containing outputs. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/objs_to_str_list \ -H "Content-Type: application/json" \ -d '{ "outputs": [ { "output": "https://assets.jcaigc.cn/min.mp4" }, { "output": "https://assets.jcaigc.cn/max.mp4" } ] }' ``` -------------------------------- ### Success response (200) for keyframes_infos Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/keyframes_infos.md Example success response with code 0 and a keyframes_infos string containing the generated keyframe data. ```json { "code": 0, "message": "success", "keyframes_infos": "[{\"offset\":0,\"property\":\"KFTypePositionX\",\"segment_id\":\"segment1\",\"value\":0.0},{\"offset\":2500000,\"property\":\"KFTypePositionX\",\"segment_id\":\"segment1\",\"value\":0.5},{\"offset\":5000000,\"property\":\"KFTypePositionX\",\"segment_id\":\"segment1\",\"value\":1.0}]" } ``` -------------------------------- ### Error response for audio_timelines Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/audio_timelines.md Example error response with code 2034 and message 'Get audio duration failed'. This occurs when the duration of a downloaded audio file cannot be read. ```json { "code": 2034, "message": "Get audio duration failed" } ``` -------------------------------- ### Error response for audio_infos Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/audio_infos.md Example error response with code 1001 and message 'Parameter validation failed'. ```json { "code": 1001, "message": "Parameter validation failed" } ``` -------------------------------- ### cURL Image with Transparency Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/add_images.md cURL example that adds an image with an alpha transparency value of 0.8. Includes width and height in image_infos. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/add_images \ -H "Content-Type: application/json" \ -d '{ "draft_url": "YOUR_DRAFT_URL", "image_infos": "[{\"image_url\":\"https://assets.jcaigc.cn/logo.png\",\"width\":800,\"height\":600,\"start\":1000000,\"end\":6000000}]", "alpha": 0.8 }' ``` -------------------------------- ### Success Response (200) JSON Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/add_captions.md Example of a successful add_captions API response. Contains code 0, message 'success', a draft_url, track_id, text_ids, segment_ids, and segment_infos with start and end times in microseconds. ```json { "code": 0, "message": "success", "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258", "track_id": "caption-track-uuid", "text_ids": ["text1-uuid", "text2-uuid"], "segment_ids": ["segment1-uuid", "segment2-uuid"], "segment_infos": [ { "id": "segment1-uuid", "start": 0, "end": 3000000 } ] } ``` -------------------------------- ### cURL: Using Complete draft_id Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/get_draft.md Example cURL command to retrieve the draft file list using a complete draft_id. ```bash curl -X GET "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025100512300012345678" \ -H "Content-Type: application/json" ``` -------------------------------- ### Success Response (200) JSON Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/add_images.md Example of a successful response from the add_images API. Contains the updated draft URL, track ID, image IDs, segment IDs, and segment information with start and end times. ```json { "code": 0, "message": "success", "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258", "track_id": "video-track-uuid", "image_ids": ["image1-uuid", "image2-uuid"], "segment_ids": ["segment1-uuid", "segment2-uuid"], "segment_infos": [ { "id": "segment1-uuid", "start": 0, "end": 5000000 } ] } ``` -------------------------------- ### Request JSON body for get_audio_duration Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/get_audio_duration.md Example request body containing the mp3_url parameter. The URL must be accessible and point to a supported audio format. ```json { "mp3_url": "https://assets.jcaigc.cn/audio/sample.mp3" } ``` -------------------------------- ### cURL example: Multiple effect information generation Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/effect_infos.md cURL command to generate effect information for multiple effects with multiple timelines. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/effect_infos \ -H "Content-Type: application/json" \ -d '{ "effects": ["blur", "vignette", "sepia"], "timelines": [{"start": 0, "end": 2000000}, {"start": 2000000, "end": 4000000}, {"start": 4000000, "end": 6000000}] }' ``` -------------------------------- ### Success Response (200) Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/objs_to_str_list.md Example success response with code 0, message 'success', and an infos array containing the extracted strings. ```json { "code": 0, "message": "success", "infos": [ "https://assets.jcaigc.cn/min.mp4", "https://assets.jcaigc.cn/max.mp4" ] } ``` -------------------------------- ### Python Upload Example Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/upload_file.md Uploads a file using the requests library. The response JSON contains the url, size_mb, and cost fields. The url is ready for use with add_videos, add_images, or add_audios. ```python import requests with open("demo.mp4", "rb") as f: resp = requests.post( "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/upload_file", files={"file": ("demo.mp4", f, "video/mp4")}, data={"apiKey": "123e4567-e89b-12d3-a456-426614174000"}, timeout=600, ) result = resp.json() video_url = result["url"] # ready for add_videos / add_images / add_audios print("size:", result["size_mb"], "MB", "cost:", result["cost"], "CNY") ``` -------------------------------- ### cURL example: Basic effect information generation Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/effect_infos.md cURL command to generate effect information for a single effect with a single timeline. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/effect_infos \ -H "Content-Type: application/json" \ -d '{ "effects": ["blur"], "timelines": [{"start": 0, "end": 5000000}] }' ``` -------------------------------- ### cURL Image with Scaling and Position Offset Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/add_images.md cURL example that adds an image with scaling factors (scale_x, scale_y) and position offsets (transform_x, transform_y). ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/add_images \ -H "Content-Type: application/json" \ -d '{ "draft_url": "YOUR_DRAFT_URL", "image_infos": "[{\"image_url\":\"https://assets.jcaigc.cn/watermark.png\",\"width\":300,\"height\":100,\"start\":2000000,\"end\":7000000}]", "scale_x": 0.5, "scale_y": 0.5, "transform_x": 700, "transform_y": -400 }' ``` -------------------------------- ### POST /openapi/capcut-mate/v1/create_draft Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/create_draft.md Creates a new Jianying draft project with customizable video width and height. Returns the draft URL and help documentation URL. ```APIDOC ## [POST] /openapi/capcut-mate/v1/create_draft ### Description Create a Jianying draft. This interface is used to create a new Jianying draft project, allowing customization of video width and height. After successful creation, it returns the draft URL and help document URL, providing the foundation for subsequent video editing operations. ### Method POST ### Endpoint /openapi/capcut-mate/v1/create_draft ### Parameters #### Request Body - **width** (integer) - Optional - Video width (pixels), must be greater than or equal to 1. Default: 1920. - **height** (integer) - Optional - Video height (pixels), must be greater than or equal to 1. Default: 1080. ### Request Example { "width": 1920, "height": 1080 } ### Response #### Success Response (200) - **code** (integer) - Response code, 0 indicates success. - **message** (string) - Response message, "success" on success. - **draft_url** (string) - Newly created draft URL, used for subsequent editing operations. - **tip_url** (string) - Draft usage help documentation URL. #### Response Example { "code": 0, "message": "success", "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258", "tip_url": "https://docs.jcaigc.cn/" } ### Error Handling #### Error Response - **code** (integer) - Error code. - **message** (string) - Error message. #### Error Response Example { "code": 2002, "message": "Draft creation failed" } #### Error Codes - **1001** - Parameter validation failed - `width`/`height` is not an integer or is less than 1. Solution: Provide integer values greater than or equal to 1. - **2002** - Draft creation failed - Failed to create the draft from the template. Solution: Retry later or contact technical support. ``` -------------------------------- ### Clone the CapCut Mate repository Source: https://github.com/hommy-master/capcut-mate/blob/main/README.md Clone the project repository and navigate into the project directory. ```bash git clone git@github.com:Hommy-master/capcut-mate.git cd capcut-mate ``` -------------------------------- ### Request JSON for video_infos Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/video_infos.md Example request body with video URLs, timelines, dimensions, mask, transition, transition duration, and volume. The mask is carried into video_infos but not applied by add_videos; use add_masks. ```json { "video_urls": ["https://assets.jcaigc.cn/video1.mp4", "https://assets.jcaigc.cn/video2.mp4"], "timelines": [ {"start": 0, "end": 3000000}, {"start": 3000000, "end": 6000000} ], "height": 1080, "width": 1920, "mask": "圆形", "transition": "叠化", "transition_duration": 300000, "volume": 1.0 } ``` -------------------------------- ### Request body example for add_filters Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/add_filters.md Example JSON request body containing draft_url and filter_infos. filter_infos is a JSON string with filter objects. ```json { "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258", "filter_infos": "[{\"filter_title\": \"1980\", \"start\": 0, \"end\": 5000000, \"intensity\": 80}, {\"filter_title\": \"森山\", \"start\": 2000000, \"end\": 7000000}]" } ``` -------------------------------- ### Success response (200) for audio_timelines Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/audio_timelines.md Example success response with code 0, message 'success', and timelines arrays. Timelines are segmented and all_timelines is the complete timeline. Times are in microseconds. ```json { "code": 0, "message": "success", "timelines": [ { "start": 0, "end": 5000000 }, { "start": 5000000, "end": 8000000 } ], "all_timelines": [ { "start": 0, "end": 8000000 } ] } ``` -------------------------------- ### cURL Upload Example Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/upload_file.md Uploads a file using cURL with the POST method. The file is sent as a multipart form field 'file' and the API key as 'apiKey'. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/upload_file \ -F "file=@demo.mp4" \ -F "apiKey=123e4567-e89b-12d3-a456-426614174000" ``` -------------------------------- ### POST /openapi/capcut-mate/v1/add_videos Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/add_videos.md Batch add video materials to existing drafts. Supports multiple videos with time range control, transparency, transitions, volume, and scaling. ```APIDOC ## POST /openapi/capcut-mate/v1/add_videos ### Description Batch add video materials to existing drafts. This interface is a powerful video addition tool that supports batch processing of multiple videos, including time range control, transparency adjustment, transition animations, volume control, scaling transformations, and other advanced features. ### Method POST ### Endpoint /openapi/capcut-mate/v1/add_videos ### Parameters #### Request Body - **draft_url** (string) - Required - Complete URL of the target draft - **video_infos** (string) - Required - JSON string of video information array - **scene_timelines** (array[object]) - Optional - Scene timeline array for video speed change, corresponds one-to-one with video_infos - **alpha** (number) - Optional - Global transparency (0-1), default 1.0 - **scale_x** (number) - Optional - X-axis scaling ratio, default 1.0 - **scale_y** (number) - Optional - Y-axis scaling ratio, default 1.0 - **transform_x** (number) - Optional - X-axis position offset (pixels), default 0 - **transform_y** (number) - Optional - Y-axis position offset (pixels), default 0 #### video_infos Array Structure - **video_url** (string) - Required - URL address of the video file - **width** (number) - Optional - Video width (pixels), automatically obtained if not provided - **height** (number) - Optional - Video height (pixels), automatically obtained if not provided - **start** (number) - Required - Video start playback time (microseconds) - **end** (number) - Required - Video end playback time (microseconds) - **duration** (number) - Optional - Total video duration (microseconds), default end-start - **mask** (string) - Optional - Mask name; currently not applied — use `add_masks` instead - **transition** (string) - Optional - Transition name from Supported Transition Names - **transition_duration** (number) - Optional - Transition duration (microseconds); uses the transition type's default when omitted - **volume** (number) - Optional - Volume size (0-10), default 1.0 #### scene_timelines Array Structure - **start** (number) - Required - Scene start time (microseconds) - **end** (number) - Required - Scene end time (microseconds) ### 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) No response schema provided in the source. #### Response Example No response example provided in the source. ``` -------------------------------- ### Example request body for add_keyframes Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/add_keyframes.md Example JSON request body containing draft_url and keyframes. The keyframes value is a JSON string representing an array of keyframe objects. ```json { "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}]" } ``` -------------------------------- ### cURL example: basic audio information generation Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/audio_infos.md Basic cURL command to generate audio information with a single audio URL and timeline, volume 0.7. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/audio_infos \ -H "Content-Type: application/json" \ -d '{ "mp3_urls": ["https://assets.jcaigc.cn/bgm.mp3"], "timelines": [{"start": 0, "end": 10000000}], "volume": 0.7 }' ``` -------------------------------- ### GET /openapi/capcut-mate/v1/get_draft endpoint Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/get_draft.md The HTTP method and path for the get_draft interface. ```http GET /openapi/capcut-mate/v1/get_draft ``` -------------------------------- ### Success Response (200) Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/easy_create_material.md Example of a successful response with code 0 and a draft_url field. ```json { "code": 0, "message": "success", "draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258" } ``` -------------------------------- ### cURL basic usage for STR_LIST_TO_OBJS Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/str_list_to_objs.md Example cURL command to call the API with a JSON body. ```bash curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/str_list_to_objs \ -H "Content-Type: application/json" \ -d '{ "infos": [ "https://assets.jcaigc.cn/min.mp4", "https://assets.jcaigc.cn/max.mp4" ] }' ``` -------------------------------- ### Error Response Source: https://github.com/hommy-master/capcut-mate/blob/main/docs/easy_create_material.md Example of an error response with code 2028 and message 'Material creation failed'. ```json { "code": 2028, "message": "Material creation failed" } ```