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"
}