提升音乐风格
curl --request POST \
--url https://apibox.erweima.ai/api/v1/style/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "Pop, Mysterious"
}
'import requests
url = "https://apibox.erweima.ai/api/v1/style/generate"
payload = { "content": "Pop, Mysterious" }
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({content: 'Pop, Mysterious'})
};
fetch('https://apibox.erweima.ai/api/v1/style/generate', 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://apibox.erweima.ai/api/v1/style/generate",
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([
'content' => 'Pop, Mysterious'
]),
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://apibox.erweima.ai/api/v1/style/generate"
payload := strings.NewReader("{\n \"content\": \"Pop, Mysterious\"\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://apibox.erweima.ai/api/v1/style/generate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"Pop, Mysterious\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apibox.erweima.ai/api/v1/style/generate")
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 \"content\": \"Pop, Mysterious\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"taskId": "<string>",
"param": "<string>",
"result": "<string>",
"creditsConsumed": 123,
"creditsRemaining": 123,
"successFlag": "<string>",
"errorCode": 123,
"errorMessage": "<string>",
"createTime": "<string>"
}
}Generate Music
提升音乐风格
POST
/
api
/
v1
/
style
/
generate
提升音乐风格
curl --request POST \
--url https://apibox.erweima.ai/api/v1/style/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "Pop, Mysterious"
}
'import requests
url = "https://apibox.erweima.ai/api/v1/style/generate"
payload = { "content": "Pop, Mysterious" }
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({content: 'Pop, Mysterious'})
};
fetch('https://apibox.erweima.ai/api/v1/style/generate', 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://apibox.erweima.ai/api/v1/style/generate",
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([
'content' => 'Pop, Mysterious'
]),
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://apibox.erweima.ai/api/v1/style/generate"
payload := strings.NewReader("{\n \"content\": \"Pop, Mysterious\"\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://apibox.erweima.ai/api/v1/style/generate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"Pop, Mysterious\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apibox.erweima.ai/api/v1/style/generate")
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 \"content\": \"Pop, Mysterious\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"taskId": "<string>",
"param": "<string>",
"result": "<string>",
"creditsConsumed": 123,
"creditsRemaining": 123,
"successFlag": "<string>",
"errorCode": 123,
"errorMessage": "<string>",
"createTime": "<string>"
}
}这是V4_5的独特功能。V4_5的风格功能已经得到显著增强,正如官方网站所述:
新4.5模型的众多优势之一是它能够适应更详细的风格指令。在之前的模型中,必须优先考虑具体的流派和风格细节,但现在的指令可以包含更具对话性的提示。 之前,最佳效果可能通过这样的提示词实现:‘深度浩室,情感,旋律。’ 现在,您可以提供这样的提示:‘创作一首富有旋律性和情感的深度浩室歌曲,融入有机质感和催眠节奏。从柔和的环境音层、自然声音和稳定的律动开始。逐渐叠加流动的旋律合成器、温暖的低音线条,以及精致、细腻的打击乐。’‘风格提升’功能将显著增强用户描述和控制风格的能力。推荐使用此功能。
参数说明
- content:必填,字符串类型。需包含风格描述。
授权
🔑 API 认证说明
所有接口都需要通过 Bearer Token 方式进行认证。
获取 API Key
- 访问 API Key 管理页面 获取您的 API Key
使用方式
在请求头中添加:
Authorization: Bearer YOUR_API_KEY
⚠️ 注意:
- 请妥善保管您的 API Key,不要泄露给他人
- 如果怀疑 API Key 泄露,请立即在管理页面重置
请求体
application/json
风格描述。请用简洁明了的语言描述你期望生成的音乐风格。示例:'Pop, Mysterious'。
示例:
"Pop, Mysterious"
响应
请求成功
状态码说明
- ✅ 200 - 请求成功
- ⚠️ 400 - 参数错误
- ⚠️ 401 - 没有访问权限
- ⚠️ 404 - 请求方式或者路径错误
- ⚠️ 405 - 调用超过限制
- ⚠️ 413 - 主题或者prompt过长
- ⚠️ 429 - 积分不足
- ⚠️ 430 - 您的调用频率过高。请稍后再试。
- ⚠️ 455 - 网站维护
- ❌ 500 - 服务器异常
可用选项:
200, 400, 401, 404, 405, 413, 429, 430, 455, 500 示例:
200
当 code != 200 时,展示错误信息
示例:
"success"
Show child attributes
Show child attributes
⌘I
