AI
Pass

How to Build an AI Meme Video Generator with AI Pass SDK

How to Build an AI Meme Video Generator with AI Pass SDK

Video content is king on social platforms. In this tutorial, you'll build an AI Meme Video Generator that creates short, funny video clips from text descriptions. You earn 50% commission on every API call.

What You'll Build

A web app where users:

  1. Describe a meme concept
  2. Click generate
  3. Get a short AI-generated video clip to download

Step 1: Create Your AI Pass Account

  1. Go to aipass.one and sign up
  2. Verify your email (required for payouts)
  3. Open the Developer Dashboard

Step 2: Create an OAuth2 Client

  1. In the Developer Dashboard, go to OAuth2 Clients
  2. Click Create Client
  3. Copy your Client ID (looks like client_XXXX...)

Step 3: Build the App

Video generation is async — you start the job, poll for status, then download.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>AI Meme Video Generator</title>
  <link href="https://aipass.one/aipass-ui.css" rel="stylesheet">
  <style>
    body { font-family: sans-serif; max-width: 600px; margin: 40px auto; padding: 20px; }
    textarea { width: 100%; height: 100px; margin: 10px 0; font-size: 15px; }
    button { padding: 12px 24px; font-size: 16px; cursor: pointer; }
    #status { margin-top: 20px; padding: 15px; background: #f0f0f0; border-radius: 8px; display: none; }
    video { max-width: 100%; margin-top: 15px; border-radius: 8px; }
  </style>
</head>
<body>
  <h1>🎬 AI Meme Video Generator</h1>
  <p>Describe a funny meme concept and AI will generate a short video clip.</p>
  <textarea id="prompt" placeholder="A cat wearing a tiny business suit giving a TED talk about the importance of naps..."></textarea>
  <button onclick="generate()">🎬 Generate Video</button>
  <div id="status"></div>

  <script src="https://aipass.one/aipass-sdk.js"></script>
  <script>
    AiPass.initialize({
      clientId: 'YOUR_CLIENT_ID',
      requireLogin: true,
      darkMode: true
    });

    async function generate() {
      const prompt = document.getElementById('prompt').value;
      const statusDiv = document.getElementById('status');
      statusDiv.style.display = 'block';
      statusDiv.innerHTML = 'Starting video generation...';

      try {
        const result = await AiPass.generateVideo({
          model: 'gemini/veo-3.1-fast-generate-preview',
          prompt: prompt,
          seconds: 5
        });
        const videoId = result.videoId;
        statusDiv.innerHTML = 'Video generating... polling for status.';

        const poll = setInterval(async () => {
          try {
            const status = await AiPass.getVideoStatus(videoId);
            if (status.status === 'completed') {
              clearInterval(poll);
              statusDiv.innerHTML = '<p>Video ready!</p><video controls src="' + status.downloadUrl + '"></video><br><a href="' + status.downloadUrl + '" download>Download Video</a>';
            } else if (status.status === 'failed') {
              clearInterval(poll);
              statusDiv.innerHTML = 'Generation failed. Try a different prompt.';
            } else {
              statusDiv.innerHTML = 'Still generating... ' + status.status;
            }
          } catch (e) {
            statusDiv.innerHTML = 'Polling... ' + e.message;
          }
        }, 5000);
      } catch (e) {
        statusDiv.innerHTML = 'Error: ' + e.message;
      }
    }
  </script>
</body>
</html>

Step 4: Deploy

Option A: Self-host anywhere — GitHub Pages, Netlify, Vercel, your server.

Option B: Publish on AI Pass — dedicated page with </> embed button.

Key Details

  • AiPass.generateVideo() starts async video generation
  • AiPass.getVideoStatus(videoId) polls for completion
  • Video models: gemini/veo-3.1-fast-generate-preview (fast), openai/sora-2 (quality)
  • requireLogin: true — shows auth screen automatically
  • Users get $1 free credit on signup, then pay as you go
  • You earn 50% commission on every API call

Links