For AI agents: the complete documentation index is available at https://docs.reelway.ai/llms.txt, the full documentation bundle is available at https://docs.reelway.ai/llms-full.txt, and this page is available as Markdown at https://docs.reelway.ai/intelligence/media-upload-urls.md.

媒体上传 URL

托管工具与生成任务需要「HTTP(S) URL」形态的媒体引用(media_references 校验 http(s),1009 错误码兜底)。把本地文件变成可引用 URL 的两条路径:

方式端点适用
预签名 URL 直传`GET /v1/imagemedia/uploadUrl`
获取下载 URL`GET /v1/imagemedia/downloadUrl`
资产库(可复用)POST /v1/assets/prepare → PUT → finalize → bind同一文件被多个项目引用、需要去重与配额管理

直传示例

# 1. 申请上传 URL
curl "https://rcn.reelway.ai/v1/image/uploadUrl?type=referenceImage&jobId=$JOB_ID&contentType=image/png" \
  -H "api-key: $REELWAY_API_KEY"

# 2. PUT 文件体(原样携带 uploadHeaders)
curl -X PUT "$UPLOAD_URL" -H "Content-Type: image/png" --data-binary @ref.png

槽位枚举(image 侧):preview、complete、startingImage、cnImage、contextImage1..16、keyframeImage1..8、referenceImage、referenceImageEnd、referenceMask;media 侧:referenceAudio、referenceVideo。细节见媒体与图像 URL。

资产库四步

prepare 按 sha256 去重(同文件直接 reused: true 跳过上传),finalize 复验哈希与大小后置 ready,bind 把资产绑定到项目槽位;配额见媒体工具。

错误速查

HTTP错误码场景
4001009工作流 media_references 引用了非 http(s) 值
404—downloadUrl 对象不存在
423—bind 时资产非 ready