POST
/
api
/
v1
/
mp4
/
generate
Create Music Video
curl --request POST \
  --url https://api.kie.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": "DJ Electronic",
  "domainName": "music.example.com"
}'
{
  "code": 0,
  "msg": "",
  "data": {
    "taskId": ""
  }
}

Usage Guide

  • Use this endpoint to turn your audio tracks into visually appealing videos
  • Add artist attribution and branding to your music videos
  • Videos can be shared on social media or embedded in websites

Parameter Details

  • taskId identifies the original music generation task
  • audioId specifies which audio track to visualize when multiple variations exist
  • Optional author and domainName add customized branding to the video

Developer Notes

  • Generated video files are retained for 14 days
  • Videos are optimized for social media sharing
  • Processing time varies based on audio length and server load

Authorizations

Authorization
string
header
required

All APIs require authentication via Bearer Token.

Get API Key:

  1. Visit API Key Management Page to get your API Key

Usage: Add to request header: 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 in the management page

Body

application/json
taskId
string
required

Unique identifier of the music generation task. This should be a taskId returned from either the "Generate Music" or "Extend Music" endpoints.

Example:

"taskId_774b9aa0422f"

audioId
string
required

Unique identifier of the specific audio track to visualize. This ID is returned in the callback data after music generation completes.

Example:

"e231****-****-****-****-****8cadc7dc"

callBackUrl
string<uri>
required

The URL to receive music video generation task completion updates. Required for all music video generation requests.

  • System will POST task status and results to this URL when video generation completes
  • Callback includes the generated music video file URL with visual effects and branding
  • Your callback endpoint should accept POST requests with JSON payload containing the video file location
  • For detailed callback format and implementation guide, see Music Video Callbacks
  • Alternatively, use the Get Music Video Details endpoint to poll task status
Example:

"https://api.example.com/callback"

author
string

Artist or creator name to display as a signature on the video cover. Maximum 50 characters. This creates attribution for the music creator.

Maximum length: 50
Example:

"DJ Electronic"

domainName
string

Website or brand to display as a watermark at the bottom of the video. Maximum 50 characters. Useful for promotional branding or attribution.

Maximum length: 50
Example:

"music.example.com"

Response

Success

code
enum<integer>

Status code Response status code

  • 200: Success - Request has been processed successfully
  • 400: Format Error - The parameter is not in a valid JSON format
  • 401: Unauthorized - Authentication credentials are missing or invalid
  • 402: Insufficient Credits - Account does not have enough credits to perform the operation
  • 404: Not Found - The requested resource or endpoint does not exist
  • 409: Conflict - WAV record already exists
  • 422: Validation Error - The request parameters failed validation checks
  • 429: Rate Limited - Your call frequency is too high. Please try again later.
  • 455: Service Unavailable - System is currently undergoing maintenance
  • 500: Server Error - An unexpected error occurred while processing the request Build Failed - Audio mp4 generation failed
Available options:
200,
400,
401,
402,
404,
409,
422,
429,
455,
500
Example:

0

msg
string

Status message Error message when code != 200

Example:

"success"

data
object