最终渲染接口
直接生成 ZIP
http
POST /v1/source/render
Content-Type: application/json最终渲染使用完整 RenderRequest,不要求预先创建 streamToken。
bash
curl -X POST https://markify.example.com/v1/source/render \
-H 'content-type: application/json' \
-d @render-job.json \
-o markify-images.zip成功响应
http
HTTP/1.1 200 OK
Content-Type: application/zip
Content-Disposition: attachment; filename="markify-images.zip"ZIP 内容:
text
manifest.json
image-001.png
image-002.png
...manifest.json 示例:
json
{
"version": 1,
"output": { "format": "png", "quality": 90 },
"items": [
{
"resourceIndex": 0,
"fileName": "image-001.png",
"mediaType": "image/png",
"size": 284913
}
]
}图片顺序与请求 resources[] 顺序一致。ZIP 使用 store 模式,图片本身已经编码,不再进行无意义的二次压缩。
资源处理
- 准备阶段把全部源资源原子切换到
FINALIZING。 - 任一图片失败,不返回部分 ZIP。
- ZIP 完整交付后消费
resources[]中的源资源。 - 客户端中断、响应错误或渲染失败时回滚到
READY。 - 仅作为图片图层使用的资源不会自动消费。
旧单图接口
http
POST /v1/render/image
Content-Type: multipart/form-data字段:
| 字段 | 类型 | 说明 |
|---|---|---|
file | binary | JPEG、PNG 或 WebP 源图 |
job | string | JSON 编码的 Worker v1 文字水印任务 |
成功直接返回单张图片。该接口用于旧客户端迁移,不支持图片图层和新的双通道语义。
新集成不要使用旧接口
新客户端应使用资源上传和 /v1/source/render,否则无法使用图片图层、批量源资源和资源生命周期能力。