AI
Pass

Build an AI Cold Email Generator App with the AI Pass SDK

Build an AI Cold Email Generator App with the AI Pass SDK

Cold email tools are evergreen B2B products with high perceived value. This tutorial shows you how to build one using the AI Pass SDK — a few hours of work, deployable anywhere, with a built-in monetization model.

Prerequisites

  1. Free account at aipass.one
  2. Developer Dashboard → OAuth2 Clients → get your Client ID
  3. Developer Dashboard

SDK Setup

<link href="https://aipass.one/aipass-ui.css" rel="stylesheet">
<script src="https://aipass.one/aipass-sdk.js"></script>

Initialize

AiPass.initialize({
  clientId: "YOUR_CLIENT_ID",
  requireLogin: true,
  darkMode: true
});

Generate Cold Emails

Always include temperature: 1 and max_tokens: 16000 for GPT-5 models:

const result = await AiPass.generateCompletion({
  model: "gpt-5-mini",
  temperature: 1,
  max_tokens: 16000,
  messages: [
    {
      role: "system",
      content: `You are an expert cold email copywriter. Write concise, personalized outreach emails.
Format your response as:
SUBJECT LINE OPTIONS (3 options)
---
EMAIL BODY
---
FOLLOW-UP LINE`
    },
    {
      role: "user",
      content: prompt
    }
  ]
});
const email = result.choices[0].message.content;

Complete Example

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>AI Cold Email Generator</title>
  <link href="https://aipass.one/aipass-ui.css" rel="stylesheet">
  <script src="https://aipass.one/aipass-sdk.js"></script>
  <style>
    body { font-family: system-ui; max-width: 760px; margin: 2rem auto; padding: 0 1rem; }
    label { display:block; margin-top:0.8rem; font-weight:600; font-size:0.9rem; color:#374151; }
    input, select, textarea { width:100%; padding:0.5rem; margin-top:0.25rem; border:1px solid #d1d5db; border-radius:6px; box-sizing:border-box; font-size:0.95rem; }
    textarea { height:80px; }
    button { margin-top:1rem; padding:0.65rem 1.5rem; background:#1d4ed8; color:#fff; border:none; border-radius:6px; cursor:pointer; font-size:1rem; font-weight:600; }
    .output { white-space:pre-wrap; background:#f9fafb; padding:1.25rem; border-radius:8px; margin-top:1rem; line-height:1.75; border:1px solid #e5e7eb; font-size:0.95rem; }
  </style>
</head>
<body>
  <h1>AI Cold Email Generator</h1>
  <p>Describe your offer and target — get a personalized cold email in seconds.</p>

  <label>Your product/service
    <input id="product" placeholder="e.g., AI-powered invoicing software for freelancers" />
  </label>
  <label>Target recipient (be specific)
    <input id="target" placeholder="e.g., freelance designers with 2-10 years experience" />
  </label>
  <label>Your ask
    <input id="ask" placeholder="e.g., 15-minute demo call this week" />
  </label>
  <label>Key value proposition
    <input id="value" placeholder="e.g., saves 3 hours/month on invoice chasing" />
  </label>
  <label>Tone
    <select id="tone">
      <option>Professional</option>
      <option>Casual & Direct</option>
      <option>Founder-to-Founder</option>
      <option>Consultative</option>
    </select>
  </label>

  <button id="generate">Generate Email</button>
  <p id="status"></p>
  <div class="output" id="output"></div>

  <script>
    AiPass.initialize({
      clientId: "YOUR_CLIENT_ID",
      requireLogin: true,
      darkMode: true
    });

    document.getElementById("generate").addEventListener("click", async () => {
      const product = document.getElementById("product").value;
      const target = document.getElementById("target").value;
      const ask = document.getElementById("ask").value;
      const value = document.getElementById("value").value;
      const tone = document.getElementById("tone").value;

      const prompt = `Write a cold outreach email with the following details:
Product/Service: ${product}
Target recipient: ${target}
Key value proposition: ${value}
Ask: ${ask}
Tone: ${tone}

Requirements:
- Subject line: 3 options, under 50 characters each
- Email body: under 150 words
- Clear, specific value prop in first sentence
- Strong call to action
- No generic openers like "I hope this email finds you well"`;

      document.getElementById("status").textContent = "Generating...";
      document.getElementById("output").textContent = "";

      try {
        const result = await AiPass.generateCompletion({
          model: "gpt-5-mini",
          temperature: 1,
          max_tokens: 16000,
          messages: [
            { role: "system", content: "You are an expert cold email copywriter. Write concise, personalized outreach emails that get responses. Format: SUBJECT LINE OPTIONS, then EMAIL BODY." },
            { role: "user", content: prompt }
          ]
        });
        document.getElementById("output").textContent = result.choices[0].message.content;
        document.getElementById("status").textContent = "Done!";
      } catch (err) {
        document.getElementById("status").textContent = "Error — see console.";
        console.error(err);
      }
    });
  </script>
</body>
</html>

Deployment Options

Option A — Self-host: GitHub Pages, Netlify, Vercel. No backend needed.

Option B — Publish on AI Pass: Get a dedicated page like the live example. Apps include a </> embed button for iframe sharing.

Revenue: 50% Commission

Earn 50% commission on every API call through your app. B2B users who run multiple variations per campaign add up fast.

Useful Links