POST /ent/v2/text2audio
curl --request POST \
--url https://api.maxapi.ai/ent/v2/text2audio \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "audio1.0",
"prompt": "轻柔的钢琴曲"
}
'import requests
url = "https://api.maxapi.ai/ent/v2/text2audio"
payload = {
"model": "audio1.0",
"prompt": "轻柔的钢琴曲"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'audio1.0', prompt: '轻柔的钢琴曲'})
};
fetch('https://api.maxapi.ai/ent/v2/text2audio', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.maxapi.ai/ent/v2/text2audio"
payload := strings.NewReader("{\n \"model\": \"audio1.0\",\n \"prompt\": \"轻柔的钢琴曲\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.maxapi.ai/ent/v2/text2audio")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"audio1.0\",\n \"prompt\": \"轻柔的钢琴曲\"\n}")
.asString();{
"task_id": "<string>",
"state": "pending",
"model": "<string>",
"prompt": "<string>",
"images": [
"<string>"
],
"duration": 123,
"seed": 123,
"resolution": "<string>",
"bgm": true,
"movement_amplitude": "<string>",
"payload": "<string>",
"off_peak": true,
"credits": 123,
"watermark": true,
"created_at": "2023-11-07T05:31:56Z"
}POST /ent/v2/text2audio
Use this endpoint to call the provider-compatible post /ent/v2/text2audio operation through MaxAPI.
POST
https://api.maxapi.ai
/
ent
/
v2
/
text2audio
POST /ent/v2/text2audio
curl --request POST \
--url https://api.maxapi.ai/ent/v2/text2audio \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "audio1.0",
"prompt": "轻柔的钢琴曲"
}
'import requests
url = "https://api.maxapi.ai/ent/v2/text2audio"
payload = {
"model": "audio1.0",
"prompt": "轻柔的钢琴曲"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'audio1.0', prompt: '轻柔的钢琴曲'})
};
fetch('https://api.maxapi.ai/ent/v2/text2audio', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.maxapi.ai/ent/v2/text2audio"
payload := strings.NewReader("{\n \"model\": \"audio1.0\",\n \"prompt\": \"轻柔的钢琴曲\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.maxapi.ai/ent/v2/text2audio")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"audio1.0\",\n \"prompt\": \"轻柔的钢琴曲\"\n}")
.asString();{
"task_id": "<string>",
"state": "pending",
"model": "<string>",
"prompt": "<string>",
"images": [
"<string>"
],
"duration": 123,
"seed": 123,
"resolution": "<string>",
"bgm": true,
"movement_amplitude": "<string>",
"payload": "<string>",
"off_peak": true,
"credits": 123,
"watermark": true,
"created_at": "2023-11-07T05:31:56Z"
}Authorizations
Body
application/json
Response
200 - application/json
Request succeeded.
Available options:
pending, queued, processing, success, failed