AI
Pass

Build an AI Summarizer App with AI Pass SDK

Build an AI Summarizer App with AI Pass SDK

Want to add text summarization to your app? Here's how to build one with the AI Pass SDK in under 30 minutes.

Prerequisites

Step 1: Create an OAuth2 Client

  1. Go to Developer Dashboard → OAuth2 Clients
  2. Click "Create Client"
  3. Copy your Client ID (starts with client_...) — you'll need this for SDK initialization

⚠️ The Client ID comes from the OAuth2 Clients page, NOT your app slug.

Step 2: Initialize the SDK

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

Setting requireLogin: true handles the entire auth flow automatically — login modal, token refresh, everything.

Step 3: Call the API

const response = await AiPass.generateCompletion({
  model: 'openai/gpt-4.1-mini',
  messages: [
    { role: 'system', content: 'Summarize the following text concisely.' },
    { role: 'user', content: userText }
  ]
});

const summary = response.choices[0].message.content;

Step 4: Add the AI Pass Button

Before </body>, add the boot script:

<script>
setTimeout(function(){
  var b = document.createElement("div");
  b.setAttribute("data-aipass-button", "");
  document.body.appendChild(b);
  if (window.AiPassUI) AiPassUI.reinit();
}, 200);
</script>

Earn Commission

As a developer, you earn 50% commission on all API usage through your app. Users pay per use, you earn per use. No monthly fees, no minimums.

Embed or Host

  • Embed on your site using the SDK on your own domain
  • Host on AI Pass using the </> embed button for instant distribution

Full Example

See the live app: AI Text Summarizer

SDK Reference: aipass.one/aipass-sdk.js