lyrics infill
curl --request POST \
--url https://api.mountsea.ai/suno/v2/lyricsInfill \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "a hopeful chorus about coming home",
"context_lyrics_prefix": "<string>",
"context_lyrics_edit": "<string>",
"context_lyrics_suffix": "<string>",
"title": "<string>"
}
'import requests
url = "https://api.mountsea.ai/suno/v2/lyricsInfill"
payload = {
"prompt": "a hopeful chorus about coming home",
"context_lyrics_prefix": "<string>",
"context_lyrics_edit": "<string>",
"context_lyrics_suffix": "<string>",
"title": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'a hopeful chorus about coming home',
context_lyrics_prefix: '<string>',
context_lyrics_edit: '<string>',
context_lyrics_suffix: '<string>',
title: '<string>'
})
};
fetch('https://api.mountsea.ai/suno/v2/lyricsInfill', 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.mountsea.ai/suno/v2/lyricsInfill",
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([
'prompt' => 'a hopeful chorus about coming home',
'context_lyrics_prefix' => '<string>',
'context_lyrics_edit' => '<string>',
'context_lyrics_suffix' => '<string>',
'title' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.mountsea.ai/suno/v2/lyricsInfill"
payload := strings.NewReader("{\n \"prompt\": \"a hopeful chorus about coming home\",\n \"context_lyrics_prefix\": \"<string>\",\n \"context_lyrics_edit\": \"<string>\",\n \"context_lyrics_suffix\": \"<string>\",\n \"title\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.mountsea.ai/suno/v2/lyricsInfill")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"a hopeful chorus about coming home\",\n \"context_lyrics_prefix\": \"<string>\",\n \"context_lyrics_edit\": \"<string>\",\n \"context_lyrics_suffix\": \"<string>\",\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mountsea.ai/suno/v2/lyricsInfill")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"a hopeful chorus about coming home\",\n \"context_lyrics_prefix\": \"<string>\",\n \"context_lyrics_edit\": \"<string>\",\n \"context_lyrics_suffix\": \"<string>\",\n \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}Suno
歌词填充
只改一段歌词,不生成音乐
POST
/
suno
/
v2
/
lyricsInfill
lyrics infill
curl --request POST \
--url https://api.mountsea.ai/suno/v2/lyricsInfill \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "a hopeful chorus about coming home",
"context_lyrics_prefix": "<string>",
"context_lyrics_edit": "<string>",
"context_lyrics_suffix": "<string>",
"title": "<string>"
}
'import requests
url = "https://api.mountsea.ai/suno/v2/lyricsInfill"
payload = {
"prompt": "a hopeful chorus about coming home",
"context_lyrics_prefix": "<string>",
"context_lyrics_edit": "<string>",
"context_lyrics_suffix": "<string>",
"title": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'a hopeful chorus about coming home',
context_lyrics_prefix: '<string>',
context_lyrics_edit: '<string>',
context_lyrics_suffix: '<string>',
title: '<string>'
})
};
fetch('https://api.mountsea.ai/suno/v2/lyricsInfill', 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.mountsea.ai/suno/v2/lyricsInfill",
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([
'prompt' => 'a hopeful chorus about coming home',
'context_lyrics_prefix' => '<string>',
'context_lyrics_edit' => '<string>',
'context_lyrics_suffix' => '<string>',
'title' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.mountsea.ai/suno/v2/lyricsInfill"
payload := strings.NewReader("{\n \"prompt\": \"a hopeful chorus about coming home\",\n \"context_lyrics_prefix\": \"<string>\",\n \"context_lyrics_edit\": \"<string>\",\n \"context_lyrics_suffix\": \"<string>\",\n \"title\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.mountsea.ai/suno/v2/lyricsInfill")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"a hopeful chorus about coming home\",\n \"context_lyrics_prefix\": \"<string>\",\n \"context_lyrics_edit\": \"<string>\",\n \"context_lyrics_suffix\": \"<string>\",\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mountsea.ai/suno/v2/lyricsInfill")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"a hopeful chorus about coming home\",\n \"context_lyrics_prefix\": \"<string>\",\n \"context_lyrics_edit\": \"<string>\",\n \"context_lyrics_suffix\": \"<string>\",\n \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}写一段新词,或重写已有歌词里的一段。接口调用官方 lyrics-infill,并在当次响应里返回官方结果。不会生成 clip,也不改变 生成歌词 和 生成音乐。
同步。 歌词就在这次响应里。没有
taskId,不要轮询 查询任务状态。参数
| 字段 | 必填 | 说明 |
|---|---|---|
prompt | 是 | 要写什么,或这段怎么改。例如 a hopeful chorus about coming home |
context_lyrics_prefix | 否 | 这段之前的歌词。不传则服务端发送 "" |
context_lyrics_edit | 否 | 正在改的这一段。不传则服务端发送 "" |
context_lyrics_suffix | 否 | 这段之后的歌词。不传则服务端发送 "" |
title | 否 | 歌名。不传则服务端发送 "" |
示例
curl -X POST https://api.mountsea.ai/suno/v2/lyricsInfill \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-api-key" \
-d '{
"prompt": "a hopeful chorus about coming home",
"title": "Home",
"context_lyrics_prefix": "[Verse]\nPacked the car before the sun",
"context_lyrics_edit": "[Chorus]\n",
"context_lyrics_suffix": "[Verse]\nHighway lines until they blur"
}'
授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json
Instruction for the lyrics to write or fill in.
示例:
"a hopeful chorus about coming home"
Lyrics before the edit. Omitted values are sent as an empty string.
Lyrics currently selected for edit. Omitted values are sent as an empty string.
Lyrics after the edit. Omitted values are sent as an empty string.
Song title. Omitted values are sent as an empty string.
响应
201 - application/json
The response is of type object.