AI
Pass
All posts
tutorial

Build an AI Cover Letter Generator with AI Pass SDK

Build a full AI cover letter generator in minutes using AI Pass SDK. Handles auth automatically, supports tone customization. Deploy anywhere or earn 50% commission.

EiliyaMarch 14, 20263 min read

Build an AI Cover Letter Generator with AI Pass SDK

Job seekers are always looking for tools that give them an edge. A well-crafted AI cover letter generator can genuinely help people — and it's one of the easier apps to build with AI Pass SDK.

This guide walks you through building a complete cover letter generator from scratch.

What You'll Build

A web app where users:

  1. Paste the job description
  2. Enter their experience/skills
  3. Select tone (formal/professional/startup-friendly)
  4. Generate a tailored cover letter instantly

Setup

  1. Create an account at aipass.one
  2. Go to Developer Dashboard > OAuth2 Clients
  3. Create a client and copy your Client ID

The App

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>AI Cover Letter Generator</title>
  <script src="https://aipass.one/aipass-sdk.js"></script>
  <style>
    * { box-sizing: border-box; }
    body { font-family: -apple-system, sans-serif; max-width: 800px; margin: 40px auto; padding: 20px; color: #333; }
    h1 { font-size: 28px; margin-bottom: 4px; }
    .subtitle { color: #666; margin-bottom: 24px; }
    textarea { width: 100%; padding: 12px; font-size: 15px; border: 1px solid #ddd; border-radius: 8px; }
    label { display: block; font-weight: 600; margin: 16px 0 6px; }
    select { padding: 10px; font-size: 15px; border: 1px solid #ddd; border-radius: 8px; width: 200px; }
    button { margin-top: 16px; padding: 12px 28px; background: #6366f1; color: white; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; }
    button:hover { background: #4f46e5; }
    #output { margin-top: 24px; white-space: pre-wrap; background: #f9fafb; padding: 20px; border-radius: 8px; font-size: 15px; line-height: 1.7; border: 1px solid #e5e7eb; min-height: 60px; }
    .copy-btn { margin-top: 8px; padding: 8px 16px; background: #10b981; color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; }
  </style>
</head>
<body>
  <h1>✉️ AI Cover Letter Generator</h1>
  <p class="subtitle">Tailored cover letters in seconds. Powered by AI Pass.</p>

  <label>Job Description</label>
  <textarea id="jobDesc" rows="5" placeholder="Paste the full job posting here..."></textarea>

  <label>Your Experience and Skills</label>
  <textarea id="experience" rows="4" placeholder="Briefly describe your relevant experience, skills, and achievements..."></textarea>

  <label>Company Name (optional)</label>
  <textarea id="company" rows="1" placeholder="e.g. Google, Startup XYZ"></textarea>

  <label>Tone</label>
  <select id="tone">
    <option value="professional">Professional and Formal</option>
    <option value="conversational">Conversational and Warm</option>
    <option value="startup">Startup-Friendly (casual professional)</option>
  </select>

  <br>
  <button onclick="generateCoverLetter()">Generate Cover Letter</button>

  <div id="output">Your cover letter will appear here...</div>
  <button class="copy-btn" onclick="copyResult()" style="display:none" id="copyBtn">Copy to Clipboard</button>

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

    const toneInstructions = {
      professional: "Write in a formal, professional tone suitable for corporate roles.",
      conversational: "Write in a warm, conversational tone that still sounds professional.",
      startup: "Write in a casual-professional startup tone — confident, direct, and human."
    };

    async function generateCoverLetter() {
      const jobDesc = document.getElementById('jobDesc').value;
      const experience = document.getElementById('experience').value;
      const company = document.getElementById('company').value;
      const tone = document.getElementById('tone').value;
      const output = document.getElementById('output');

      if (!jobDesc || !experience) {
        alert('Please fill in the job description and your experience.');
        return;
      }

      output.textContent = 'Writing your cover letter...';
      document.getElementById('copyBtn').style.display = 'none';

      const systemPrompt = 'You are an expert cover letter writer. ' + toneInstructions[tone] +
        ' Write a compelling, tailored cover letter that opens with a strong hook (not "I am writing to express...").' +
        ' Match job requirements with specific experience. Show enthusiasm. End with a clear CTA.' +
        ' Keep it 3-4 paragraphs, under 350 words. Sound human and genuine.';

      const userPrompt = 'Job Description:\n' + jobDesc +
        '\n\nMy Experience and Skills:\n' + experience +
        (company ? '\n\nCompany: ' + company : '') +
        '\n\nWrite the cover letter now.';

      try {
        const r = await AiPass.generateCompletion({
          model: 'gpt-5-mini',
          temperature: 1,
          max_tokens: 16000,
          messages: [
            { role: 'system', content: systemPrompt },
            { role: 'user', content: userPrompt }
          ]
        });

        output.textContent = r.choices[0].message.content;
        document.getElementById('copyBtn').style.display = 'inline-block';
      } catch (err) {
        output.textContent = 'Error generating cover letter: ' + err.message;
      }
    }

    function copyResult() {
      navigator.clipboard.writeText(document.getElementById('output').textContent);
      document.getElementById('copyBtn').textContent = 'Copied!';
      setTimeout(function() { document.getElementById('copyBtn').textContent = 'Copy to Clipboard'; }, 2000);
    }
  </script>
</body>
</html>

Key SDK Notes

Always set these params when using GPT-5:

  • temperature: 1 — GPT-5 rejects the SDK default of 0.7
  • max_tokens: 16000 — GPT-5's reasoning mode eats tokens fast; low limits = empty output
  • Response: r.choices[0].message.content

Deploy and Earn

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

Option B: Submit to AI Pass catalog — get listed, earn 50% commission on every API call your users make.

Resources

Related apps