Producer Lyrics Generation API
POSThttps://api.01ai.cloud/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。

Integration workbench
Shell
Python
JavaScript
Java
Go
PHP
溫馨提示:對於流式請求,上面的代碼可能不完全適用。請參閱對接文檔以進行更改。
Producer 音乐生成
允许用通用余额
啟用「允許通用餘額」後,專屬餘額不足將自動使用通用餘額。

