klaviyo-cost-tuning

Optimize Klaviyo costs through plan selection, contact management, and usage monitoring. Use when analyzing Klaviyo billing, reducing active profile costs, or implementing usage monitoring and budget alerts. Trigger with phrases like "klaviyo cost", "klaviyo billing", "reduce klaviyo costs", "klaviyo pricing", "klaviyo expensive", "klaviyo budget".

1,868 stars

Best use case

klaviyo-cost-tuning is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Optimize Klaviyo costs through plan selection, contact management, and usage monitoring. Use when analyzing Klaviyo billing, reducing active profile costs, or implementing usage monitoring and budget alerts. Trigger with phrases like "klaviyo cost", "klaviyo billing", "reduce klaviyo costs", "klaviyo pricing", "klaviyo expensive", "klaviyo budget".

Teams using klaviyo-cost-tuning should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/klaviyo-cost-tuning/SKILL.md --create-dirs "https://raw.githubusercontent.com/jeremylongshore/claude-code-plugins-plus-skills/main/plugins/saas-packs/klaviyo-pack/skills/klaviyo-cost-tuning/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/klaviyo-cost-tuning/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How klaviyo-cost-tuning Compares

Feature / Agentklaviyo-cost-tuningStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Optimize Klaviyo costs through plan selection, contact management, and usage monitoring. Use when analyzing Klaviyo billing, reducing active profile costs, or implementing usage monitoring and budget alerts. Trigger with phrases like "klaviyo cost", "klaviyo billing", "reduce klaviyo costs", "klaviyo pricing", "klaviyo expensive", "klaviyo budget".

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Klaviyo Cost Tuning

## Overview

Optimize Klaviyo costs through active profile management, list hygiene, event sampling, and API usage monitoring. Klaviyo bills primarily by **active profiles** and **message volume**, not API calls.

## Prerequisites

- Access to Klaviyo billing dashboard
- Understanding of active profile definition
- `klaviyo-api` SDK for programmatic management

## Klaviyo Pricing Model

Klaviyo bills based on **active profiles** (contacts who have received or been targeted by marketing), not API requests.

| Component | How It's Billed | Cost Driver |
|-----------|----------------|-------------|
| Email | Per active profile tier | Number of marketable profiles |
| SMS | Per message sent + carrier fees | Message volume |
| Push | Included with email plan | N/A |
| API calls | Free (rate limited, not billed) | N/A |
| Reviews | Per request volume | Review request sends |

### Email Pricing Tiers (Approximate)

| Active Profiles | Monthly Cost |
|----------------|-------------|
| 0 - 250 | Free |
| 251 - 500 | $20/mo |
| 501 - 1,000 | $30/mo |
| 1,001 - 1,500 | $45/mo |
| 1,501 - 5,000 | $60-$100/mo |
| 5,001 - 10,000 | $100-$150/mo |
| 10,001 - 25,000 | $150-$375/mo |
| 25,001+ | Custom pricing |

> **Key insight:** Reducing **active profiles** has the biggest cost impact. Cleaning suppressed/unengaged contacts directly reduces your bill.

## Instructions

### Step 1: Audit Active Profile Count

```typescript
import { ApiKeySession, ProfilesApi, SegmentsApi } from 'klaviyo-api';

const session = new ApiKeySession(process.env.KLAVIYO_PRIVATE_KEY!);
const profilesApi = new ProfilesApi(session);

// Count total profiles
let totalProfiles = 0;
let cursor: string | undefined;
do {
  const response = await profilesApi.getProfiles({
    pageCursor: cursor,
    fieldsProfile: ['email'],  // Minimal fields for speed
  });
  totalProfiles += response.body.data.length;
  const nextLink = response.body.links?.next;
  cursor = nextLink ? new URL(nextLink).searchParams.get('page[cursor]') || undefined : undefined;
} while (cursor);

console.log(`Total profiles: ${totalProfiles}`);
```

### Step 2: Identify Unengaged Profiles

```typescript
// Find profiles that haven't opened/clicked in 180+ days
// Create a segment in Klaviyo for this, then query it
const segmentsApi = new SegmentsApi(session);

const segments = await segmentsApi.getSegments({
  filter: 'equals(name,"Unengaged 180+ Days")',
});

if (segments.body.data.length > 0) {
  const segmentId = segments.body.data[0].id;
  const unengaged = await segmentsApi.getSegmentProfiles({
    id: segmentId,
    fieldsProfile: ['email', 'created'],
  });
  console.log(`Unengaged profiles: ${unengaged.body.data.length}+`);
}
```

### Step 3: Suppress Unengaged Contacts

```typescript
// Move unengaged profiles to a suppressed list (removes from active count)
import { ListsApi, ListEnum, ProfileEnum } from 'klaviyo-api';

const listsApi = new ListsApi(session);

// Option 1: Unsubscribe (profile stays but isn't marketable = not billed)
await profilesApi.unsubscribeProfiles({
  data: {
    type: 'profile-subscription-bulk-delete-job',
    attributes: {
      profiles: {
        data: unengagedEmails.map(email => ({
          type: ProfileEnum.Profile,
          attributes: {
            email,
            subscriptions: {
              email: { marketing: { consent: 'UNSUBSCRIBED' } },
            },
          },
        })),
      },
    },
    relationships: {
      list: { data: { type: ListEnum.List, id: 'MAIN_LIST_ID' } },
    },
  },
});

// Option 2: Suppress via profile update (add to global suppression)
for (const email of unengagedEmails) {
  await profilesApi.createOrUpdateProfile({
    data: {
      type: ProfileEnum.Profile,
      attributes: {
        email,
        properties: { suppressedAt: new Date().toISOString(), suppressReason: 'unengaged-180d' },
      },
    },
  });
}
```

### Step 4: Event Sampling for Non-Critical Tracking

```typescript
// Not all events need to be tracked -- sample non-critical ones
function shouldTrackEvent(eventName: string, samplingRates: Record<string, number>): boolean {
  const rate = samplingRates[eventName] ?? 1.0;  // Default: track everything
  return Math.random() < rate;
}

const samplingConfig = {
  'Placed Order': 1.0,       // Always track (revenue attribution)
  'Started Checkout': 1.0,   // Always track (cart abandonment)
  'Viewed Product': 0.25,    // 25% sample (high volume, less critical)
  'Page View': 0.1,          // 10% sample (very high volume)
};

// Before tracking
if (shouldTrackEvent('Viewed Product', samplingConfig)) {
  await eventsApi.createEvent({ /* ... */ });
}
```

### Step 5: API Usage Monitor

```typescript
// Track API call volume to detect runaway processes
class KlaviyoUsageTracker {
  private callCount = 0;
  private readonly startTime = Date.now();

  track(): void {
    this.callCount++;
    // Warn if approaching steady rate limit
    const elapsedMinutes = (Date.now() - this.startTime) / 60000;
    const ratePerMinute = this.callCount / Math.max(elapsedMinutes, 1);

    if (ratePerMinute > 500) {
      console.warn(`[Klaviyo] High API rate: ${Math.round(ratePerMinute)} req/min (limit: 700)`);
    }
  }

  getStats(): { totalCalls: number; ratePerMinute: number } {
    const elapsedMinutes = (Date.now() - this.startTime) / 60000;
    return {
      totalCalls: this.callCount,
      ratePerMinute: Math.round(this.callCount / Math.max(elapsedMinutes, 1)),
    };
  }
}

export const usageTracker = new KlaviyoUsageTracker();
```

## Cost Reduction Checklist

- [ ] Suppress profiles unengaged >180 days
- [ ] Remove hard-bounced email addresses
- [ ] Audit and merge duplicate profiles
- [ ] Use double opt-in to reduce fake signups
- [ ] Sample high-volume, low-value events
- [ ] Batch API calls instead of individual requests
- [ ] Cache frequently-read data (segments, lists)
- [ ] Use sparse fieldsets to reduce transfer size
- [ ] Review SMS sending -- highest per-message cost
- [ ] Set up sunset flow (auto-suppress after N days unengaged)

## Error Handling

| Issue | Cause | Solution |
|-------|-------|----------|
| Unexpected bill increase | Unengaged profiles grew | Run suppression script |
| SMS costs spiking | Flow sending to full list | Add engaged-only segment filter |
| Duplicate profiles | Multiple identify calls | Merge duplicates, use `createOrUpdateProfile` |
| API rate limits hit | Bulk operations | Use queue with concurrency control |

## Resources

- [Klaviyo Pricing](https://www.klaviyo.com/pricing)
- [Understanding Active Profiles](https://help.klaviyo.com/hc/en-us/articles/115005077967)
- [Sunset Flow Best Practices](https://help.klaviyo.com/hc/en-us/articles/360002360091)
- [Data Privacy API](https://developers.klaviyo.com/en/reference/data_privacy_api_overview)

## Next Steps

For architecture patterns, see `klaviyo-reference-architecture`.

Related Skills

workhuman-performance-tuning

1868
from jeremylongshore/claude-code-plugins-plus-skills

Workhuman performance tuning for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman performance tuning".

workhuman-cost-tuning

1868
from jeremylongshore/claude-code-plugins-plus-skills

Workhuman cost tuning for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman cost tuning".

wispr-performance-tuning

1868
from jeremylongshore/claude-code-plugins-plus-skills

Wispr Flow performance tuning for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr performance tuning".

wispr-cost-tuning

1868
from jeremylongshore/claude-code-plugins-plus-skills

Wispr Flow cost tuning for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr cost tuning".

windsurf-performance-tuning

1868
from jeremylongshore/claude-code-plugins-plus-skills

Optimize Windsurf IDE performance: indexing speed, Cascade responsiveness, and memory usage. Use when Windsurf is slow, indexing takes too long, Cascade times out, or the IDE uses too much memory. Trigger with phrases like "windsurf slow", "windsurf performance", "optimize windsurf", "windsurf memory", "cascade slow", "indexing slow".

windsurf-cost-tuning

1868
from jeremylongshore/claude-code-plugins-plus-skills

Optimize Windsurf licensing costs through seat management, tier selection, and credit monitoring. Use when analyzing Windsurf billing, reducing per-seat costs, or implementing usage monitoring and budget controls. Trigger with phrases like "windsurf cost", "windsurf billing", "reduce windsurf costs", "windsurf pricing", "windsurf budget".

webflow-performance-tuning

1868
from jeremylongshore/claude-code-plugins-plus-skills

Optimize Webflow API performance with response caching, bulk endpoint batching, CDN-cached live item reads, pagination optimization, and connection pooling. Use when experiencing slow API responses or optimizing request throughput. Trigger with phrases like "webflow performance", "optimize webflow", "webflow latency", "webflow caching", "webflow slow", "webflow batch".

webflow-cost-tuning

1868
from jeremylongshore/claude-code-plugins-plus-skills

Optimize Webflow costs through plan selection, CDN read optimization, bulk endpoint usage, and API usage monitoring with budget alerts. Use when analyzing Webflow billing, reducing API costs, or implementing usage monitoring for Webflow integrations. Trigger with phrases like "webflow cost", "webflow billing", "reduce webflow costs", "webflow pricing", "webflow budget".

vercel-performance-tuning

1868
from jeremylongshore/claude-code-plugins-plus-skills

Optimize Vercel deployment performance with caching, bundle optimization, and cold start reduction. Use when experiencing slow page loads, optimizing Core Web Vitals, or reducing serverless function cold start times. Trigger with phrases like "vercel performance", "optimize vercel", "vercel latency", "vercel caching", "vercel slow", "vercel cold start".

vercel-cost-tuning

1868
from jeremylongshore/claude-code-plugins-plus-skills

Optimize Vercel costs through plan selection, function efficiency, and usage monitoring. Use when analyzing Vercel billing, reducing function execution costs, or implementing spend management and budget alerts. Trigger with phrases like "vercel cost", "vercel billing", "reduce vercel costs", "vercel pricing", "vercel expensive", "vercel budget".

veeva-performance-tuning

1868
from jeremylongshore/claude-code-plugins-plus-skills

Veeva Vault performance tuning for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva performance tuning".

veeva-cost-tuning

1868
from jeremylongshore/claude-code-plugins-plus-skills

Veeva Vault cost tuning for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva cost tuning".