技能 编程开发 Fathom成本优化与API调优

Fathom成本优化与API调优

v20260423
fathom-cost-tuning
本文档详细介绍了如何优化Fathom API的使用和成本结构。核心内容包括:使用缓存避免重复调用、采用Webhook代替轮询、批量处理数据同步以及设置数据生命周期策略(如90天归档),旨在显著降低API调用费用和存储开销。
获取技能
169 次下载
概览

Fathom Cost Tuning

Overview

Fathom pricing scales with per-seat licensing for team features, with primary cost drivers being transcript storage volume and recording hours consumed. Every meeting generates a transcript and AI summary that persist in storage. For organizations running dozens of meetings daily, unchecked transcript accumulation and redundant API polling for meeting data create unnecessary spend. Optimizing retrieval patterns and storage lifecycle directly reduces both API costs and plan overhead.

Cost Breakdown

ComponentCost DriverOptimization
Seat licensesPer-user/month for Team planAudit active seats quarterly; remove inactive users
Transcript storageAccumulated meeting transcriptsArchive transcripts older than 90 days to local storage
Recording hoursMeeting duration across all usersDisable recording for standup/informal meetings
API pollingRepeated list/get calls for meeting dataUse webhooks for push notifications instead of polling
CRM sync eventsPer-meeting sync to Salesforce/HubSpotBatch CRM writes; skip internal-only meetings

API Call Reduction

class FathomTranscriptCache {
  private cache = new Map<string, { transcript: string; summary: string }>();

  async getTranscript(meetingId: string, apiFn: () => Promise<any>): Promise<any> {
    // Transcripts are immutable after generation — cache permanently
    if (this.cache.has(meetingId)) return this.cache.get(meetingId);
    const result = await apiFn();
    this.cache.set(meetingId, result);
    return result;
  }

  async listMeetings(params: { include_summary: boolean }): Promise<any[]> {
    // Always use include_summary=true to avoid N+1 calls
    // Fetches summaries inline with the list response
    const response = await fetch('/api/meetings?include_summary=true');
    return response.json();
  }
}

Usage Monitoring

class FathomUsageTracker {
  private apiCalls = 0;
  private readonly rateLimit = 60; // 60 req/min
  private windowStart = Date.now();

  async throttledCall<T>(fn: () => Promise<T>): Promise<T> {
    if (Date.now() - this.windowStart > 60_000) {
      this.apiCalls = 0;
      this.windowStart = Date.now();
    }
    if (this.apiCalls >= this.rateLimit) {
      const waitMs = 60_000 - (Date.now() - this.windowStart);
      await new Promise(r => setTimeout(r, waitMs));
      this.apiCalls = 0;
      this.windowStart = Date.now();
    }
    this.apiCalls++;
    return fn();
  }

  getUsageReport(): { callsThisMinute: number; remainingCapacity: number } {
    return { callsThisMinute: this.apiCalls, remainingCapacity: this.rateLimit - this.apiCalls };
  }
}

Cost Optimization Checklist

  • [ ] Use webhooks for meeting completion events instead of polling
  • [ ] Always pass include_summary=true in list requests to avoid extra calls
  • [ ] Cache transcripts permanently — they never change after generation
  • [ ] Batch API processing within the 60 req/min rate limit
  • [ ] Audit team seats quarterly and remove inactive users
  • [ ] Archive transcripts older than 90 days to reduce storage costs
  • [ ] Disable auto-recording for informal or standup meetings
  • [ ] Skip CRM sync for internal-only meetings

Error Handling

IssueCauseFix
429 rate limit hitExceeding 60 req/minImplement throttling with sliding window
Duplicate transcript fetchesMultiple services requesting same meetingCentralize through shared cache
Stale meeting listPolling on long intervalsSwitch to webhook-driven updates
CRM sync failuresBatch too large or network timeoutChunk CRM writes into batches of 10
Storage costs climbingNo transcript lifecycle policyImplement 90-day archive-to-local policy

Resources

Next Steps

See fathom-performance-tuning.

信息
分类 编程开发
名称 fathom-cost-tuning
版本 v20260423
大小 4.29KB
更新时间 2026-04-28
语言