Skip to content

API Overview

https://demo.xmosaic.ai

For Publishers: Monetize Your AI

Mosaic provides a Stripe-like API infrastructure that enables AI model providers to monetize their platforms through contextually relevant ads. Our API is designed specifically for publishers who want to generate revenue for their custom AI applications and/or models while maintaining a high-quality user experience.

Publisher Benefits

  • New Revenue Stream: Monetize each conversation in your AI model
  • Contextual Relevance: Only show ads that match the conversation topic and user context
  • Simple Integration: 2 lines of code to implement the Single API endpoint with minimal code required
  • No User Experience Impact: Ads aredesigned to complement, not interrupt the user experience
  • Provenance & Trust: C2PA-compliant ads provide verifiable authenticity and traceability, helping prevent tampering, fraud, and misinformation.

How It Works for Publishers

  • Fetch user context or Keywords
    Get the user context or keywords from the conversation

  • Call Mosaic API
    Send these to our /api/fetch-ads endpoint

  • Receive Relevant Ad
    Get back a contextually relevant ad in markdown format

  • Display to User
    Present the ad within your AI model's interface

  • Track Performance
    Track impressions and clicks for analytics and reporting

  • Receive Payments
    Receive payments automatically based on ad performance

Implementation Flow

sequenceDiagram
    participant User
    participant AI Model
    participant Mosaic API
    participant Advertiser

    User->>AI Model: Conversation
    AI Model->>AI Model: Fetch user context and keywords
    AI Model->>Mosaic API: Send user context and keywords
    Mosaic API->>Mosaic API: Match with campaigns
    Mosaic API->>AI Model: Return relevant ad
    AI Model->>User: Display ad
    User->>Mosaic API: Click ad (optional)
    Mosaic API->>Advertiser: Redirect to target URL
    Mosaic API->>AI Model: Record earnings

Current Implementation

The current implementation uses user context from the conversation and keywords to connect user conversations with relevant advertisements:

  • Keyword and User Context Extraction: Your AI identifies relevant keywords and user context from the conversation
  • Contextual Matching: Our system matches these keywords and user context with advertiser campaigns
  • Markdown Delivery: Ads are delivered in markdown format for easy display
  • Automatic Tracking: Impressions and clicks are tracked automatically

Future Enhancements

Future versions will evolve to more predictive ad serving using advanced AI techniques, including:

  • Semantic understanding of conversation context
  • User interest profiling (with privacy protections)
  • Dynamic ad format optimization
  • Advanced targeting and audience segmentation
  • Real-time bidding and auction systems
  • Performance optimization and analytics
  • Revenue optimization and reporting
  • Reall-time ad creation and management
  • Multi-Modal Ad Delivery

API Versioning

The current API version is v1.8. The version is not required in the URL path as this is the initial release. We follow semantic versioning principles:

Rate Limits & Performance

There are currently no strict rate limits implemented, but we recommend:

  • Implementing client-side caching where appropriate
  • Limiting requests to one per user conversation
  • Considering the user experience when displaying ads

Typical response times are under 100ms, ensuring minimal impact on your application's performance.