PeakMVBETA
Developer Guide

How to Integrate Music to Video API in Your App

PMPeakMV TeamJanuary 4, 2026

Why Integrate Video Generation?

Audio platforms struggle with social sharing. You can't share an MP3 on TikTok or Instagram Reels. By integrating the PeakMV API, you allow your users to convert their tracks into shareable video assets directly within your UI, increasing retention and viral growth.

1. Prerequisites

  • PeakMV Account: Sign up at peakmv.com/login to access the dashboard.
  • API Key: Generate a Bearer token in your settings. Store this securely.
  • Audio File URL: A publicly accessible URL (MP3/WAV) for the API to fetch.

2. Submit a Job (Async)

Because 1080p rendering is GPU-intensive (taking 2-20 minutes), our API is asynchronous. First, you send a POST request to initiate the job.

submit_job.js
const response = await fetch('https://peakmv.com/api/v1/generate', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    audio_url: 'https://mysite.com/audio/track_01.mp3',
    video_quality: '1080p',
    prompt: 'Neon cyberpunk city, rain, cinematic lighting'
  })
});

const data = await response.json();
const { job_id, status_url } = data;
console.log('Job Started:', job_id);

3. Poll for Completion

Once started, you'll need to poll the status_url to check progress. We recommend polling every 5-10 seconds.

poll_status.js
async function checkStatus(statusUrl) {
  while (true) {
    const res = await fetch(statusUrl, {
      headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
    });
    const status = await res.json();

    if (status.state === 'completed') {
      return status.video_url; // 🎉 Video Ready!
    } else if (status.state === 'failed') {
      throw new Error('Generation Failed');
    }

    console.log('Rendering...');
    await new Promise(r => setTimeout(r, 5000)); // Wait 5s
  }
}

⚡ Best Practices

Rate Limiting

We enforce a strict 100 requests/minute limit. Implement exponential backoff if you hit 429 errors.

File Sizes

Max audio size is 70MB. Max duration is 300 seconds (5 mins).

Start Building Today

Get your API key and integrate AI music videos into your app in under an hour.

Get API Key