curl -X POST https://render-api.chillin.online/render/v1 \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d @request.json注意:我們的渲染請求是異步處理的。提交請求後,您將立即收到一個包含
render_id的回應,該 ID 可用於查詢渲染狀態和結果。
| 屬性 | 類型 | 必要 | 範例 | 值範圍 | 描述 |
|---|---|---|---|---|---|
| compositeWidth | number | true | 1920 | 720 - 3840 | 合成的寬度。 |
| compositeHeight | number | true | 1080 | 720 - 3840 | 合成的高度。 |
| fps | number | true | 30 | 15 - 60 | 合成的幀率。 |
| projectData | object | true | - | - | 項目數據。可以從編輯器導出。 |
| camera | object | false | - | - | 可選的 3D 場景相機配置。控制投影模式和視角。 |
注意:
compositeWidth和compositeHeight可以與projectData中指定的width和height不同。然而,compositeWidth與compositeHeight的長寬比必須與projectData.width與projectData.height的長寬比保持一致。
此設計允許相同的視頻項目以不同的解析度導出,同時保持原始的長寬比。
可選的 camera 物件控制 3D 元素的投影方式:
mode (字符串) - 投影模式:"perspective"(默認)或 "orthographic"。透視模式提供基於深度的縮短效果;正投影模式保持平行線。view (字符串) - 預設相機視角名稱(例如,"front"、"top"、"right"、"isometric")。當指定時,相機將定位以匹配預設角度。如果未提供
camera,則使用默認的透視前視圖。
{
"compositeWidth": 1920,
"compositeHeight": 1080,
"fps": 30,
"projectData": {
"type": "",
"width": 1920,
"height": 1080,
"fill": "#000000",
"view": [
{
"id": "8ecf7475-2c6c-47f9-827b-a09c7913f4c0",
"type": "Image",
"start": 0,
"duration": 5,
"trackIndex": 0,
"x": -570.0335392757963,
"y": -170.90659033307685,
"blendMode": "normal",
"anchorX": 1302,
"anchorY": 2312,
"rotation": 0,
"scaleX": 0.23356401384083045,
"scaleY": 0.23356401384083045,
"alpha": 1,
"skewX": 0,
"skewY": 0,
"keyframes": [],
"externalUrl": "https://images.pexels.com/photos/30465303/pexels-photo-30465303.jpeg",
"ext": "jpeg"
}
],
"audio": [],
"effect": [],
"transition": [],
"version": 0,
"duration": 5
}
};
{
"code": 0,
"data": {
"message": "Async render request submitted successfully",
"render_id": 105586,
"status": "processing"
},
"msg": "success"
}
{
"code": 2004,
"data": {},
"msg": "invalid project data: invalid view array: view item 0: missing required field: id"
}
以下是異步渲染 API 返回的代碼:
projectData 欄位不是有效的 JSON 物件。duration 欄位是必需的但缺失。duration 欄位存在但格式不正確。如果您遇到未列出的錯誤代碼,請聯繫支持 [email protected]。
提交異步渲染請求後,您可以使用 render_id 查詢渲染狀態和結果。
curl -X POST https://render-api.chillin.online/render/result \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"render_id": 100000}'| 屬性 | 類型 | 必要 | 範例 | 值範圍 | 描述 |
|---|---|---|---|---|---|
| render_id | number | true | 100000 | - | 從初始渲染請求返回的渲染 ID。 |
{
"code": 0,
"data": {
"render": {
"create_at": "2025-06-27T12:37:21.684337Z",
"json_url": "https://cloud.chillin.online/project_xxx.json?verify=xxx",
"render_id": 105549,
"state": "success",
"video_url": "https://cloud.chillin.online/video_xxx.mp4?verify=xxx"
}
},
"msg": "success"
}
回應中的 state 欄位可以具有以下值:
使用此端點永久刪除已完成任務的渲染視頻文件和項目 JSON。
curl -X POST https://render-api.chillin.online/render/delete-files \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"render_id": 100000}'| 屬性 | 類型 | 必要 | 範例 | 值範圍 | 描述 |
|---|---|---|---|---|---|
| render_id | number | true | 100000 | - | 您想要清理的渲染 ID。只有成功狀態的渲染可以被刪除。 |
{
"code": 0,
"data": {
"message": "Render files deleted"
},
"msg": "success"
}