歌词生成
curl --request POST \
--url https://api.minimaxi.com/v1/lyrics_generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"mode": "write_full_song",
"prompt": "一首关于夏日海边的轻快情歌"
}
'import requests
url = "https://api.minimaxi.com/v1/lyrics_generation"
payload = {
"mode": "write_full_song",
"prompt": "一首关于夏日海边的轻快情歌"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({mode: 'write_full_song', prompt: '一首关于夏日海边的轻快情歌'})
};
fetch('https://api.minimaxi.com/v1/lyrics_generation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.minimaxi.com/v1/lyrics_generation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mode' => 'write_full_song',
'prompt' => '一首关于夏日海边的轻快情歌'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.minimaxi.com/v1/lyrics_generation"
payload := strings.NewReader("{\n \"mode\": \"write_full_song\",\n \"prompt\": \"一首关于夏日海边的轻快情歌\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.minimaxi.com/v1/lyrics_generation")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"mode\": \"write_full_song\",\n \"prompt\": \"一首关于夏日海边的轻快情歌\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimaxi.com/v1/lyrics_generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"mode\": \"write_full_song\",\n \"prompt\": \"一首关于夏日海边的轻快情歌\"\n}"
response = http.request(request)
puts response.read_body{
"song_title": "夏日海风的约定",
"style_tags": "Mandopop, Summer Vibe, Romance, Lighthearted, Beach Pop",
"lyrics": "[Intro]\n(Ooh-ooh-ooh)\n(Yeah)\n阳光洒满了海面\n\n[Verse 1]\n海风轻轻吹拂你发梢\nSmiling face, like a summer dream\n浪花拍打着脚边\nLeaving footprints, you and me\n沙滩上留下我们的笑\nEvery moment, a sweet melody\n看着你眼中的闪耀\nLike the stars in the deep blue sea\n\n[Pre-Chorus]\n你说这感觉多么奇妙\n(So wonderful)\n想要永远停留在这一秒\n(Right here, right now)\n心跳加速,像海浪在奔跑\n\n[Chorus]\nOh, 夏日的海边,我们的约定\n阳光下,你的身影,如此动听\n微风吹散了烦恼,只留下甜蜜\n这瞬间,只想和你,永远在一起\n(永远在一起)\n\n[Verse 2]\n...",
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}音乐生成
歌词生成 (Lyrics Generation)
使用本接口生成歌词,支持完整歌曲创作和歌词编辑/续写。
POST
/
v1
/
lyrics_generation
歌词生成
curl --request POST \
--url https://api.minimaxi.com/v1/lyrics_generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"mode": "write_full_song",
"prompt": "一首关于夏日海边的轻快情歌"
}
'import requests
url = "https://api.minimaxi.com/v1/lyrics_generation"
payload = {
"mode": "write_full_song",
"prompt": "一首关于夏日海边的轻快情歌"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({mode: 'write_full_song', prompt: '一首关于夏日海边的轻快情歌'})
};
fetch('https://api.minimaxi.com/v1/lyrics_generation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.minimaxi.com/v1/lyrics_generation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mode' => 'write_full_song',
'prompt' => '一首关于夏日海边的轻快情歌'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.minimaxi.com/v1/lyrics_generation"
payload := strings.NewReader("{\n \"mode\": \"write_full_song\",\n \"prompt\": \"一首关于夏日海边的轻快情歌\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.minimaxi.com/v1/lyrics_generation")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"mode\": \"write_full_song\",\n \"prompt\": \"一首关于夏日海边的轻快情歌\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimaxi.com/v1/lyrics_generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"mode\": \"write_full_song\",\n \"prompt\": \"一首关于夏日海边的轻快情歌\"\n}"
response = http.request(request)
puts response.read_body{
"song_title": "夏日海风的约定",
"style_tags": "Mandopop, Summer Vibe, Romance, Lighthearted, Beach Pop",
"lyrics": "[Intro]\n(Ooh-ooh-ooh)\n(Yeah)\n阳光洒满了海面\n\n[Verse 1]\n海风轻轻吹拂你发梢\nSmiling face, like a summer dream\n浪花拍打着脚边\nLeaving footprints, you and me\n沙滩上留下我们的笑\nEvery moment, a sweet melody\n看着你眼中的闪耀\nLike the stars in the deep blue sea\n\n[Pre-Chorus]\n你说这感觉多么奇妙\n(So wonderful)\n想要永远停留在这一秒\n(Right here, right now)\n心跳加速,像海浪在奔跑\n\n[Chorus]\nOh, 夏日的海边,我们的约定\n阳光下,你的身影,如此动听\n微风吹散了烦恼,只留下甜蜜\n这瞬间,只想和你,永远在一起\n(永远在一起)\n\n[Verse 2]\n...",
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}授权
请求头
请求体的媒介类型,请设置为 application/json,确保请求数据的格式为 JSON
可用选项:
application/json 请求体
application/json
响应
200 - application/json
成功响应
生成的歌名。若请求传入 title 则保持一致。
风格标签,逗号分隔。例如:Pop, Upbeat, Female Vocals
状态码及详情
Show child attributes
Show child attributes
此页面对您有帮助吗?
⌘I