Producer Lyrics Generation API
POSThttps://api.yxai-tech.top/producer/lyrics
Producer AI 歌词生成 API,输入 prompt 生成歌词。
请求头
acceptstring
指定服务器返回的响应格式。
请选择
authorizationstring
Bearer token
请求体
promptstring必填参数
用于生成歌词的提示词。
响应
成功200
请求成功。
响应体
dataobject
根据提示词生成的歌词内容。
textstring
生成的文本内容
titlestring
生成内容的标题
statusstring
生成状态,例如 `succeeded` 表示生成成功
successboolean
标识请求是否成功的标志位。
示例
{
"data": {
"text": "[Verse]\nSnow is falling, all around\nChildren playing, having fun\nIt's the season, filled with cheer\nCan you feel the magic near? (ooh-yeah)\n\n[Verse 2]\nLights are twinkling, on the tree\nFireplace crackling, warmth and glee\nLove is shared, with friends and kin\nLet the celebrations begin! (oh-oh-oh)\n\n[Chorus]\nDashing through the snow (hey)\nIn a one-horse open sleigh\nOver fields we go (go)\nLaughing all the way (ha haha)\nBells on bobtail ring (ring)\nMaking spirits bright (bright)\nWhat fun it is to ride and sing\nA sleighing song tonight! (yeah-yeah)",
"title": "Winter Wonderland",
"status": "complete"
},
"success": true
}失败400token_mismatched
请求错误,可能是参数缺失或无效。
响应体
errorobject
codestring
响应的错误码。
messagestring
响应的错误信息。
trace_idstring
本次请求的追踪 ID。
示例
{
"error": {
"code": "token_mismatched",
"message": "The specified token is not matched with API."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失败400api_not_implemented
请求错误,可能是参数缺失或无效。
响应体
errorobject
codestring
响应的错误码。
messagestring
响应的错误信息。
trace_idstring
本次请求的追踪 ID。
示例
{
"error": {
"code": "api_not_implemented",
"message": "The API is not implemented."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失败400disabled
请求错误,可能是参数缺失或无效。
响应体
errorobject
codestring
响应的错误码。
messagestring
响应的错误信息。
trace_idstring
本次请求的追踪 ID。
示例
{
"error": {
"code": "disabled",
"message": "Your application has been disabled by Ace Data Cloud due to abnormal usage behavior, please contact our support to get more information."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失败400bad_request
请求错误,可能是参数缺失或无效。
响应体
errorobject
codestring
响应的错误码。
messagestring
响应的错误信息。
trace_idstring
本次请求的追踪 ID。
示例
{
"error": {
"code": "bad_request",
"message": "model is invalid."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失败400no_token
请求错误,可能是参数缺失或无效。
响应体
errorobject
codestring
响应的错误码。
messagestring
响应的错误信息。
trace_idstring
本次请求的追踪 ID。
示例
{
"error": {
"code": "no_token",
"message": "No token specified for the request."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失败401invalid_token
未授权,授权令牌无效或缺失。
响应体
errorobject
codestring
响应的错误码。
messagestring
响应的错误信息。
trace_idstring
本次请求的追踪 ID。
示例
{
"error": {
"code": "invalid_token",
"message": "The specified token is invalid or wrong."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失败401token_expired
未授权,授权令牌无效或缺失。
响应体
errorobject
codestring
响应的错误码。
messagestring
响应的错误信息。
trace_idstring
本次请求的追踪 ID。
示例
{
"error": {
"code": "token_expired",
"message": "token expired."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失败401token_mismatched
未授权,授权令牌无效或缺失。
响应体
errorobject
codestring
响应的错误码。
messagestring
响应的错误信息。
trace_idstring
本次请求的追踪 ID。
示例
{
"error": {
"code": "token_mismatched",
"message": "token and api does not match."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}失败403used_up
未授权,授权令牌无效或缺失。
响应体
errorobject
codestring
响应的错误码。
messagestring
响应的错误信息。
trace_idstring
本次请求的追踪 ID。
失败404no_api
未授权,授权令牌无效或缺失。
响应体
errorobject
codestring
响应的错误码。
messagestring
响应的错误信息。
trace_idstring
本次请求的追踪 ID。
失败429too_many_requests
请求过多,已超出速率限制。
响应体
errorobject
codestring
响应的错误码。
messagestring
响应的错误信息。
trace_idstring
本次请求的追踪 ID。
失败500api_error
服务器内部错误,服务端发生异常。
响应体
errorobject
codestring
响应的错误码。
messagestring
响应的错误信息。
trace_idstring
本次请求的追踪 ID。

集成指南
Shell
Python
JavaScript
Java
Go
PHP
温馨提示:对于流式请求,上面的代码可能不完全适用。请参阅对接文档以进行更改。
Producer 音乐生成
允许用通用余额
启用「允许通用余额」后,专属余额不足将自动使用通用余额。

