# Gravity - AI-Native Ad Platform

> Markdown mirror of DialtoneApp's public top-site detail page for `trygravity.ai`.

URL: https://dialtoneapp.com/top-sites/trygravity.ai/index.md
Canonical HTML: https://dialtoneapp.com/top-sites/trygravity.ai

## Summary

- Domain: `trygravity.ai`
- Website: https://trygravity.ai
- Description: callable surface | score 40 | purchase read only | control token required
- Label: callable_surface
- Payment surface: Not available
- Purchase boundary: read_only
- Control boundary: token_required
- Rank: 70747

## robots

~~~text
# Gravity Website - robots.txt
# https://www.trygravity.ai
#
# All crawlers welcome, including AI search bots
# (GPTBot, ChatGPT-User, ClaudeBot, PerplexityBot, Google-Extended, etc.)

User-agent: *
Allow: /
Disallow: /join
Disallow: /onboarding
Disallow: /dashboard
Disallow: /campaign/
Disallow: /login
Disallow: /signup
Disallow: /demo
Disallow: /ai-platforms/overview

Sitemap: https://www.trygravity.ai/sitemap.xml
~~~

## llms

~~~text
# Gravity

> Gravity is the AI-native advertising platform. It delivers contextual, high-intent sponsored suggestions inside AI conversations, creating a new ad channel for LLM platforms and advertisers.

## What Gravity Does

Gravity sits between AI platforms and advertisers. When a user asks an AI assistant a question with commercial intent, Gravity matches and delivers a relevant sponsored suggestion alongside the AI response. The ad feels native to the conversation, not interruptive.

- [Homepage](https://www.trygravity.ai/): Overview of Gravity's AI-native ad platform
- [About Us](https://www.trygravity.ai/about): Team, mission, and company background

## For AI Platforms

AI platforms integrate Gravity to monetize conversations without degrading user experience. Integration takes a few lines of code via server-side and client-side SDKs. Gravity handles ad matching, rendering, impression tracking, and payouts.

- [AI Platforms](https://www.trygravity.ai/ai-platforms): How Gravity works for AI platforms
- [Documentation](https://www.trygravity.ai/docs): Full integration guide
- [Quickstart](https://www.trygravity.ai/docs/quickstart): Get running in minutes with the SDK
- [Request Ads (Server SDK)](https://www.trygravity.ai/docs/request-ads): Server-side ad requests with Node.js or Python
- [Show Ads (Client SDK)](https://www.trygravity.ai/docs/show-ads): Render ads in your UI with React
- [In-App Pixel](https://www.trygravity.ai/docs/in-app-pixel): Conversion tracking and revenue attribution
- [Going Live](https://www.trygravity.ai/docs/going-live): Launch checklist for production
- [Payouts & Analytics](https://www.trygravity.ai/docs/payouts): Earnings dashboard and payout management

## For Advertisers

Advertisers use Gravity to reach high-intent users at the moment of decision inside AI conversations. Ads are native sponsored suggestions that drive action, not interruption.

- [Advertisers](https://www.trygravity.ai/advertisers): How Gravity works for advertisers
- [Brand Safety](https://www.trygravity.ai/brand-safety): How Gravity ensures brand safety in AI conversations

## Help Center

- [Getting Started](https://www.trygravity.ai/help/getting-started): Overview of what Gravity is, what it solves, and who it's for
- [For AI Platforms](https://www.trygravity.ai/help/ai-platforms): Integration options, controls, earnings, and analytics
- [For Advertisers](https://www.trygravity.ai/help/advertisers): Campaign setup, contextual matching, ad formats, and conversion tracking
- [SDK & API Reference](https://www.trygravity.ai/help/sdk): Available SDKs, authentication, and quick start guide
- [FAQ](https://www.trygravity.ai/help/faq): Common questions about latency, ad controls, spend minimums, attribution, ad formats, and supported surfaces

## Resources

- [Blog](https://www.trygravity.ai/blog): Insights on AI advertising and LLM monetization
- [Help Center](https://www.trygravity.ai/help): FAQs and support resources
- [Careers](https://www.trygravity.ai/careers): Open roles at Gravity
- [Contact](https://www.trygravity.ai/contact): Get in touch with the team

## Legal

- [Terms of Service](https://www.trygravity.ai/terms): Terms governing use of Gravity's services, SDKs, and APIs
- [Privacy Policy](https://www.trygravity.ai/privacy): How Gravity collects, uses, and shares information
- [Brand Safety Guidelines](https://www.trygravity.ai/brand-safety): Content standards, traffic quality, and AI environment standards

## Optional

- [llms-full.txt](https://www.trygravity.ai/llms-full.txt): All documentation in a single file
~~~

## llms-full

~~~text
# Gravity - Complete Documentation

> Gravity is the ad layer for LLMs. We place sponsored suggestions inside LLM conversations at moments of high intent.

---

# Overview

## What Gravity Is

Gravity is an AI-native ad platform that connects advertisers with high-intent moments inside LLM conversations. We insert high-intent sponsored suggestions directly into AI answers, designed to preserve trust and feel native to the conversation.

Think of it as the ad layer purpose-built for the conversational era: where users ask, compare, and decide inside AI chats instead of browsing feeds or clicking links.

## What Gravity Solves

Today's AI ecosystem has a missing economic layer. LLM conversations are where decisions now happen, but there is almost no structured way to fund them.

Gravity solves three fundamental problems:

- **Brands can't access high-intent moments inside LLM conversations.** Users ask "What's the best CRM?" or "Which hotel in Paris?", but advertisers have no structured channel to appear in those intent-rich decision points.
- **AI apps and agents have no sustainable monetization model.** Running LLMs is expensive. Most assistants, bots, and agents don't have a path to profitability. Gravity gives them a clean, native way to generate revenue without breaking UX.
- **Free AI isn't economically possible without an ad layer.** Just like search engines and social networks needed ads to become free and globally accessible, AI needs a native monetization layer. Gravity is that layer, the economic infrastructure that will fund the future of free AI.

## Who Gravity Is For

- **AI Platforms**: LLM apps, AI assistants, chatbots, and agents looking to monetize conversations without compromising UX.
- **Advertisers**: Brands and agencies wanting to reach users at the exact moment of high-intent decision-making.
- **Agents**: Autonomous AI agents that need a monetization layer while maintaining user trust.

---

# The Gravity Model

Gravity operates through a four-stage pipeline that runs in milliseconds, ensuring relevant suggestions appear naturally within the conversation flow.

## Intent Detection

Every prompt is analyzed for commercial intent signals. When a user asks "What's the best CRM for a small team?", Gravity recognizes this as a high-intent moment with purchase potential.

## Relevance Matching

Intent is mapped to relevant advertiser categories and specific offers. The system considers context, user signals, and advertiser targeting criteria to find the best matches.

## The Real-Time Auction

DSPs and direct advertisers bid in real-time for each opportunity. The auction considers bid price, relevance score, and quality factors to select the winning suggestion.

## Suggestion Rendering

Matched suggestions are sent to the AI platform, which displays them according to their chosen UX format. Each platform controls how suggestions appear to their users, ensuring native integration that matches their interface.

---

# Network Architecture

## Demand Sources

Gravity aggregates demand from multiple sources: DSPs via an OpenRTB 2.6-compatible endpoint, agency trading desks with managed service, and direct advertisers through our self-serve platform.

## Supply Surfaces

AI Platforms integrate Gravity into any LLM-powered surface: consumer chatbots, AI assistants, knowledge agents, search/chat hybrids, and autonomous agents.

## How Data Flows

```
Prompt → Intent Signal → Auction Request → Bid Response → Suggestion → Render
```

---

# What AI Platforms Get

## Monetization Without Breaking UX

Native suggestions that feel like helpful additions to the AI's response. No image banners, no interstitials, no UX degradation. Just relevant recommendations at the right moment.

## Control Panel

- Category blocklists
- Custom styling to match your UI

## Analytics

Example metrics from early integrations:

| Metric | Value |
|--------|-------|
| Low CPM | $6 |
| Mid CPM | $20 |
| High CPM | $150 |

## Use Cases

- Consumer Chatbots
- AI Assistants
- Knowledge Agents
- Search/Chat Hybrids
- AI Consumer Apps
- Productivity Tools & Copilots
- Developer Tools & IDEs
- Autonomous Agents

---

# API Reference

## REST API

### Quick Start

Get your first ad in seconds:

```bash
curl -X POST https://server.trygravity.ai/api/v1/ad \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      {"role": "user", "content": "Where can I buy marathon gear?"}
    ],
    "sessionId": "session-abc-123",
    "userId": "user-abc-123",
    "placements": [
      {"placement": "below_response", "placement_id": "main-ad-slot"}
    ],
    "testAd": true
  }'
```

Get your API key from the Gravity Dashboard at https://app.trygravity.ai/publisher/login

### Authentication

All requests require an API key in the `Authorization` header:

```
Authorization: Bearer YOUR_API_KEY
```

### Message Context

Include the user's current query and the previous assistant response (if available) for better ad matching.

**First Turn:**

```json
{
  "messages": [
    { "role": "user", "content": "Where can I buy marathon gear?" }
  ]
}
```

**Follow-up Turns:**

```json
{
  "messages": [
    { "role": "assistant", "content": "What's your budget?" },
    { "role": "user", "content": "Around $150 for good running shoes" }
  ]
}
```

### Request Reference

**Endpoint:** `POST https://server.trygravity.ai/api/v1/ad`

#### Request Fields

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `messages` | array | Yes | Conversation context. Array of {role, content} objects. |
| `sessionId` | string | Yes | Chat session identifier for frequency capping. |
| `userId` | string | Yes | Your platform's identifier for the end user. Enables per-user ad learning, cross-session frequency capping, and attribution. |
| `placements` | array | Yes | Array of placement objects (max 10). Number of ads returned = length of this array. |
| `testAd` | boolean | No | Returns a test ad with placeholder URLs. Use for testing. |
| `relevancy` | number | No | Minimum relevancy threshold (0.0-1.0). Higher = stricter matching. |
| `excludedTopics` | array | No | Topics or categories to exclude from ad matching (e.g., ["gambling", "alcohol"]). |
| `device` | object | No | Device and location information. |
| `user` | object | No | User information for identity matching and higher CPMs. |

**Placement Object:**

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `placement` | string | Yes | "above_response", "below_response", "inline_response", "left_response", "right_response", "search_result", "center_page", "top_page", "bottom_page", "left_page", "right_page" |
| `placement_id` | string | Yes | Tracking ID for this ad slot. Must be unique per request. |

**Device Object:**

| Field | Type | Description |
|-------|------|-------------|
| `ip` | string | IP address for geo-targeting. (required for geo-targeting) |
| `country` | string | ISO 3166-1 alpha-2 country code (e.g., "US", "GB"). If provided, takes precedence over IP-based geo lookup. |
| `os` | string | "macos", "windows", "linux", "iOS", "Android". |
| `timezone` | string | IANA timezone (e.g., "America/New_York"). |
| `locale` | string | Locale (e.g., "en-US"). |
| `language` | string | User's preferred language (e.g., "en"). |
| `ua` | string | User agent string. |
| `browser` | string | "chrome", "safari", "firefox", "edge". |
| `device_type` | string | "desktop", "mobile", "tablet". |
| `screen_width` | number | Screen width in pixels. |
| `screen_height` | number | Screen height in pixels. |
| `viewport_width` | number | Browser viewport width in pixels. |
| `viewport_height` | number | Browser viewport height in pixels. |

**User Object:**

| Field | Type | Description |
|-------|------|-------------|
| `email` | string | User's email address. |
| `phone` | string | User's phone number. |
| `gender` | string | User's gender for demographic targeting. "male", "female", "other". |
| `age` | string | User's age or age range (e.g., "25", "25-34", "18-24"). |
| `keywords` | string | Comma-separated keywords describing user interests or current context. |

Additional user properties can be included as extra fields: `id` (your internal user ID — enables cross-session identity linking), `timezone`, `subscription_tier` (e.g. "free", "pro", "enterprise"), `company`, `job_title`, `interests`, `company_size`.

**IDE Object (for IDE/CLI integrations):**

| Field | Type | Description |
|-------|------|-------------|
| `name` | string | "cursor", "vscode", "intellij" |
| `session_duration_ms` | number | Time since IDE opened. |
| `active_file_language` | string | Current file language. |

**Mobile Device Object (additional fields):**

| Field | Type | Description |
|-------|------|-------------|
| `os_version` | string | OS version (e.g., "17.2"). |
| `device_model` | string | Device model (e.g., "iPhone 15 Pro"). |
| `connection_type` | string | "wifi" or "cellular". |
| `ifa` | string | IDFA/GAID for attribution. Higher CPMs. |

**App Object (for mobile):**

| Field | Type | Description |
|-------|------|-------------|
| `version` | string | Your app version. |

#### Example Request (Web)

```json
{
  "messages": [
    { "role": "user", "content": "What are the best practices for React performance?" }
  ],
  "sessionId": "session-web-001",
  "userId": "user_abc123",
  "testAd": true,
  "placements": [
    { "placement": "right_response", "placement_id": "sidebar-1" }
  ],
  "user": {
    "id": "user_abc123",
    "email": "webuser@example.com",
    "subscription_tier": "pro"
  },
  "device": {
    "ip": "203.0.113.50",
    "os": "windows",
    "timezone": "Europe/London",
    "locale": "en-GB",
    "language": "en",
    "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0.0.0",
    "browser": "chrome",
    "device_type": "desktop",
    "screen_width": 1920,
    "screen_height": 1080,
    "viewport_width": 1680,
    "viewport_height": 900
  }
}
```

#### Example Request (IDE)

```json
{
  "messages": [
    { "role": "user", "content": "How do I set up authentication in my Express app?" }
  ],
  "sessionId": "session-ide-001",
  "userId": "dev_user_456",
  "testAd": true,
  "placements": [
    { "placement": "below_response", "placement_id": "code-assist-ad" }
  ],
  "user": {
    "id": "dev_user_456",
    "email": "developer@example.com",
    "subscription_tier": "pro"
  },
  "device": {
    "ip": "192.168.1.100",
    "os": "macos",
    "timezone": "America/New_York",
    "locale": "en-US",
    "language": "en",
    "screen_width": 2560,
    "screen_height": 1440
  },
  "ide": {
    "name": "cursor",
    "session_duration_ms": 3600000,
    "active_file_language": "typescript"
  }
}
```

### Response Reference

The response is an array of `Ad` objects (one per placement):

| Field | Type | Description |
|-------|------|-------------|
| `adText` | string | AI-generated ad copy tailored to the conversation. |
| `title` | string | Ad title / headline. |
| `cta` | string | Call-to-action text. |
| `brandName` | string | Advertiser's brand name. |
| `url` | string | Landing page URL (for display). |
| `favicon` | string | Brand favicon URL. Recommend a fallback for load errors. |
| `impUrl` | string | Impression tracking URL. Required for payment. |
| `clickUrl` | string | Click tracking URL. Use as the anchor href. |

#### Example Response

```json
[
  {
    "adText": "Looking for marathon gear? Check out Nike's latest collection...",
    "title": "Nike Running",
    "cta": "Shop Now",
    "brandName": "Nike",
    "url": "https://nike.com/running",
    "favicon": "https://nike.com/favicon.ico",
    "impUrl": "https://api.trygravity.ai/t/imp?p=eyJ...",
    "clickUrl": "https://api.trygravity.ai/t/click?p=eyJ..."
  }
]
```

### Getting Paid for Impressions

To receive credit for ad impressions, fire a `GET` request to `impUrl` when the ad is rendered. This is necessary for payment.

```bash
# Fire impression when ad is displayed
curl "https://api.trygravity.ai/t/imp?p=eyJ..."
```

For clicks, redirect users to `clickUrl`. The redirect handles attribution and forwards to the landing page.

### Response Codes

| Code | Description |
|------|-------------|
| 200 | Ad(s) matched and returned successfully. |
| 204 | No matching ads found (no body returned). This is normal. |
| 401 | Invalid or missing API key. |
| 422 | Validation error (e.g., missing sessionId, placements). |
| 429 | Rate limit exceeded. |

### Rate Limits

Default: 1,000 requests per second. Contact support for higher limits.

### Health Check

**Endpoint:** `GET https://server.trygravity.ai/health`

Public endpoint for load balancers and monitoring systems.

```json
{
  "status": "ok",
  "ready": true
}
```

### Migrating from v0

| Change | v0 | v1 |
|--------|----|----|
| Endpoint | `/ad` | `/api/v1/ad` |
| sessionId | Optional | Required |
| placements | Optional | Required (with placement_id) |
| Response format | Single ad or array | Always `Ad[]` array |
| Ad fields | cta field | brandName field |

The response is now always an array of `Ad` objects (one per placement). Update your code to access `response[0]` instead of treating the response as a single ad.

---

## API SDK (@gravity-ai/api)

The official Node.js/TypeScript SDK for the Gravity AI advertising API. Fetch contextually relevant ads based on conversation content.

npm: https://www.npmjs.com/package/@gravity-ai/api

### Installation

```bash
npm install @gravity-ai/api
```

Requires Node.js 18+

### Quick Start

```typescript
import { Client } from '@gravity-ai/api';

const client = new Client('your-api-key');

const response = await client.getAd({
  messages: [
    { role: 'user', content: 'What are some good hiking trails?' },
  ],
  sessionId: 'session-123',
  placements: [{ placement: 'below_response', placement_id: 'main-ad' }],
  testAd: true,
});

if (response) {
  const ad = response[0];
  console.log(ad.adText);
}
```

### Client Configuration

```typescript
import { Client } from '@gravity-ai/api';

// Basic
const client = new Client('your-api-key');

// Advanced
const client = new Client('your-api-key', {
  excludedTopics: ['politics', 'religion'],  // Global exclusions
  relevancy: 0.6,                            // Min relevancy threshold (0-1)
});
```

| Option | Type | Description |
|--------|------|-------------|
| `endpoint` | string | API endpoint URL. Default: `https://server.trygravity.ai` |
| `excludedTopics` | string[] | Topics to exclude from ad matching. |
| `relevancy` | number | Minimum relevancy score (0-1). |

### TypeScript Types

```typescript
interface Ad {
  adText: string;        // Ad copy text
  title: string;         // Ad title
  cta: string;           // Call-to-action text
  brandName: string;     // Brand name
  url: string;           // Landing page URL
  favicon: string;       // Favicon URL (recommend a fallback for load errors)
  impUrl: string;        // Impression tracking URL
  clickUrl: string;      // Click-through URL
}
```

Full TypeScript support with exported types:

```typescript
import { Client } from '@gravity-ai/api';
import type {
  AdParams,
  Ad,
  MessageObject,
  PlacementObject,
  DeviceObject,
  UserObject,
} from '@gravity-ai/api';
```

### Getting Paid for Impressions

```typescript
if (response) {
  const ad = response[0];

  // Fire impression when ad is displayed (required for payment)
  fetch(ad.impUrl);

  // Render ad with clickUrl as the link href
  // The redirect handles click attribution automatically
}
```

### Error Handling

The client returns `null` on failure. Errors are logged to console.

```typescript
const response = await client.getAd({
  messages,
  sessionId: 'session-123',
  placements: [{ placement: 'below_response', placement_id: 'main-ad' }]
});

// Returns null on:
// - Network errors
// - 401: Invalid API key
// - 422: Validation error
// - 204: No relevant ad found
// - 429: Rate limit exceeded

if (!response) {
  // Handle gracefully - don't break the user experience
}
```

### Using with React

```bash
npm install @gravity-ai/api @gravity-ai/react
```

```typescript
import { Client } from '@gravity-ai/api';
import { AdBanner } from '@gravity-ai/react';

const client = new Client('your-api-key');

function ChatApp() {
  const [ad, setAd] = useState(null);

  useEffect(() => {
    client.getAd({
      messages,
      sessionId: 'session-123',
      placements: [{ placement: 'below_response', placement_id: 'chat-ad' }],
      testAd: true,
    }).then(res => setAd(res?.[0] || null));
  }, [messages]);

  return <AdBanner ad={ad} theme="dark" />;
}
```

### Migrating from v0

- `sessionId` is now required
- `placements` array is now required (with `placement_id` for each placement)
- The response is now always an `Ad[]` array

```typescript
// Before (v0)
const ad = await client.getAd({ messages });

// After (v1)
const response = await client.getAd({
  messages,
  sessionId: 'session-123',
  placements: [{ placement: 'below_response', placement_id: 'main-ad-slot' }]
});
const ad = response?.[0];
```

---

## React SDK (@gravity-ai/react)

React components for rendering Gravity AI advertisements with automatic impression and click tracking.

npm: https://www.npmjs.com/package/@gravity-ai/react

### Installation

```bash
npm install @gravity-ai/react
```

Peer dependency: React 17+

### Quick Start

```typescript
import { Client } from '@gravity-ai/api';
import { AdBanner } from '@gravity-ai/react';
import { useEffect, useState } from 'react';

const client = new Client('your-api-key');

function ChatMessage({ messages }) {
  const [ad, setAd] = useState(null);

  useEffect(() => {
    client.getAd({
      messages,
      sessionId: 'session-123',
      placements: [{ placement: 'below_response', placement_id: 'main-ad-slot' }],
      testAd: true,
    }).then(res => setAd(res?.[0] || null));
  }, [messages]);

  return (
    <div>
      {/* Your chat content */}
      <AdBanner ad={ad} theme="dark" size="medium" />
    </div>
  );
}
```

### AdBanner Component

A fully-styled, customizable ad banner component.

```typescript
import { AdBanner } from '@gravity-ai/react';

<AdBanner
  ad={ad}                // Takes a single ad object (e.g., response[0])
  theme="dark"           // 'light' | 'dark' | 'minimal' | 'branded'
  size="medium"          // 'small' | 'medium' | 'large' | 'responsive'
  showLabel={true}       // Show "Sponsored" label
  labelText="Ad"         // Custom label text
  openInNewTab={true}    // Open click URL in new tab
  onImpression={() => console.log('Impression tracked')}
  onClickTracked={() => console.log('Click tracked')}
/>
```

**AdBanner Props:**

| Prop | Type | Description |
|------|------|-------------|
| `ad` | Ad \| null | Required. A single ad object (e.g., response[0]). |
| `theme` | string | 'light' \| 'dark' \| 'minimal' \| 'branded'. Default: 'light'. |
| `size` | string | 'small' \| 'medium' \| 'large' \| 'responsive'. Default: 'medium'. |
| `className` | string | Custom class name for container. |
| `style` | CSSProperties | Custom inline styles. |
| `showLabel` | boolean | Show "Sponsored" label. Default: true. |
| `labelText` | string | Custom label text. Default: "Sponsored". |
| `fallback` | ReactNode | Content when ad is null. |
| `openInNewTab` | boolean | Open link in new tab. Default: true. |
| `backgroundColor` | string | Custom background (overrides theme). |
| `textColor` | string | Custom text color (overrides theme). |
| `accentColor` | string | Custom accent color. |
| `borderRadius` | number \| string | Custom border radius. |
| `disableImpressionTracking` | boolean | Disable auto impression tracking. |
| `onClick` | () => void | Custom click handler. |
| `onImpression` | () => void | Callback when impression fires. |
| `onClickTracked` | () => void | Callback when click is tracked. |

### AdText Component

A minimal text-only component for full styling control.

```typescript
import { AdText } from '@gravity-ai/react';

<AdText
  ad={ad}
  className="my-custom-class"
  style={{ color: 'blue' }}
/>
```

**AdText Props:**

| Prop | Type | Description |
|------|------|-------------|
| `ad` | Ad \| null | Required. A single ad object (e.g., response[0]). |
| `className` | string | Custom class name. |
| `style` | CSSProperties | Custom inline styles. |
| `fallback` | ReactNode | Content when ad is null. |
| `openInNewTab` | boolean | Open link in new tab. Default: true. |
| `disableImpressionTracking` | boolean | Disable auto tracking. |
| `onClick` | () => void | Custom click handler. |
| `onImpression` | () => void | Callback on impression. |
| `onClickTracked` | () => void | Callback on click. |

### useAdTracking Hook

For building custom ad components with automatic tracking.

```typescript
import { useAdTracking } from '@gravity-ai/react';

function CustomAdComponent({ ad }) {
  const { handleClick } = useAdTracking({
    ad,
    onImpression: () => console.log('Viewed'),
    onClickTracked: () => console.log('Clicked'),
  });

  return (
    <a href={ad.clickUrl} onClick={handleClick}>
      {ad.adText}
    </a>
  );
}
```

### Getting Paid for Impressions

The `AdBanner` and `AdText` components automatically fire the impression URL when rendered. No extra code needed.

For custom components, use the `useAdTracking` hook to handle tracking automatically.

Use the `onImpression` callback to run code when the impression fires, or `disableImpressionTracking` if you need manual control.

### Theming

**Dark Theme:**

```typescript
<AdBanner ad={ad} theme="dark" />
```

**Custom Colors:**

```typescript
<AdBanner
  ad={ad}
  backgroundColor="#1e1b4b"
  textColor="#e0e7ff"
  accentColor="#818cf8"
/>
```

**Minimal (Inherit Parent Styles):**

```typescript
<AdBanner ad={ad} theme="minimal" showLabel={false} />
```

### TypeScript

Full TypeScript support with exported types:

```typescript
import type { Ad, AdBannerProps, AdTheme, AdSize } from '@gravity-ai/react';
```

### Migrating from v0

- The `ad` prop now expects a single ad object from `response[0]`
- Use `sessionId` and `placements` when fetching ads with `@gravity-ai/api`
- The response is now always an `Ad[]` array

```typescript
// Before (v0)
const ad = await client.getAd({ messages });
<AdBanner ad={ad} />

// After (v1)
const response = await client.getAd({
  messages,
  sessionId: 'session-123',
  placements: [{ placement: 'below_response', placement_id: 'main-ad-slot' }]
});
<AdBanner ad={response?.[0]} />
```

### React Sandbox

Preview how ads will appear in your UI before going live. Test different configurations, themes, and placement options in our interactive playground.

https://react-sandbox.trygravity.ai/

---

# What Advertisers Get

## Access to High-Intent Conversations

Reach users at the exact moment they're asking, comparing, and deciding. Not after they've made up their mind, during the decision itself.

## Campaign Objectives

Choose from three campaign objectives based on your goals:

- **Clicks**: Drive traffic to your website
- **Reach**: Maximize impressions and brand awareness
- **Conversions**: Optimize for specific conversion actions

## Campaign Setup

- **Campaign Name**: Give your campaign a descriptive name
- **Daily Budget**: Set your daily spend limit in dollars
- **Landing Page URL**: Where users go when they click
- **Start/End Dates**: Schedule your campaign with optional end date

## Targeting & Demographics

- **Location Targeting**: Select specific countries and regions for your target audience
- **UTM Parameters**: Automatic UTM tracking (utm_source=gravity, utm_medium=ai_suggestion)

## Creative Formats

Text-only native suggestions that fit naturally in AI conversations. Choose from two formats:

- **Sponsored Block**: A dedicated suggestion card with your brand name, value proposition, and "Learn more" CTA
- **Inline Hyperlink**: A subtle inline mention that links directly to your landing page

Both formats include clear "Sponsored" labeling and are previewed in mobile and desktop views before launch.

## Conversion Tracking & Events Manager

- **Pixel Setup**: Install our tracking pixel with support for HTML, Shopify, React, Next.js, Wordpress, Webflow, and Framer
- **Conversion Types**: Track purchases, sign-ups, and custom events
- **Integrations**: Connect with Calendly, Shopify, or use our API for custom tracking
- **Live Testing**: Verify your pixel installation with real-time event testing

## Performance Measurement

Advertisers get access to comprehensive real-time analytics including:

- CPC (Cost Per Click)
- CPM (Cost Per Mille)
- CTR (Click-Through Rate)
- Clicks
- Impressions
- Revenue
- Conversion Rate
- ROAS (Return on Ad Spend)

---

# Rendering the Experience

## Anatomy of a Suggestion

A sponsored suggestion appears as a native card within the AI response, containing:
- "Sponsored" label
- Brand name
- Description text
- Call-to-action link (e.g., "Learn more")

## Inline vs Below-the-Fold

AI Platforms choose where suggestions appear: inline within the response, or below-the-fold after the main answer. Both maintain the native feel.

## Interaction Model

Click leads to landing page. Simple. No complex flows, no multi-step journeys. The suggestion is the ad unit. Clicking it takes users directly to the advertiser.

## UX Safety Patterns

- Clear "Sponsored" labeling
- Fits the platform's UX

---

# Advertiser Integrations

## Campaign Setup

Create a new campaign by configuring these settings:

- **Campaign Name**: A descriptive name for your campaign
- **Daily Budget**: Set your spending limit per day
- **Landing Page URL**: Where users go when they click
- **Start/End Dates**: Schedule your campaign timing
- **Campaign Objective**: Clicks, Reach, or Conversions

## Conversion Configuration

- **Conversion Type**: Purchase, Sign Up, Lead, or custom
- **UTM Parameters**: Automatically appended (utm_source=gravity, utm_medium=ai_suggestion)
- **Preview URL**: See exactly how your tracking URL will look

## Demographics & Targeting

- **Locations**: Target specific countries, regions, or cities
- **Intent Categories**: Reach users based on what they're asking about

## Events Manager

Set up tracking and monitor events from your campaigns:

1. **Setup Your Pixel**: Copy and paste the tracking code into your website's header. Supported platforms: HTML, Shopify, React, Next.js, Wordpress, Webflow, Framer.
2. **Test Your Pixel**: Verify the pixel is installed correctly and view detected domains.
3. **Conversion Tracking**: Connect integrations (Calendly, Shopify) or use the API to track conversions.

## Ad Preview

Preview exactly how your ad will appear before launching. Ads are generated on the fly based on the user's question, always relevant and contextual.

- **Sponsored Block**: Full suggestion with brand, description, and CTA
- **Inline Hyperlink**: Subtle inline mention within the response
- **Mobile & Desktop**: Preview both views before launch

---

# Privacy & Safety

## Traffic Quality

All impressions must originate from genuine human engagement. The following practices are prohibited:

- Generating impressions through automated tools, bots, crawlers, or scripts
- Incentivizing ad views or interactions with monetary rewards, points, or other compensation
- Creating impressions through browser hijacking, auto-launching, or background ad loading
- Refreshing ad placements more frequently than every 30 seconds without direct user action
- Any scheme designed to artificially inflate impression counts, clicks, or engagement metrics

Applications must not inject ads into third-party content or manipulate how ads appear within other platforms' properties.

## Content Standards

The following content categories are incompatible with advertising through the Gravity platform.

### Prohibited Categories

- Adult, sexually explicit, or obscene material
- Unlicensed gambling operations
- Extreme violence or gore
- Content promoting discrimination or hate
- Targeted harassment or intimidation
- Deliberately false or misleading information
- Controlled substances and drug paraphernalia
- Piracy-enabling platforms and tools
- Hacking tools and exploitation services
- Counterfeit or illegally obtained merchandise
- Incentivized engagement or click farms
- Malicious software distribution
- Deceptive redirects or navigation hijacking
- Intrusive ad formats (pop-ups, pop-unders)
- Non-consensual synthetic media (deepfakes)
- Impersonation or source misattribution

### Categories Requiring Approval

The following categories may be permitted with explicit Gravity authorization:

- Weapons and related accessories
- Pharmaceutical products
- Alcoholic beverages
- Tobacco and nicotine products
- Digital assets and speculative investments
- Political campaigns and issue advocacy
- Matchmaking and dating platforms

---

# Performance & Measurement

## AI Platform Metrics

- **Impressions**: Total suggestion views
- **Clicks**: Total clicks on suggestions
- **CPM**: Cost per 1,000 impressions
- **CTR**: Click-through rate
- **CPC**: Cost per click
- **Revenue**: Total revenue generated
- **Conv%**: Conversion rate

## Advertiser Metrics

- **Impressions**: Total suggestion views
- **Clicks**: Total clicks on suggestions
- **CPM**: Cost per 1,000 impressions
- **CTR**: Click-through rate
- **CPC**: Cost per click
- **Revenue**: Total revenue generated
- **Conv%**: Conversion rate
- **ROAS**: Return on ad spend

---

# Example Implementations

## Chat App Example

A consumer chatbot integrating Gravity to monetize product recommendation queries. Suggestions appear inline when users ask about products, services, or comparisons.

## Agent Example

An autonomous shopping agent that uses Gravity to surface relevant offers while helping users find the best deals. Revenue funds the agent's operation.

## Enterprise Assistant

A B2B knowledge assistant that monetizes vendor recommendation queries. When employees ask about tools or services, relevant enterprise solutions appear.

## Vertical Examples

- Fintech
- SaaS
- Travel
- E-commerce
- Healthcare

---

# Help Center

## Getting Started

### What is Gravity?

Gravity is the ad layer for LLM's. We place sponsored suggestions inside LLM conversations at moments of high intent.

### What problem does it solve?

- Traditional ads don't translate to AI-native interfaces.
- Brands want to reach users inside AI conversations.
- Gravity connects both without breaking the user experience.

### Who is it for?

- **AI Platforms**: Consumer Chatbots, Search/Chat hybrids, AI Consumer Apps and many more. (Any LLM Surface)
- **Advertisers**: Brands that want to reach users in these LLM Surfaces

## For AI Platforms

### How it works

When users interact with your AI, Gravity can surface relevant sponsored suggestions inside responses. You monetize your conversational traffic automatically.

### Integration options

- **React SDK** (@gravity-ai/react): Best for React / Next.js apps - https://www.npmjs.com/package/@gravity-ai/react
- **JavaScript SDK** (@gravity-ai/api): Flexible client for web apps - https://www.npmjs.com/package/@gravity-ai/api
- **REST API**: For any platform or custom stack - https://docs.trygravity.ai/

### What you control

- **Blocked categories**: Exclude entire verticals or specific advertiser types
- **Traffic you send to Gravity**: Decide which conversations or surfaces are eligible
- **Suggestion behavior & presentation**: Styling, placement, and UX to match your product

### Earnings

Typical ranges vary by surface, category, and user intent:

- Low: ~$6 CPM
- Mid: ~$20 CPM
- High-intent moments: up to ~$150+ CPM

### Analytics

Track everything in real time: Impressions, Clicks, CTR, Revenue, CPM & CPC. All visible in your dashboard.

## For Advertisers

### How it works

Your ads appear as sponsored suggestions inside AI responses when relevant to the conversation.

### Campaign setup

- Set a campaign name and daily budget
- Add your website URL
- Choose start and end dates
- Select your objective: Clicks, Reach, or Conversions
- Location filtering (countries / regions)

### Contextual matching

Ads are matched to AI conversations based on real-time context and topic -- no keywords required.

### Ad formats

- **Sponsored Block**: A branded card with name, description, and link
- **Inline Hyperlink**: A subtle, in-line mention within the AI response

### Conversion tracking

Install the Gravity tracking pixel (HTML, Shopify, React, and more).

Automatic event tracking: Page views, Clicks, Leads, Add to cart, Purchases.

Automatic UTM parameters on outbound traffic. Native integrations with Shopify, Calendly, and more.

## SDK & API Reference

### Available SDKs

- **@gravity-ai/react**: React SDK - https://www.npmjs.com/package/@gravity-ai/react
- **@gravity-ai/api**: API SDK (JS/TS) - https://www.npmjs.com/package/@gravity-ai/api
- **REST API**: Direct HTTP access - https://docs.trygravity.ai/

### Authentication

All requests require a Publisher API key in the Authorization header:

```
Authorization: Bearer YOUR_API_KEY
```

Get your API key from the Gravity Dashboard.

### Quick start (REST API)

```bash
curl -X POST https://server.trygravity.ai/api/v1/ad \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [{"role": "user", "content": "What CRM should I use?"}],
    "sessionId": "session-123",
    "userId": "user-123",
    "placements": [{"placement": "below_response", "placement_id": "main-ad"}]
  }'
```

## FAQ

**How does Gravity affect my app's latency?**
Less than ~600ms. Sponsored suggestions are fetched in parallel with the AI response and continue to improve as the system is optimized.

**Can I control which ads appear?**
Yes. You can block specific categories or advertisers using blocklists in your dashboard.

**What's the minimum ad spend?**
There is no minimum. Start with any daily budget.

**How is attribution handled?**
Click-based attribution. Gravity tracks clicks with automatic UTM parameters. Optional pixel tracking enables downstream event measurement.

**What ad formats are available?**
Sponsored Block -- a branded card with description and link. Inline Hyperlink -- a subtle text mention within the AI response.

**Which AI surfaces does Gravity support?**
Any AI product that generates responses. Gravity integrates at the response layer and is compatible with custom LLM stacks, hosted APIs, and agent-based systems.

---

# Terms of Service

Effective Date: January 1, 2025

These Terms of Service (the "Terms") govern your access to and use of the services, software development kits (SDKs), application programming interfaces (APIs), websites, and related offerings provided by Iris Technologies (collectively, the "Services"). By accessing or using the Services, you agree to be bound by these Terms.

## 1. Eligibility; Accounts

You must be at least 18 years old and have the legal capacity to enter into a contract to use the Services. You are responsible for the accuracy of account information and for maintaining the confidentiality of your credentials and access tokens.

## 2. Definitions

"Publisher" means an entity that integrates the Services into its properties to render ads. "Advertiser" or "Demand Partner" means an entity that provides bids, creatives, or demand for ad placements. "End Users" means individuals who interact with a Publisher's property where ads are served. "Signals" means device, contextual, and interaction data used for ad delivery, measurement, and fraud prevention.

## 3. License and Acceptable Use

Subject to your compliance with these Terms, Iris Technologies grants you a limited, non-exclusive, non-transferable, revocable license to integrate and use our SDKs and APIs to enable native advertising experiences within your applications. You will not:

- (a) reverse engineer, decompile, or otherwise attempt to derive source code or underlying ideas;
- (b) circumvent or disable any security or technical controls;
- (c) use the Services to violate any applicable law, industry code, or third-party right;
- (d) transmit malware, malicious code, or harmful content;
- (e) publish deceptive, misleading, or fraudulent content;
- (f) engage in activity that interferes with or degrades the Services;
- (g) exceed any documented rate limits; or
- (h) use the Services to build a competing product.

## 4. Integration; Implementation Requirements

You must implement the Services in accordance with our documentation, including applicable privacy, consent, and brand-safety controls. We may throttle, suspend, or terminate access for non-compliant implementations.

## 5. Advertiser and Publisher Responsibilities

Publishers are responsible for obtaining and maintaining legally required notices, disclosures, and user consents. Advertisers are responsible for the lawfulness, accuracy, and quality of their bids and creatives.

## 6. Data; Signals; Measurement

You acknowledge and agree that the Services may collect, process, and use device and contextual Signals to enable ad delivery, measurement, optimization, security, and fraud prevention.

## 7. Ownership; Usage Data; Feedback

Iris Technologies and its licensors own all right, title, and interest in and to the Services and associated intellectual property.

## 8. Fees; Taxes

Fees (if any) are as stated in an order form or dashboard and are non-refundable unless required by law.

## 9. Confidentiality

"Confidential Information" means non-public information disclosed by one party to the other that is designated as confidential or should reasonably be understood to be confidential.

## 10. Privacy; Data Protection

Your use of the Services is subject to our Privacy Policy. Where required by law, we will make available a data processing addendum (DPA).

## 11. Third-Party Services

The Services may interoperate with or link to third-party exchanges, demand sources, analytics, anti-fraud tools, and cloud providers.

## 12. Security; Acceptable Testing

We maintain administrative, technical, and organizational measures designed to protect the Services.

## 13. Warranties; Disclaimers

THE SERVICES ARE PROVIDED "AS IS" AND "AS AVAILABLE." IRIS TECHNOLOGIES DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED.

## 14. Limitation of Liability

IRIS TECHNOLOGIES WILL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, COVER, OR PUNITIVE DAMAGES. AGGREGATE LIABILITY WILL NOT EXCEED THE AMOUNTS PAID IN THE TWELVE (12) MONTHS PRECEDING THE EVENT.

## 15. Indemnification

You will defend, indemnify, and hold harmless Iris Technologies from claims arising out of your content, use of the Services, breach of Terms, or violation of laws.

## 16. Suspension; Termination

We may suspend or terminate your access immediately if you breach these Terms.

## 17. Export; Sanctions; Anti-Corruption

You represent and warrant that you are not subject to sanctions and will comply with all applicable export control, sanctions, and anti-corruption laws.

## 18. Government End Users

The Services are "commercial items" as defined in 48 C.F.R. section 2.101.

## 19. Publicity; Marks

We may identify you as a customer unless you notify us in writing to the contrary.

## 20. Force Majeure

Neither party will be liable for delays or failures due to causes beyond its reasonable control.

## 21. Governing Law; Dispute Resolution

These Terms are governed by the laws of the State of Delaware. Any dispute will be resolved through binding arbitration under the rules of the American Arbitration Association.

## 22. Changes to the Services or Terms

We may modify the Services and these Terms from time to time. Continued use constitutes acceptance.

## 23. General

These Terms constitute the entire agreement between you and Iris Technologies regarding the Services.

**Contact:** support@trygravity.ai

---

# Privacy Policy

Effective Date: January 1, 2025

This Privacy Policy explains how Iris Technologies ("Iris", "we", "us") collects, uses, and shares information when you access our websites, SDKs, APIs, and related services.

## 1. Information We Collect

- **Device and Network:** IP address, user-agent, operating system, device type, browser type, language, timezone, network provider, and connection metadata.
- **Identifiers:** Advertising identifiers (e.g., AAID/IDFA where permitted), pseudonymous identifiers, and internal IDs.
- **Contextual Signals:** Page or conversation-level context, keywords, categories, and other non-personal signals.
- **Interaction and Performance:** Ad requests, impressions, clicks, conversions, viewability, scroll and visibility metrics.
- **Location:** Approximate geolocation derived from IP address or system signals.

## 2. How We Use Information

- Serve, manage, and optimize native ad experiences in LLM environments
- Measure performance, attribution, and reach across campaigns and inventory
- Detect, prevent, and investigate ad fraud, invalid traffic, and abuse
- Provide reporting, analytics, and billing to publishers and advertisers
- Comply with legal obligations and enforce our terms and policies
- Improve our Services, including testing, research, and product development

## 3. Legal Bases

Processing is based on consent, legitimate interests, performance of a contract, and/or compliance with legal obligations.

## 4. Controllers and Processors

Iris Technologies may act as a controller or as a processor/service provider on behalf of publishers and advertisers.

## 5. Data Sharing

We may share information with trusted partners: demand partners, exchanges, measurement providers, anti-fraud vendors, and cloud service providers.

## 6. Data Retention

We retain information for as long as necessary to fulfill the purposes described in this Policy.

## 7. Security

We employ administrative, technical, and organizational safeguards.

## 8. Your Choices

You may have rights to opt out of interest-based advertising, access or delete certain information, and manage consent settings.

## 9. International Transfers

We may transfer information to countries other than your own, including the United States.

## 10. Children

Our Services are not directed to children.

## 11. Changes to This Policy

We may update this Privacy Policy from time to time.

## 12. Contact

privacy@trygravity.ai or support@trygravity.ai

---

# Brand Safety Guidelines

Last Updated: December 1, 2025

## Description

Gravity is committed to fostering a trustworthy advertising ecosystem within AI-powered environments. These Brand Safety Guidelines establish the standards for all sellers who participate in the Gravity marketplace.

## Application

These Guidelines govern all advertising inventory transacted through Gravity, with particular emphasis on AI-native environments such as conversational interfaces, intelligent assistants, chatbots, and similar LLM-integrated applications.

## Legal Compliance

### Regulatory Adherence
All inventory must comply with applicable laws, regulations, and industry standards in every jurisdiction where ads are served.

### Sanctions and Government Designations
Inventory from entities subject to government sanctions or officially identified as sources of disinformation is not permitted.

### User Consent and Data Practices
Publishers must implement appropriate notice and consent mechanisms as required by applicable privacy regulations.

### Special Category Data (GDPR/UK GDPR)
For EEA/Switzerland/UK inventory, ad requests must not include special category personal data as defined under GDPR Article 9(1).

### User Identification
Ad requests must not contain directly identifying information. Only anonymized, pseudonymized, or user-resettable identifiers are acceptable.

### Video Privacy (U.S.)
Publishers with U.S. inventory must comply with the Video Privacy Protection Act when applicable.

### Location Information
Precise geolocation data requires explicit user consent.

## Intellectual Property

Publishers must have legitimate rights to monetize all content associated with their inventory.

## Inventory Integrity

All attributes submitted with ad requests must truthfully reflect the actual advertising opportunity. Each unique ad opportunity should generate only one request through a given integration path.

## Traffic Quality

All impressions must originate from genuine human engagement. Prohibited practices include automated tools/bots, incentivized ad views, browser hijacking, ad refreshing more than every 30 seconds, and artificial inflation of metrics.

## Transparency Requirements

- Complete visibility into inventory being monetized
- Declared URL/app identifier must accurately represent where the ad will render
- No concealed or obscured placements

## Viewability Standards

Advertising placements must provide genuine visibility. No ad stacking, hidden placements, imperceptible sizes, or unauthorized auto-refreshing.

## Content Standards

### Prohibited Categories

Adult content, unlicensed gambling, extreme violence, discrimination/hate, harassment, misinformation, controlled substances, piracy, hacking tools, counterfeit goods, click farms, malware, deceptive redirects, intrusive ads, deepfakes, and impersonation.

### Categories Requiring Approval

Weapons, pharmaceuticals, alcohol, tobacco, digital assets, political campaigns, and dating platforms.

## AI Environment Standards

### Clear Differentiation
Sponsored content must be visually or contextually distinguishable from AI-generated responses.

### Proper Labeling
All advertising must be identified as such in compliance with FTC endorsement guidelines.

### Relevance
Advertisements should align with the context of the user's interaction.

### Authentic Engagement
Using AI-generated dialogue to deceive users or manipulate behavior is prohibited.

### Conversational Privacy
Information shared within AI conversations must be handled according to applicable privacy frameworks.

### Responsible AI
Inventory must not be associated with AI systems that generate harmful content or bypass safety mechanisms.

## Industry Compliance

All placements must adhere to the Coalition for Better Ads Standards.

## Issue Resolution

Report concerns to support@trygravity.ai. Gravity commits to acknowledging reports within one business day.

## Enforcement

Violations may result in notification with remediation, temporary suspension, permanent removal, revenue adjustment, or legal remedies.

**Contact:** support@trygravity.ai
~~~