OpenAI-Hub中文文档
首页控制台
首页控制台
  1. 任务提交
  • 序言
  • OpenAI接口
    • 聊天通用
      • 如何上传文件?
      • 语音对话接口
      • 聊天(通用)
      • gpts接口
      • gpt-4-all(生成图片)
      • gpt-4-all(分析图片)
    • 内容补全
      • 创建完成
    • 图像接口
      • 创建图像
      • 创建图像编辑
      • 创建图像变化
    • 音频接口
      • 创建语音
      • 创建转录
    • 向量生成
      • 创建嵌入
    • 模型列表
      • 列出模型
    • 内容审核
      • 创建内容审核
    • 帮助中心
      • HTTP接口状态码
  • Suno音乐接口
    • 接口格式(通用)
      • 生成音乐
      • 生成歌词
      • 查询单个任务
      • 批量查询任务
    • 其他接口格式
      • 生成音乐
      • 查询任务
  • 绘画接口
    • Midjourney
      • InsightFace任务提交
        • 提交swap_face任务(废弃)
      • 任务提交
        • 提交Imagine任务
        • 执行动作
        • 提交Blend任务
        • 提交Describe任务
        • 提交Modal
        • 提交Shorten任务
        • 上传文件到discord
      • 任务查询
        • 指定ID获取任务
        • 根据ID列表查询任务
        • 根据ID列表查询任务-字段displays
        • 获取任务图片的seed
    • Flux(暂不可用)
      • 生成图片
    • Ideogram(绘画)
      • Generate(文生图)
      • Remix(混合图)
      • Upscale(放大高清)
      • Describe(描述)
  • 视频接口
    • Luma视频接口
      • 官方接口格式
        • 视频生成
        • 获取结果
      • 平台格式
        • 任务提交
          • 生成视频
            POST
          • 扩展视频
            POST
          • 获取视频无水印链接
            GET
        • 任务查询
          • 查询单个任务
          • 批量查询任务
    • Runway视频接口
      • feed
      • generate(文本)
      • generate(参考图片)
    • Pika视频接口
      • 任务提交
      • 查询任务
  • 文本生成(通用)
    • 聊天(通用)
      POST
    • Anthropic Claude(全系列,已更新支持第三代)
      POST
    • gemini-pro
      POST
  • 可灵AI
    • 回调协议
    • 生成图像
    • 生成视频
    • 图生视频
    • 查询单个任务
  1. 任务提交

生成视频

POST
https://api.openai-hub.com/luma/generations
生成视频
生成视频接口

请求参数

Header 参数
Content-Type
string 
可选
示例值:
application/json; charset=utf-8
Authorization
string 
必需
在 Header 添加参数 Authorization,其值为在 Bearer 之后拼接 令牌
示例
Authorization: Bearer 2f68dbbf-519d-4f01-9636-e2421b68f379
默认值:
Bearer {{YOUR_API_KEY}}
Body 参数application/json
user_prompt
string 
用户提示
必需
示例值:
cat dance
aspect_ratio
string 
长宽比
必需
示例值:
16:9
expand_prompt
boolean 
可选
是否开启prompt 优化
示例值:
true
loop
boolean 
循环一张参考图
必需
示例值:
true
image_url
string 
可选
参考图,支持第三方图片地址、Base64
示例值:
https://example.com/image.png
image_end_url
string 
可选
关键帧,支持第三方图片地址、Base64
示例值:
https://example.com/end_image.png
notify_hook
string 
回调地址
可选
示例值:
https://xxxxxxx
model
string 
必需
模型名称:不填默认为luma-video
示例
{
  "user_prompt": "cat dance",
  "aspect_ratio": "16:9",
  "expand_prompt": true,
  "loop": true,
  "image_url": "https://example.com/image.png",
  "image_end_url": "https://example.com/end_image.png",
  "notify_hook": "https://xxxxxxx"
}

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.openai-hub.com/luma/generations' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "user_prompt": "cat dance",
    "aspect_ratio": "16:9",
    "expand_prompt": true,
    "loop": true,
    "image_url": "https://example.com/image.png",
    "image_end_url": "https://example.com/end_image.png",
    "notify_hook": "https://xxxxxxx"
}'

返回响应

🟢201Created
application/json
Body
created_at
string 
必需
示例值:
2024-07-22T12:47:28.553735Z
estimate_wait_seconds
null 
必需
示例值:
null
id
string 
必需
示例值:
fc7fb008-7a5e-40ad-a7ff-dbb63db61be8
last_frame
null 
必需
示例值:
null
liked
null 
必需
示例值:
null
prompt
string 
必需
示例值:
cat dance
state
string 
必需
示例值:
pending
thumbnail
null 
必需
示例值:
null
video
null 
必需
示例值:
null
示例
{
  "created_at": "2024-07-22T12:47:28.553735Z",
  "estimate_wait_seconds": null,
  "id": "fc7fb008-7a5e-40ad-a7ff-dbb63db61be8",
  "last_frame": null,
  "liked": null,
  "prompt": "cat dance",
  "state": "pending",
  "thumbnail": null,
  "video": null
}
上一页
获取结果
下一页
扩展视频
Built with