> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wassist.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Monetization

> Generate revenue from your WhatsApp agent with paywalls, credits, and subscriptions

Wassist includes built-in tools to monetize your agent. Whether you want to offer a freemium model, sell premium access, or charge per interaction, you have flexible options.

## Monetization Models

<CardGroup cols={3}>
  <Card title="Freemium" icon="gift">
    **Free tier + paid upgrade**

    Users get limited free messages, then pay to continue.
  </Card>

  <Card title="Credits" icon="coins">
    **Pay-per-use**

    Users purchase credits that are consumed with each interaction.
  </Card>

  <Card title="Subscription" icon="calendar-check">
    **Recurring payments**

    Users pay monthly for unlimited or premium access.
  </Card>
</CardGroup>

## Setting Up a Paywall

Paywalls limit how much users can interact before requiring payment.

<Steps>
  <Step title="Open Agent Settings">
    Go to your agent and find the **Monetization** or **Paywall** section.
  </Step>

  <Step title="Enable Paywall">
    Toggle on **Enable Paywall**.
  </Step>

  <Step title="Set Message Limit">
    Define how many free messages users get:

    | Setting           | Description                                |
    | ----------------- | ------------------------------------------ |
    | **Message Limit** | Number of messages before paywall triggers |

    <Tip>
      Start with a generous limit (10-20 messages) so users can experience value before hitting the paywall.
    </Tip>
  </Step>

  <Step title="Choose Paywall Action">
    What happens when the limit is reached:

    | Action            | Description                          |
    | ----------------- | ------------------------------------ |
    | **Purchase Link** | Redirect to your payment page        |
    | **Subscribe**     | Start a Wassist-managed subscription |
    | **Terminal**      | End the conversation with a message  |
  </Step>

  <Step title="Customize Messages">
    Configure the paywall experience:

    | Field                | Description                          |
    | -------------------- | ------------------------------------ |
    | **CTA Button Text**  | Button label (e.g., "Upgrade Now")   |
    | **Terminal Message** | Message shown when conversation ends |
  </Step>
</Steps>

## Paywall Actions Explained

<AccordionGroup>
  <Accordion title="Purchase Link" icon="arrow-up-right-from-square">
    Direct users to your own payment page (Stripe, Gumroad, etc.).

    **Configuration:**

    * Enter your payment URL
    * URL can include parameters like `?user_id={user_id}`

    **Best for:**

    * One-time purchases
    * Existing payment systems
    * Complex pricing tiers
  </Accordion>

  <Accordion title="Subscribe" icon="credit-card">
    Users subscribe through Wassist for monthly access.

    **Configuration:**

    * Set monthly price
    * Wassist handles payment processing
    * Revenue is shared (see pricing)

    **Best for:**

    * Simple subscription model
    * No existing payment infrastructure
    * Quick setup
  </Accordion>

  <Accordion title="Terminal" icon="stop">
    Conversation ends with a custom message—no payment option.

    **Best for:**

    * Demo/trial agents
    * Limiting free tier usage
    * Gathering leads before sales contact
  </Accordion>
</AccordionGroup>

## Credit-Based Monetization

Credits provide fine-grained control over usage and monetization.

### How Credits Work

1. Users start with **initial credits** (configurable)
2. Each message or tool use consumes credits
3. When credits run out, the paywall triggers
4. Users can purchase more credits

### Configuring Credits

<Steps>
  <Step title="Enable Credit System">
    In your agent's **Monetization** section, enable **Credit System**.
  </Step>

  <Step title="Set Initial Credits">
    How many credits new users receive:

    ```
    Initial Credits: 50
    ```
  </Step>

  <Step title="Configure Credit Costs">
    Set costs for different actions:

    | Action           | Default Cost          |
    | ---------------- | --------------------- |
    | Regular message  | 1 credit              |
    | Tool calls       | Configurable per tool |
    | Image generation | 5+ credits            |
  </Step>

  <Step title="Set Up Credit Grants">
    Allow users to get more credits:

    | Field                     | Description                         |
    | ------------------------- | ----------------------------------- |
    | **Credit Grant Password** | Secret phrase that grants credits   |
    | **Credit Grant Amount**   | Credits given when password is used |

    <Note>
      Share the password on your payment confirmation page or email.
    </Note>
  </Step>
</Steps>

### Credit Grant Flow

1. User purchases credits on your payment page
2. Confirmation page shows the secret phrase
3. User sends phrase to your agent
4. Credits are added to their account

```
User: PREMIUM2024
Agent: Thanks! 100 credits have been added to your account. 
       You now have 150 credits available.
```

## Advertising

Generate revenue by displaying ads in conversations.

### Configuring Ads

<Steps>
  <Step title="Enable Advertising">
    In the **Monetization** section, toggle on **Enable Ads**.
  </Step>

  <Step title="Configure Ad Settings">
    | Field                   | Description               |
    | ----------------------- | ------------------------- |
    | **Conversation Offset** | Messages before first ad  |
    | **Ad Frequency**        | Messages between ads      |
    | **Force Ad**            | Require ad acknowledgment |
  </Step>
</Steps>

<Warning>
  Use ads sparingly. Too many ads degrade user experience and can drive users away.
</Warning>

## Subscription Management

When using Wassist-managed subscriptions:

### For Users

* Subscribe via payment link in WhatsApp
* Manage subscription through their account
* Cancel anytime

### For You

* View subscribers in your dashboard
* Track subscription revenue
* See churn and retention metrics

## Best Practices

<AccordionGroup>
  <Accordion title="Demonstrate Value First" icon="star">
    Give users enough free interactions to understand your agent's value before hitting a paywall. A frustrated user who hits a paywall too soon won't convert.

    **Recommendation:** 10-20 free messages or one complete interaction flow.
  </Accordion>

  <Accordion title="Clear Communication" icon="message">
    Be transparent about limitations:

    * Mention limits in your welcome message
    * Warn users as they approach the limit
    * Make the upgrade path clear and simple

    ```
    First Message:
    "Hi! I can help you with... You have 10 free messages 
    to try me out, then you can upgrade for unlimited access."
    ```
  </Accordion>

  <Accordion title="Fair Pricing" icon="scale-balanced">
    Research competitors and test different price points. Consider:

    * Value delivered per interaction
    * Your target audience's budget
    * Subscription vs. one-time pricing psychology
  </Accordion>

  <Accordion title="Easy Upgrade Path" icon="stairs">
    Make payment as frictionless as possible:

    * One-click payment links
    * Mobile-optimized checkout
    * Multiple payment methods
  </Accordion>
</AccordionGroup>

## Tracking Revenue

Monitor your monetization performance in **Analytics**:

* Total revenue
* Conversion rates (free → paid)
* Average revenue per user
* Subscription metrics
* Credit purchase patterns

## SDK Alternative

Configure monetization programmatically:

```typescript theme={null}
await client.agents.update(agentId, {
  paywallConfig: {
    messageLimit: 10,
    paywallAction: 'purchase_link',
    paywallUrl: 'https://your-payment-page.com?user={user_id}',
    ctaButtonText: 'Upgrade to Premium',
    terminalStateMessage: 'Thanks for trying our agent!'
  },
  creditSettings: {
    initialCredits: 50,
    creditGrantPassword: 'PREMIUM2024',
    creditGrantAmount: 100
  }
});
```

## What's Next

<CardGroup cols={2}>
  <Card title="View Analytics" icon="chart-line" href="/guides/analytics">
    Track your monetization performance.
  </Card>

  <Card title="Configure Tools" icon="plug" href="/guides/configure-tools">
    Set credit costs for tool usage.
  </Card>
</CardGroup>
