API DOCUMENT

纯梦视频 API 文档

通过纯梦 API 创建视频生成任务和视频工具任务,并使用统一查询接口获取任务状态和结果地址。 外部插件、自动化工具和业务系统只需要使用纯梦 API Key。

通用视频创建任务

请求地址

POST https://puream.cn/api/ai/video/text-to-video/tasks

请求 Header

名称必填说明
AuthorizationBearer 你的纯梦 API Key
Content-Typeapplication/json

请求参数

字段类型必填示例说明
promptstring一只猫在城市街头奔跑提示词
sizestring1280x720视频尺寸
imagesstringhttps://example.com/a.png参考图地址,多个地址用英文逗号分隔
durationstring10视频时长

图生视频创建任务

请求地址

POST https://puream.cn/api/ai/video/image-to-video/tasks

请求 Header

名称必填说明
AuthorizationBearer 你的纯梦 API Key
Content-Typeapplication/json

请求参数

字段类型必填示例说明
promptstring未来感城市夜景提示词
imagesstringhttps://example.com/a.png参考图地址,多个地址用英文逗号分隔

场景切分

计费:按输入视频时长计费,纯梦价格 0.03 元/分钟。

请求地址

POST https://puream.cn/api/ai/video-tools/scene-split/tasks

请求 Header

名称必填说明
AuthorizationBearer 你的纯梦 API Key
Content-Typeapplication/json

请求参数

字段类型必填示例说明
video_urlstringhttps://example.com/media.mp4待处理的视频 URL,需公网可访问
segment_thresholdnumber10场景切分敏感度,取值范围 [0, 100),越低切片越多
min_durationnumber3单个切片最小时长,单位秒
max_durationnumber30单个切片最大时长,单位秒
enable_clip_fadebooleantrue是否对切片边界做淡入淡出处理
callback_urlstringhttps://example.com/callback任务完成回调地址

请求示例

curl -X POST "https://puream.cn/api/ai/video-tools/scene-split/tasks" \
  -H "Authorization: Bearer 你的纯梦APIKey" \
  -H "Content-Type: application/json" \
  -d '{
    "video_url": "https://example.com/your_long_video.mp4",
    "segment_threshold": 10,
    "min_duration": 3,
    "max_duration": 30,
    "enable_clip_fade": true
  }'

字幕擦除标准版

计费:按输出视频时长计费,纯梦价格 0.6 元/分钟。

请求地址

POST https://puream.cn/api/ai/video-tools/subtitle-erase-standard/tasks

请求 Header

名称必填说明
AuthorizationBearer 你的纯梦 API Key
Content-Typeapplication/json

请求参数

字段类型必填示例说明
video_urlstringhttps://example.com/video.mp4待擦除字幕的视频 URL,需公网可访问
callback_urlstringhttps://example.com/callback任务完成回调地址

请求示例

curl -X POST "https://puream.cn/api/ai/video-tools/subtitle-erase-standard/tasks" \
  -H "Authorization: Bearer 你的纯梦APIKey" \
  -H "Content-Type: application/json" \
  -d '{
    "video_url": "https://example.com/source_video.mp4"
  }'

视频调速

计费:按输出视频时长计费,纯梦价格 0.09 元/分钟。

请求地址

POST https://puream.cn/api/ai/video-tools/adjust-video-speed/tasks

请求 Header

名称必填说明
AuthorizationBearer 你的纯梦 API Key
Content-Typeapplication/json

请求参数

字段类型必填示例说明
video_urlstringhttps://example.com/video.mp4待调速的视频 URL,需公网可访问
speednumber2.0播放倍速,范围 0.1 到 4
callback_urlstringhttps://example.com/callback任务完成回调地址

请求示例

curl -X POST "https://puream.cn/api/ai/video-tools/adjust-video-speed/tasks" \
  -H "Authorization: Bearer 你的纯梦APIKey" \
  -H "Content-Type: application/json" \
  -d '{
    "video_url": "https://example.com/source_video.mp4",
    "speed": 2.0
  }'

查询任务结果

视频生成查询

GET https://puream.cn/api/ai/video/tasks/任务ID

视频工具查询

GET https://puream.cn/api/ai/video-tools/scene-split/tasks/任务ID
GET https://puream.cn/api/ai/video-tools/subtitle-erase-standard/tasks/任务ID
GET https://puream.cn/api/ai/video-tools/adjust-video-speed/tasks/任务ID

请求 Header

名称必填说明
AuthorizationBearer 你的纯梦 API Key

视频工具返回参数

字段类型说明
successboolean任务是否成功
task_idstring任务 ID
result.video_urlstring字幕擦除成功后的视频地址
result.durationnumber视频时长,单位秒
result.segmentsarray场景切分片段列表
result.segments[].start_timenumber片段开始时间
result.segments[].end_timenumber片段结束时间
result.segments[].segment_video_urlstring片段视频地址
error.messagestring失败原因

轮询建议

视频任务都是异步任务。建议创建任务后每 20 秒查询一次,查询到成功状态和结果地址后直接返回 URL。 如果超过最大等待次数仍未完成,可以返回任务 ID 和当前状态,让用户稍后继续查询。