curl --request POST \
--url https://api.apimart.ai/v1/music/generations/replaceFlowMusic \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "flowmusic",
"clip_id": "abc123-def456",
"start_s": 10,
"end_s": 20,
"instruction": "替换为钢琴版本"
}'
import requests
url = "https://api.apimart.ai/v1/music/generations/replaceFlowMusic"
payload = {
"model": "flowmusic",
"clip_id": "abc123-def456",
"start_s": 10,
"end_s": 20,
"instruction": "替换为钢琴版本"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/music/generations/replaceFlowMusic";
const payload = {
model: "flowmusic",
clip_id: "abc123-def456",
start_s: 10,
end_s: 20,
instruction: "替换为钢琴版本"
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01KWXVHGTG5JM33S8FG1K90YQ6"
}
]
}
{
"error": {
"message": "end_s must be greater than start_s",
"type": "invalid_request",
"param": "",
"code": "invalid_request"
}
}
{
"error": {
"message": "余额不足",
"type": "invalid_request",
"param": "",
"code": "quota_not_enough"
}
}
{
"error": {
"message": "当前分组容量饱和,请稍后重试",
"type": "rate_limit_error",
"param": "",
"code": "rate_limit_error"
}
}
Flow Music
片段替换
Flow Music 替换已生成音频中的某一段。按编辑指令重新生成 start_s 到 end_s 之间的片段
POST
/
v1
/
music
/
generations
/
replaceFlowMusic
curl --request POST \
--url https://api.apimart.ai/v1/music/generations/replaceFlowMusic \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "flowmusic",
"clip_id": "abc123-def456",
"start_s": 10,
"end_s": 20,
"instruction": "替换为钢琴版本"
}'
import requests
url = "https://api.apimart.ai/v1/music/generations/replaceFlowMusic"
payload = {
"model": "flowmusic",
"clip_id": "abc123-def456",
"start_s": 10,
"end_s": 20,
"instruction": "替换为钢琴版本"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/music/generations/replaceFlowMusic";
const payload = {
model: "flowmusic",
clip_id: "abc123-def456",
start_s: 10,
end_s: 20,
instruction: "替换为钢琴版本"
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01KWXVHGTG5JM33S8FG1K90YQ6"
}
]
}
{
"error": {
"message": "end_s must be greater than start_s",
"type": "invalid_request",
"param": "",
"code": "invalid_request"
}
}
{
"error": {
"message": "余额不足",
"type": "invalid_request",
"param": "",
"code": "quota_not_enough"
}
}