Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Optimize Apollo.io costs and credit usage. Use when managing Apollo credits, reducing API costs, or optimizing subscription usage. Trigger with phrases like "apollo cost", "apollo credits", "apollo billing", "reduce apollo costs", "apollo usage".
.claude/skills/jeremylongshore-apollo-cost-tuning/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-22 | ✗→✓ | ▲ Improved | -13% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 74% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 177% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 73% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 50% | 0% |
Optimize Apollo.io API costs through credit-aware enrichment. Key cost model: search is free, enrichment costs credits. Apollo charges per unique contact/company lookup. Credits do not roll over. Strategies: deduplicate before enriching, score leads before spending credits, and track daily budget.
Action | Credits | Notes
----------------------------+---------+-----------------------------------
People Search | 0 | /mixed_people/api_search (free!)
Organization Search | 0 | /mixed_companies/search (free!)
People Enrichment (single) | 1 | /people/match
People Enrichment (bulk) | 1/match | /people/bulk_match (up to 10/call)
Organization Enrichment | 1 | /organizations/enrich
Reveal Personal Email | +1 | reveal_personal_emails param
Reveal Phone Number | +1 | reveal_phone_number paramPlans (approximate):
typescript// src/cost/credit-tracker.ts class CreditTracker { private daily: Map<string, number> = new Map(); private readonly budget: number; constructor(dailyBudget: number = 200) { this.budget = dailyBudget; } record(count: number = 1) { const today = new Date().toISOString().split('T')[0]; this.daily.set(today, (this.daily.get(today) ?? 0) + count); } todayUsage(): number { const today = new Date().toISOString().split('T')[0]; return this.daily.get(today) ?? 0; } isOverBudget(): boolean { return this.todayUsage() >= this.budget; } report(): string { const used = this.todayUsage(); return `${used}/${this.budget} credits (${Math.round((used / this.budget) * 100)}%)`; } } export const creditTracker = new CreditTracker( parseInt(process.env.APOLLO_DAILY_CREDIT_BUDGET ?? '200', 10), );
typescript// src/cost/dedup.ts import { LRUCache } from 'lru-cache'; // Track enriched contacts to avoid paying twice const enrichedCache = new LRUCache<string, boolean>({ max: 50_000, ttl: 30 * 24 * 60 * 60 * 1000, // 30 days }); export function enrichmentKey(params: { email?: string; linkedin_url?: string; first_name?: string; last_name?: string; organization_domain?: string }): string { // Prefer email as unique key, fall back to LinkedIn, then name+domain return params.email ?? params.linkedin_url ?? `${params.first_name}:${params.last_name}:${params.organization_domain}`; } export function isAlreadyEnriched(key: string): boolean { return enrichedCache.has(key); } export function markEnriched(key: string) { enrichedCache.set(key, true); }
Only spend credits on leads worth contacting.
typescript// src/cost/lead-scorer.ts interface LeadSignals { seniority?: string; title?: string; companyEmployees?: number; hasEmail: boolean; hasPhone: boolean; hasLinkedIn: boolean; } export function shouldEnrich(signals: LeadSignals, threshold: number = 40): boolean { let score = 0; // Seniority — only enrich decision-makers const topSeniority = ['c_suite', 'vp', 'founder', 'owner']; if (topSeniority.includes(signals.seniority ?? '')) score += 40; else if (signals.seniority === 'director') score += 30; else if (signals.seniority === 'manager') score += 15; else score += 5; // Company size — mid-market is highest value if (signals.companyEmployees && signals.companyEmployees >= 50 && signals.companyEmployees <= 1000) score += 25; else if (signals.companyEmployees && signals.companyEmployees > 1000) score += 15; // Missing data — worth enriching if we need the contact info if (!signals.hasEmail) score += 20; if (!signals.hasPhone) score += 10; return score >= threshold; }
typescript// src/cost/budget-client.ts import axios from 'axios'; import { creditTracker } from './credit-tracker'; import { isAlreadyEnriched, markEnriched, enrichmentKey } from './dedup'; const client = axios.create({ baseURL: 'https://api.apollo.io/api/v1', headers: { 'Content-Type': 'application/json', 'x-api-key': process.env.APOLLO_API_KEY! }, }); // Credit-consuming endpoints const CREDIT_ENDPOINTS = ['/people/match', '/people/bulk_match', '/organizations/enrich']; // Block requests when over budget client.interceptors.request.use((config) => { const isCreditEndpoint = CREDIT_ENDPOINTS.some((ep) => config.url?.includes(ep)); if (isCreditEndpoint && creditTracker.isOverBudget()) { throw new Error(`Daily credit budget exceeded (${creditTracker.report()})`); } return config; }); // Track credit usage on success client.interceptors.response.use((response) => { const isCreditEndpoint = CREDIT_ENDPOINTS.some((ep) => response.config.url?.includes(ep)); if (isCreditEndpoint) { // Bulk match: count matches, not calls const matchCount = response.data?.matches?.length ?? 1; creditTracker.record(matchCount); // Mark as enriched for dedup const email = response.data?.person?.email; if (email) markEnriched(email); } return response; }); export { client as budgetClient };
typescriptimport { budgetClient } from './cost/budget-client'; import { shouldEnrich } from './cost/lead-scorer'; import { isAlreadyEnriched, enrichmentKey } from './cost/dedup'; import { creditTracker } from './cost/credit-tracker'; async function enrichHighValueLeads(people: any[]) { let enriched = 0, skipped = 0, deduped = 0; const toEnrich: any[] = []; for (const person of people) { const key = enrichmentKey({ email: person.email, linkedin_url: person.linkedin_url, first_name: person.first_name, last_name: person.last_name }); if (isAlreadyEnriched(key)) { deduped++; continue; } if (!shouldEnrich({ seniority: person.seniority, hasEmail: !!person.email, hasPhone: false, hasLinkedIn: !!person.linkedin_url })) { skipped++; continue; } toEnrich.push(person); } // Bulk enrich in batches of 10 for (let i = 0; i < toEnrich.length; i += 10) { const batch = toEnrich.slice(i, i + 10); await budgetClient.post('/people/bulk_match', { details: batch.map((p: any) => ({ first_name: p.first_name, last_name: p.last_name, organization_domain: p.organization?.primary_domain, })), }); enriched += batch.length; } console.log(`Enriched: ${enriched}, Skipped (low-value): ${skipped}, Deduped: ${deduped}`); console.log(`Credits: ${creditTracker.report()}`); }
CreditTracker with daily budget enforcement| Issue | Resolution | |-------|------------| | Budget exceeded | Increase APOLLO_DAILY_CREDIT_BUDGET or wait until tomorrow | | High dedup misses | Extend LRU TTL, verify key generation logic | | Enriching low-value leads | Lower the shouldEnrich threshold | | Month-end credit crunch | Spread enrichment evenly with daily budgets |
Proceed to apollo-reference-architecture for architecture patterns.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-22 | fail→pass | 15,613 | 1,512 | -90% | 1 | 1 | 0% | 2,899 | 2,510 | -13% | 0 | 0 | — |
case-01 | fail→fail | 17,712 | 11,836 | -33% | 1 | 1 | 0% | 4,442 | 5,150 | +16% | 0 | 0 | — |
case-02 | fail→fail | 22,702 | 18,006 | -21% | 1 | 1 | 0% | 5,529 | 6,511 | +18% | 0 | 0 | — |
case-03 | fail→fail | 20,751 | 21,111 | +2% | 1 | 1 | 0% | 4,634 | 7,131 | +54% | 0 | 0 | — |
case-04 | pass→pass | 13,220 | 9,959 | -25% | 1 | 1 | 0% | 2,726 | 4,244 | +56% | 0 | 0 | — |
case-05 | pass→pass | 7,660 | 4,894 | -36% | 1 | 1 | 0% | 1,464 | 3,252 | +122% | 0 | 0 | — |
case-06 | pass→pass | 7,977 | 7,622 | -4% | 1 | 1 | 0% | 1,675 | 3,943 | +135% | 0 | 0 | — |
case-07 | fail→pass | 10,759 | 5,196 | -52% | 1 | 1 | 0% | 1,851 | 3,228 | +74% | 0 | 0 | — |
case-08 | fail→pass | 5,886 | 4,423 | -25% | 1 | 1 | 0% | 1,120 | 3,101 | +177% | 0 | 0 | — |
case-09 | fail→pass | 11,999 | 8,302 | -31% | 1 | 1 | 0% | 2,287 | 3,952 | +73% | 0 | 0 | — |
case-10 | fail→pass | 11,008 | 3,606 | -67% | 1 | 1 | 0% | 1,990 | 2,987 | +50% | 0 | 0 | — |
case-11 | fail→pass | 7,827 | 1,998 | -74% | 1 | 1 | 0% | 1,449 | 2,626 | +81% | 0 | 0 | — |
case-12 | fail→fail | 14,403 | 12,244 | -15% | 1 | 1 | 0% | 2,427 | 4,913 | +102% | 0 | 0 | — |
case-13 | fail→fail | 13,149 | 11,343 | -14% | 1 | 1 | 0% | 2,201 | 4,359 | +98% | 0 | 0 | — |
case-14 | pass→pass | 14,742 | 6,382 | -57% | 1 | 1 | 0% | 2,659 | 3,456 | +30% | 0 | 0 | — |
case-15 | fail→pass | 5,707 | 1,681 | -71% | 1 | 1 | 0% | 856 | 2,573 | +201% | 0 | 0 | — |
case-16 | fail→fail | 12,577 | 10,164 | -19% | 1 | 1 | 0% | 2,323 | 4,350 | +87% | 0 | 0 | — |
case-17 | pass→pass | 6,774 | 3,474 | -49% | 1 | 1 | 0% | 1,202 | 2,868 | +139% | 0 | 0 | — |
case-18 | pass→pass | 11,695 | 5,333 | -54% | 1 | 1 | 0% | 2,181 | 3,324 | +52% | 0 | 0 | — |
case-19 | fail→pass | 6,959 | 3,162 | -55% | 1 | 1 | 0% | 1,181 | 2,924 | +148% | 0 | 0 | — |
case-20 | pass→pass | 13,107 | 9,484 | -28% | 1 | 1 | 0% | 2,149 | 3,948 | +84% | 0 | 0 | — |
case-21 | pass→pass | 15,384 | 10,683 | -31% | 1 | 1 | 0% | 2,467 | 4,405 | +79% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +36 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.