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

生成音乐

POST
https://api.openai-hub.com/suno/v1/music
通过提供定制化的提示词、标题、标签等参数,生成音乐。

请求参数

Header 参数
Content-Type
string 
可选
示例值:
application/json
Authorization
string 
必需
在 Header 添加参数 Authorization,其值为在 Bearer 之后拼接 令牌
示例
Authorization: Bearer 2f68dbbf-519d-4f01-9636-e2421b68f379
默认值:
Bearer {{YOUR_API_KEY}}
Body 参数application/json
custom_mode
boolean 
是否启用自定义模式
必需
示例值:
true
input
object 
必需
prompt
string 
生成音乐的提示词
必需
示例值:
[Verse] Tesla riding Batteries flying Elon Musk He's got the future on his mind Solar panels shining Rockets reaching for the skies Innovation's flowing He's the tech wizard of our times [Verse] Neuralink connecting minds AI running wild Mars colonization He's making it his style From PayPal he came and shook the world with his touch Elon Musk The eccentric genius He's too much [Chorus] Elon Musk He's the man with electric dreams Changing the world with his technology schemes From PayPal to SpaceX He's a force to be seen Electric cars and rockets He's living the dream
title
string 
音乐标题
必需
示例值:
Electric Dreams
tags
string 
音乐标签
必需
示例值:
epic reggae
continue_at
integer 
继续生成的时间点
必需
示例值:
0
continue_clip_id
string 
继续生成的片段ID
必需
示例值:
示例
{
    "custom_mode": true,
    "input": {
        "prompt": "[Verse]\nTesla riding\nBatteries flying\nElon Musk\nHe's got the future on his mind\nSolar panels shining\nRockets reaching for the skies\nInnovation's flowing\nHe's the tech wizard of our times\n\n[Verse]\nNeuralink connecting minds\nAI running wild\nMars colonization\nHe's making it his style\nFrom PayPal he came and shook the world with his touch\nElon Musk\nThe eccentric genius\nHe's too much\n\n[Chorus]\nElon Musk\nHe's the man with electric dreams\nChanging the world with his technology schemes\nFrom PayPal to SpaceX\nHe's a force to be seen\nElectric cars and rockets\nHe's living the dream",
        "title": "Electric Dreams",
        "tags": "epic reggae",
        "continue_at": 0,
        "continue_clip_id": ""
    }
}

示例代码

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/suno/v1/music' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "custom_mode": true,
    "input": {
        "prompt": "[Verse]\nTesla riding\nBatteries flying\nElon Musk\nHe'\''s got the future on his mind\nSolar panels shining\nRockets reaching for the skies\nInnovation'\''s flowing\nHe'\''s the tech wizard of our times\n\n[Verse]\nNeuralink connecting minds\nAI running wild\nMars colonization\nHe'\''s making it his style\nFrom PayPal he came and shook the world with his touch\nElon Musk\nThe eccentric genius\nHe'\''s too much\n\n[Chorus]\nElon Musk\nHe'\''s the man with electric dreams\nChanging the world with his technology schemes\nFrom PayPal to SpaceX\nHe'\''s a force to be seen\nElectric cars and rockets\nHe'\''s living the dream",
        "title": "Electric Dreams",
        "tags": "epic reggae",
        "continue_at": 0,
        "continue_clip_id": ""
    }
}'

返回响应

🟢200成功
application/json
Body
code
integer 
状态码
必需
示例值:
200
data
object 
必需
task_id
string 
任务ID
可选
示例值:
56ea8da3-8507-4118-9f1e-111111111111
message
string 
响应消息
必需
示例值:
success
示例
{
    "code": 200,
    "data": {
        "task_id": "56ea8da3-8507-4118-9f1e-111111111111"
    },
    "message": "success"
}
修改于 2024-09-09 06:08:41
上一页
批量查询任务
下一页
查询任务
Built with