Create Music Video
curl --request POST \
--url https://apibox.erweima.ai/api/v1/mp4/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"taskId": "taskId_774b9aa0422f",
"audioId": "e231****-****-****-****-****8cadc7dc",
"callBackUrl": "https://api.example.com/callback",
"author": "Suno Artist",
"domainName": "music.example.com"
}
'import requests
url = "https://apibox.erweima.ai/api/v1/mp4/generate"
payload = {
"taskId": "taskId_774b9aa0422f",
"audioId": "e231****-****-****-****-****8cadc7dc",
"callBackUrl": "https://api.example.com/callback",
"author": "Suno Artist",
"domainName": "music.example.com"
}
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({
taskId: 'taskId_774b9aa0422f',
audioId: 'e231****-****-****-****-****8cadc7dc',
callBackUrl: 'https://api.example.com/callback',
author: 'Suno Artist',
domainName: 'music.example.com'
})
};
fetch('https://apibox.erweima.ai/api/v1/mp4/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/mp4/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([
'taskId' => 'taskId_774b9aa0422f',
'audioId' => 'e231****-****-****-****-****8cadc7dc',
'callBackUrl' => 'https://api.example.com/callback',
'author' => 'Suno Artist',
'domainName' => 'music.example.com'
]),
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/mp4/generate"
payload := strings.NewReader("{\n \"taskId\": \"taskId_774b9aa0422f\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"callBackUrl\": \"https://api.example.com/callback\",\n \"author\": \"Suno Artist\",\n \"domainName\": \"music.example.com\"\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/mp4/generate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"taskId\": \"taskId_774b9aa0422f\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"callBackUrl\": \"https://api.example.com/callback\",\n \"author\": \"Suno Artist\",\n \"domainName\": \"music.example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apibox.erweima.ai/api/v1/mp4/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 \"taskId\": \"taskId_774b9aa0422f\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"callBackUrl\": \"https://api.example.com/callback\",\n \"author\": \"Suno Artist\",\n \"domainName\": \"music.example.com\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"taskId": "taskId_774b9aa0422f"
}
}Music Video Generation
Create Music Video
Generate an MP4 video with visualizations for a music track.
POST
/
api
/
v1
/
mp4
/
generate
Create Music Video
curl --request POST \
--url https://apibox.erweima.ai/api/v1/mp4/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"taskId": "taskId_774b9aa0422f",
"audioId": "e231****-****-****-****-****8cadc7dc",
"callBackUrl": "https://api.example.com/callback",
"author": "Suno Artist",
"domainName": "music.example.com"
}
'import requests
url = "https://apibox.erweima.ai/api/v1/mp4/generate"
payload = {
"taskId": "taskId_774b9aa0422f",
"audioId": "e231****-****-****-****-****8cadc7dc",
"callBackUrl": "https://api.example.com/callback",
"author": "Suno Artist",
"domainName": "music.example.com"
}
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({
taskId: 'taskId_774b9aa0422f',
audioId: 'e231****-****-****-****-****8cadc7dc',
callBackUrl: 'https://api.example.com/callback',
author: 'Suno Artist',
domainName: 'music.example.com'
})
};
fetch('https://apibox.erweima.ai/api/v1/mp4/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/mp4/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([
'taskId' => 'taskId_774b9aa0422f',
'audioId' => 'e231****-****-****-****-****8cadc7dc',
'callBackUrl' => 'https://api.example.com/callback',
'author' => 'Suno Artist',
'domainName' => 'music.example.com'
]),
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/mp4/generate"
payload := strings.NewReader("{\n \"taskId\": \"taskId_774b9aa0422f\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"callBackUrl\": \"https://api.example.com/callback\",\n \"author\": \"Suno Artist\",\n \"domainName\": \"music.example.com\"\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/mp4/generate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"taskId\": \"taskId_774b9aa0422f\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"callBackUrl\": \"https://api.example.com/callback\",\n \"author\": \"Suno Artist\",\n \"domainName\": \"music.example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apibox.erweima.ai/api/v1/mp4/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 \"taskId\": \"taskId_774b9aa0422f\",\n \"audioId\": \"e231****-****-****-****-****8cadc7dc\",\n \"callBackUrl\": \"https://api.example.com/callback\",\n \"author\": \"Suno Artist\",\n \"domainName\": \"music.example.com\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"taskId": "taskId_774b9aa0422f"
}
}Usage Guide
- This endpoint creates a visual representation of your music track as an MP4 video
- Both taskId and audioId are required to identify the specific track
- Optional author and domainName parameters can be used to add branding
Developer Notes
- Generated video files are retained for 15 days
- Videos include visual effects synchronized with the music
- This feature is ideal for social media sharing, music promotion, or creating visual content
- Videos maintain the same audio quality as the original track
Authorizations
🔑 API Authentication
All endpoints require authentication using Bearer Token.
Get API Key
- Visit the API Key Management Page to obtain your API Key
Usage
Add to request headers:
Authorization: Bearer YOUR_API_KEY
⚠️ Note:
- Keep your API Key secure and do not share it with others
- If you suspect your API Key has been compromised, reset it immediately from the management page
Body
application/json
The task ID of the music generation task.
- Required. This identifies the task containing the audio to be converted to video.
- Both
taskIdandaudioIdare needed to identify the exact track.
Example:
"taskId_774b9aa0422f"
The ID of the specific track to convert to video.
- Required. This identifies which specific track within the task to convert.
- Both
taskIdandaudioIdare needed to identify the exact track.
Example:
"e231****-****-****-****-****8cadc7dc"
The URL to receive video generation completion notification.
- Required.
- The callback will include a single downloadable URL for the generated MP4 video.
- For detailed callback format and implementation guide, see Music Video Generation Callbacks
- Alternatively, you can use the Get Music Video Details interface to poll task status
Example:
"https://api.example.com/callback"
The artist or creator name to display on the video.
- Optional.
- Will be shown prominently in the video, typically at the beginning.
- Maximum 50 characters.
Maximum string length:
50Example:
"Suno Artist"
The website or brand to display as watermark.
- Optional.
- Will appear as a subtle watermark at the bottom of the video.
- Maximum 50 characters.
Maximum string length:
50Example:
"music.example.com"
Callbacks
Response
Request successful
Status Codes
- ✅ 200 - Request successful
- ⚠️ 400 - Invalid parameters
- ⚠️ 401 - Unauthorized access
- ⚠️ 404 - Invalid request method or path
- ⚠️ 405 - Rate limit exceeded
- ⚠️ 409 - Conflict - Mp4 record already exists
- ⚠️ 413 - Theme or prompt too long
- ⚠️ 429 - Insufficient credits
- ⚠️ 430 - Your call frequency is too high. Please try again later.
- ⚠️ 455 - System maintenance
- ❌ 500 - Server error
Available options:
200, 400, 401, 404, 405, 409, 413, 429, 430, 455, 500 Error message when code != 200
Example:
"success"
Show child attributes
Show child attributes
