30 秒短视频
已上线写一段简短的脚本或创意,需要的话再加一张起始图片。得到一条完整的 30 秒带声音竖屏视频:9:16、720p,可直接用于 TikTok、Reels 和 Shorts。
运作方式
- 01写下脚本或创意最多 2,000 个字符:发生什么、听到什么、说了什么。想让视频从某张图开始,就加一张起始图片。
- 02我们制作短视频一条完整的 30 秒视频,声音与画面相配,9:16 竖屏,720p。
- 03下载视频720 × 1280 的 MP4,30 秒,带声音。按条计费,失败不收费。
从代码调用 30 秒短视频
One endpoint and one key, on the same balance as the playground. The request below is the example's own.
https:/ / api.opennan.com/ v1/ videos/ reels获取 API 密钥
在控制台创建密钥。它与试用区使用同一余额。
创建密钥发送第一个请求
与试用区发送的请求相同。把 OPENNAN_KEY 设为你的密钥。
curl https://api.opennan.com/v1/videos/reels \ -H "Authorization: Bearer $OPENNAN_KEY" \ -H "Content-Type: application/json" \ -d '{"prompt":"A street food cook in a busy night market flips sizzling noodles in a flaming wok, sparks and steam rising under warm string lights, then plates the noodles and slides the bowl toward the camera with a smile, vertical close-up shots, crackling fire, sizzling oil and lively market chatter"}' # Then poll until "status" is "succeeded" or "failed": curl https://api.opennan.com/v1/tasks/<task id> -H "Authorization: Bearer $OPENNAN_KEY"查询任务
调用会立即返回任务 ID。查询任务直到完成:
GEThttps:// api.opennan.com/ v1/ tasks/ {id} - queued
- 等待处理
- running
- 生成中
- succeeded
- 完成:outputs[].url 中是文件
- failed
- 失败:不收费
错误及解决方法
401缺少密钥或密钥错误
用 Authorization: Bearer 请求头发送控制台中的密钥。
402余额不足
在账单页面充值,然后重新发送同一请求。
400有值不被接受
查看 error.message,它会指出字段。请使用参数表中的值。
429请求过多
等几秒再试,每次遇到 429 都等得更久一些。
30 秒短视频:常见问题
30 秒短视频 多少钱?
每条 30 秒视频 $3.99. The Run button shows the exact price for your input before you start.
如何从代码调用?
带上 API 密钥发送 POST https://api.opennan.com/v1/videos/reels。返回任务 ID:查询 https://api.opennan.com/v1/tasks/{id},直到任务成功或失败。
我的 AI 智能体能用吗?
能。让智能体阅读 https://api.opennan.com/llms.txt,里面说明了这个接口和其他所有接口。
运行失败会怎样?
失败的运行不收费。只为结果付费。
我会得到什么,可以发送什么?
一条完整的 30 秒带声音竖屏视频:720 × 1280(9:16)的 MP4。发送最多 2,000 个字符的脚本或创意,也可以附一张起始图片(公开的 https 链接),视频会从它开始。无需其他设置:时长、画面比例和声音始终相同。