Getting Started

Overview

Momentize.ai detects high-value moments in AI conversations and serves relevant sponsored content blocks (SCBs). Monetize the Moments in your AI apps. The API is designed to be FTC-compliant, keeping sponsored content structurally separate from AI responses.

Key Features

  • • Real-time moment detection (purchase intent, comparisons, problems, etc.)
  • • FTC-compliant sponsored content blocks with clear disclosure
  • • Full event tracking for impressions, clicks, and conversions
  • • Analytics dashboard with CTR, revenue, and performance metrics
  • • Rate limiting and frequency capping built-in

Self-Hosted Setup

Get the Momentize.ai backend running locally in under 5 minutes using Docker.

Prerequisites

  • • Docker and Docker Compose installed
  • • Git for cloning the repository
  • • 4GB+ RAM available

Installation

Setup Commands
# Clone the repository
git clone https://github.com/momentizeai/api
cd momentize-backend

# Start the services
docker compose up -d

# Check health
curl http://localhost:8000/health

Success! Your API is now running at http://localhost:8000

Test Your Installation

Test Request
curl -X POST http://localhost:8000/v1/analyze \
  -H "Content-Type: application/json" \
  -d '{
    "conversation": [
      {
        "role": "user",
        "content": "I need help choosing between iPhone and Samsung"
      }
    ],
    "session_id": "test-session"
  }'

Basic Integration

Integrate Momentize.ai into your application with a few simple API calls.

JavaScript/TypeScript

JavaScript Integration
// Install the SDK
npm install momentize-sdk

// Initialize
import { Momentize } from 'momentize-sdk';

const momentize = new Momentize({
  apiKey: 'your-api-key',
  baseUrl: 'https://api.momentize.ai'
});

// Analyze conversation
const result = await momentize.analyze({
  conversation: messages,
  sessionId: 'unique-session-id'
});

// Display sponsored content
result.sponsored_content.forEach(ad => {
  displaySponsoredContent(ad);
});

// Track events
await momentize.trackEvent({
  eventType: 'impression',
  sessionId: 'unique-session-id',
  impressionId: ad.impression_id
});

Important Notes

  • • Always track impression events when displaying sponsored content
  • • Use unique session IDs to enable proper frequency capping
  • • Display the disclosure field prominently for FTC compliance

Understanding Moments

Momentize.ai detects 7 different types of high-value conversation moments:

Purchase Intent

User expressing intent to buy something

Keywords: "buy", "purchase", "looking for", "need", "shopping"

Comparison

User comparing products or services

Keywords: "vs", "versus", "better than", "compared to", "which one"

Problem

User reporting an issue that needs fixing

Keywords: "not working", "broken", "issue", "error", "help"

How To

User asking for instructions or tutorials

Keywords: "how to", "tutorial", "guide", "step by step"

Booking

User wanting to schedule or reserve

Keywords: "book", "reserve", "appointment", "schedule"

Location Need

User looking for local services

Keywords: "near me", "nearby", "location", "local"

Best Practices

FTC Compliance

  • • Always display the disclosure field prominently
  • • Keep sponsored content visually separate from AI responses
  • • Use clear labels like "Sponsored" or "Advertisement"
  • • Don't modify the disclosure text provided by the API

Performance Optimization

  • • Implement request caching for repeated conversations
  • • Use consistent session IDs for proper frequency capping
  • • Track all impression events for accurate analytics
  • • Monitor your rate limits and implement retries

User Experience

  • • Only show 1-2 sponsored content blocks per conversation
  • • Ensure sponsored content is relevant to detected moments
  • • Provide clear visual distinction from organic content
  • • Allow users to dismiss or hide sponsored content

Next Steps