curl --request POST \
--url https://api.deapi.ai/api/v1/client/txt2music/price-calculation \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "AceStep_1_5_Turbo",
"duration": 30,
"inference_steps": 8
}
'import requests
url = "https://api.deapi.ai/api/v1/client/txt2music/price-calculation"
payload = {
"model": "AceStep_1_5_Turbo",
"duration": 30,
"inference_steps": 8
}
headers = {
"Accept": "<accept>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Accept: '<accept>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({model: 'AceStep_1_5_Turbo', duration: 30, inference_steps: 8})
};
fetch('https://api.deapi.ai/api/v1/client/txt2music/price-calculation', 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.deapi.ai/api/v1/client/txt2music/price-calculation",
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([
'model' => 'AceStep_1_5_Turbo',
'duration' => 30,
'inference_steps' => 8
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"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.deapi.ai/api/v1/client/txt2music/price-calculation"
payload := strings.NewReader("{\n \"model\": \"AceStep_1_5_Turbo\",\n \"duration\": 30,\n \"inference_steps\": 8\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "<accept>")
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.deapi.ai/api/v1/client/txt2music/price-calculation")
.header("Accept", "<accept>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"AceStep_1_5_Turbo\",\n \"duration\": 30,\n \"inference_steps\": 8\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deapi.ai/api/v1/client/txt2music/price-calculation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = '<accept>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"AceStep_1_5_Turbo\",\n \"duration\": 30,\n \"inference_steps\": 8\n}"
response = http.request(request)
puts response.read_body{
"data": {
"price": 0.25
}
}{
"data": {},
"message": "<string>",
"errors": [
"<unknown>"
],
"statusCode": 123
}{
"data": {},
"message": "<string>",
"errors": [
"<unknown>"
],
"statusCode": 123
}{
"message": "The selected model does not support Text To Image.",
"errors": {
"model": [
"The selected model does not support Text To Image."
]
}
}{
"message": "Too Many Attempts."
}Text-to-Music Price Calculation
Endpoint for calculating price for text2music inference. Requires duration and inference_steps parameters.
curl --request POST \
--url https://api.deapi.ai/api/v1/client/txt2music/price-calculation \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "AceStep_1_5_Turbo",
"duration": 30,
"inference_steps": 8
}
'import requests
url = "https://api.deapi.ai/api/v1/client/txt2music/price-calculation"
payload = {
"model": "AceStep_1_5_Turbo",
"duration": 30,
"inference_steps": 8
}
headers = {
"Accept": "<accept>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Accept: '<accept>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({model: 'AceStep_1_5_Turbo', duration: 30, inference_steps: 8})
};
fetch('https://api.deapi.ai/api/v1/client/txt2music/price-calculation', 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.deapi.ai/api/v1/client/txt2music/price-calculation",
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([
'model' => 'AceStep_1_5_Turbo',
'duration' => 30,
'inference_steps' => 8
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"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.deapi.ai/api/v1/client/txt2music/price-calculation"
payload := strings.NewReader("{\n \"model\": \"AceStep_1_5_Turbo\",\n \"duration\": 30,\n \"inference_steps\": 8\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "<accept>")
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.deapi.ai/api/v1/client/txt2music/price-calculation")
.header("Accept", "<accept>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"AceStep_1_5_Turbo\",\n \"duration\": 30,\n \"inference_steps\": 8\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deapi.ai/api/v1/client/txt2music/price-calculation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = '<accept>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"AceStep_1_5_Turbo\",\n \"duration\": 30,\n \"inference_steps\": 8\n}"
response = http.request(request)
puts response.read_body{
"data": {
"price": 0.25
}
}{
"data": {},
"message": "<string>",
"errors": [
"<unknown>"
],
"statusCode": 123
}{
"data": {},
"message": "<string>",
"errors": [
"<unknown>"
],
"statusCode": 123
}{
"message": "The selected model does not support Text To Image.",
"errors": {
"model": [
"The selected model does not support Text To Image."
]
}
}{
"message": "Too Many Attempts."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
application/json Body
Music generation parameters for price calculation.
The model to use for music generation. Available models can be retrieved via the GET /api/v1/client/models endpoint.
"AceStep_1_5_Turbo"
Duration in seconds. The accepted range is model-specific - read info.limits.min_duration / info.limits.max_duration for your model from the Model Selection endpoint; a value outside that range is rejected with 422. The turbo models accept 10-300, AceStep_1_5_Base 30-300.
30
Number of diffusion inference steps. The accepted range is model-specific - read info.limits.min_steps / info.limits.max_steps for your model from the Model Selection endpoint; a value outside that range is rejected with 422. The turbo models only accept 8; AceStep_1_5_Base accepts 5-100.
8
Response
Calculated price for text2music inference.
Show child attributes
Show child attributes
Was this page helpful?