ChatPlus API
  1. ChatPlus API
ChatPlus API
  • 发送测试请求
  • HTTP状态码含义
  • ChatPlus API
    • 文字对话聊天
      POST
    • 文字转换语音
      POST
    • 语音转换文字
      POST
    • 语音翻译英文
      POST
    • 文字转换图片
      POST
    • 图片内容识别
      POST
    • gpt-4逆向画图
      POST
    • 谷歌gemini-pro
      POST
    • SunoAI音乐生成
      POST
    • Midjourney绘图
      POST
    • Midjourney查询
      POST
  1. ChatPlus API

SunoAI音乐生成

POST
/v1/chat/completions
文字对话聊天调用Suno AI生成音乐歌曲,输入想要的歌曲类型要表达的主题,或者直接输入歌词。
支持的模型:suno-v2、suno-v3

请求参数

Header 参数
Accept
string 
必需
示例值:
application/json
Content-Type
string 
必需
在HTTP的请求Header中添加参数Content-Type POST请求主体类型为application/json
示例值:
application/json
Authorization
string 
必需
在HTTP的请求Header中添加参数Authorization,其值为在Bearer之后拼接以sk-开头的令牌API KEY的值。
示例值:
Bearer {{API_KEY}}
Body 参数application/json
model
string 
必需
messages
array [object {2}] 
必需
role
string 
可选
content
string 
可选
stream
boolean 
必需
max_tokens
integer 
必需
temperature
number 
必需
presence_penalty
integer 
必需
frequency_penalty
integer 
必需
top_p
integer 
必需
示例
{
    "model": "suno-v3",
    "messages": [
        {
            "role": "user",
            "content": "在零一世界编程的深夜,键盘敲击声犹如代码的诗篇,我是个戴着黑框眼镜的程序侠,披星戴月,调试着无尽的循环。"
        }
    ],
    "stream": true,
    "max_tokens": 1024,
    "temperature": 0.5,
    "presence_penalty": 0,
    "frequency_penalty": 0,
    "top_p": 1
}

示例代码

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://chatplusapi.cn/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "suno-v3",
    "messages": [
        {
            "role": "user",
            "content": "在零一世界编程的深夜,键盘敲击声犹如代码的诗篇,我是个戴着黑框眼镜的程序侠,披星戴月,调试着无尽的循环。"
        }
    ],
    "stream": true,
    "max_tokens": 1024,
    "temperature": 0.5,
    "presence_penalty": 0,
    "frequency_penalty": 0,
    "top_p": 1
}'

返回响应

🟢200成功
application/json
Body
object {0}
示例
data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":"#### 🎵"},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":""},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":""},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":""},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":""},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":""},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":""},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":""},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":"Code"},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":" the"},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":" Night"},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":" Away"},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":""},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":"\n\n"},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":"*"},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":""},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":""},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":""},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":"Electronic"},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":","},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":" Mel"},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":"odic"},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":","},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH","object":"chat.completion.chunk","model":"suno-v3","created":1715375180,"choices":[{"index":0,"delta":{"content":" Up"},"finish_reason":null}]}

data: {"id":"chatcmpl-89CWjF40odBaD341Gq0L52uhIjLtH"
🟠403失败
修改于 2024-05-14 08:24:42
上一页
谷歌gemini-pro
下一页
Midjourney绘图
Built with