AI
Pass

Build an AI Invoice Generator with AI Pass SDK

Build an AI Invoice Generator with AI Pass SDK

Want to add invoice generation to your website or SaaS? AI Pass SDK lets you generate text with a few lines of JavaScript — no backend needed.

Your users pay for their own usage, and you earn 50% commission on every API call.

What You'll Build

An invoice generator where users input business details and get a formatted invoice. Users sign in, use the tool, pay as they go. You earn commission.

Prerequisites

  1. Create an AI Pass account at aipass.one
  2. Verify your email (required for commission payouts)
  3. Create an OAuth2 Client from Developer Dashboard → OAuth2 Clients
  4. Copy your Client ID — looks like client_XXXX (NOT your app slug!)

Core Code

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

async function generateInvoice(details) {
  const r = await AiPass.generateCompletion({
    model: 'gpt-5-mini',
    messages: [
      {
        role: 'system',
        content: 'You are a professional invoice generator. Create a complete, well-formatted invoice. Include: invoice number, date, from/to addresses, line items with quantities and rates, subtotal, tax, and total. Format it clearly with proper alignment.'
      },
      { role: 'user', content: details }
    ]
  });
  
  return r.choices[0].message.content;
}
</script>

Key Points

  • clientId comes from Developer Dashboard → OAuth2 Clients (NOT the app slug)
  • requireLogin: true shows the auth screen automatically
  • generateCompletion() returns r.choices[0].message.content
  • Users get $1 free credit on signup, then pay as they go

Deploy Your App

Option A: Self-Host — Host anywhere: your server, GitHub Pages, Netlify, Vercel. SDK handles auth and billing.

Option B: Publish on AI Pass — Get a shareable page with a </> embed button for iframe embedding.

Revenue Model

  • 50% commission on every API call — tracked via your OAuth2 Client ID
  • Valid verified email required for payouts

Try the Live App

AI Invoice Generator

Related: Invoice Generator Guide | Invoice Generator API Skill