hubspot-cost-tuning
Optimize HubSpot costs through API call reduction, plan selection, and usage monitoring. Use when analyzing HubSpot API usage, reducing unnecessary calls, or implementing usage tracking and budget alerts. Trigger with phrases like "hubspot cost", "hubspot API usage", "reduce hubspot calls", "hubspot pricing", "hubspot budget", "hubspot quota".
Best use case
hubspot-cost-tuning is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Optimize HubSpot costs through API call reduction, plan selection, and usage monitoring. Use when analyzing HubSpot API usage, reducing unnecessary calls, or implementing usage tracking and budget alerts. Trigger with phrases like "hubspot cost", "hubspot API usage", "reduce hubspot calls", "hubspot pricing", "hubspot budget", "hubspot quota".
Teams using hubspot-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
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/hubspot-cost-tuning/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How hubspot-cost-tuning Compares
| Feature / Agent | hubspot-cost-tuning | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Optimize HubSpot costs through API call reduction, plan selection, and usage monitoring. Use when analyzing HubSpot API usage, reducing unnecessary calls, or implementing usage tracking and budget alerts. Trigger with phrases like "hubspot cost", "hubspot API usage", "reduce hubspot calls", "hubspot pricing", "hubspot budget", "hubspot quota".
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
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# HubSpot Cost Tuning
## Overview
Optimize HubSpot integration costs by reducing API call volume, monitoring usage against daily limits, and choosing the right plan.
## Prerequisites
- Access to HubSpot account settings (Settings > Account > Usage & Limits)
- Understanding of current API usage patterns
## Instructions
### Step 1: Understand HubSpot API Pricing Model
HubSpot API calls are included with your subscription tier. There is no per-call billing, but exceeding limits results in `429 Too Many Requests` errors that block your integration.
| Plan | Daily API Limit | Per-Second Limit |
|------|----------------|-----------------|
| Free / Starter | 250,000 | 10 |
| Professional | 500,000 | 10 |
| Enterprise | 500,000 | 10 |
| API Limit Increase Add-on | 1,000,000 | 10 |
**Key insight:** The daily limit is per portal (shared across all apps). A poorly written integration can consume the entire quota and block all other apps.
### Step 2: Monitor Current Usage
```bash
# Check rate limit headers on any API call
curl -sI https://api.hubapi.com/crm/v3/objects/contacts?limit=1 \
-H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
| grep -i ratelimit
# Output:
# X-HubSpot-RateLimit-Daily: 500000
# X-HubSpot-RateLimit-Daily-Remaining: 487234
# X-HubSpot-RateLimit-Secondly: 10
# X-HubSpot-RateLimit-Secondly-Remaining: 9
```
```typescript
// Programmatic usage tracking
class HubSpotUsageTracker {
private dailyCalls = 0;
private lastReset = new Date();
track(): void {
this.dailyCalls++;
// Reset counter at midnight
const now = new Date();
if (now.getDate() !== this.lastReset.getDate()) {
this.dailyCalls = 0;
this.lastReset = now;
}
}
getUsage(): { daily: number; percentUsed: number } {
const limit = parseInt(process.env.HUBSPOT_DAILY_LIMIT || '500000');
return {
daily: this.dailyCalls,
percentUsed: (this.dailyCalls / limit) * 100,
};
}
shouldAlert(): boolean {
return this.getUsage().percentUsed > 80;
}
}
```
### Step 3: High-Impact Cost Reductions
#### Replace Individual Reads with Batch Reads
```typescript
// BEFORE: 100 API calls
for (const id of contactIds) {
await client.crm.contacts.basicApi.getById(id, ['email']);
}
// AFTER: 1 API call (100x reduction)
await client.crm.contacts.batchApi.read({
inputs: contactIds.map(id => ({ id })),
properties: ['email'],
propertiesWithHistory: [],
});
```
#### Use Search Instead of List + Filter
```typescript
// BEFORE: Fetch all, filter in memory (wastes API calls + bandwidth)
let after: string | undefined;
const matches = [];
do {
const page = await client.crm.contacts.basicApi.getPage(100, after, ['lifecyclestage']);
matches.push(...page.results.filter(c => c.properties.lifecyclestage === 'customer'));
after = page.paging?.next?.after;
} while (after); // Could be hundreds of pages
// AFTER: 1 search call with server-side filtering
const results = await client.crm.contacts.searchApi.doSearch({
filterGroups: [{
filters: [{ propertyName: 'lifecyclestage', operator: 'EQ', value: 'customer' }],
}],
properties: ['email', 'firstname'],
limit: 100, after: 0, sorts: [],
});
```
#### Cache Pipeline and Property Metadata
```typescript
// Pipelines and properties change rarely -- cache for 1 hour
// This saves 2 API calls per deal creation if you look up stage IDs
// BEFORE: 2 calls every time
const pipelines = await client.crm.pipelines.pipelinesApi.getAll('deals');
const properties = await client.crm.properties.coreApi.getAll('deals');
// AFTER: 2 calls per hour (from cache)
const pipelines = await getCachedPipelines('deals'); // see performance-tuning skill
```
#### Use Webhooks Instead of Polling
```typescript
// BEFORE: Poll for changes every 60 seconds (1,440 calls/day)
setInterval(async () => {
const recent = await client.crm.contacts.searchApi.doSearch({
filterGroups: [{
filters: [{
propertyName: 'lastmodifieddate',
operator: 'GTE',
value: String(Date.now() - 60000),
}],
}],
properties: ['email'], limit: 100, after: 0, sorts: [],
});
processChanges(recent.results);
}, 60000);
// AFTER: 0 polling calls (HubSpot pushes changes to you)
// Set up webhook subscription for contact.propertyChange
// See hubspot-webhooks-events skill
```
### Step 4: Usage Dashboard Query
```sql
-- Track API usage if you log calls to a database
SELECT
DATE_TRUNC('hour', called_at) as hour,
endpoint,
COUNT(*) as calls,
COUNT(*) FILTER (WHERE status_code = 429) as rate_limited,
AVG(response_ms) as avg_latency_ms
FROM hubspot_api_log
WHERE called_at >= NOW() - INTERVAL '24 hours'
GROUP BY 1, 2
ORDER BY calls DESC;
```
## Output
- API call volume tracked and monitored
- Batch operations replacing individual calls (100x reduction)
- Search replacing list+filter patterns
- Webhooks replacing polling (1,440 calls/day saved)
- Metadata cached to avoid redundant lookups
## Error Handling
| Issue | Cause | Solution |
|-------|-------|----------|
| Daily limit hit | Unoptimized code | Apply batch + cache + webhook patterns |
| All apps blocked | Shared portal limit | Identify heaviest caller, optimize |
| No visibility | No tracking | Add usage counter middleware |
| Sudden spike | New feature deployed | Review new code for N+1 patterns |
## Resources
- [HubSpot API Usage Limits](https://developers.hubspot.com/docs/guides/apps/api-usage/usage-details)
- [HubSpot Pricing](https://www.hubspot.com/pricing)
- [Batch Operations Guide](https://developers.hubspot.com/docs/guides/api/crm/understanding-the-crm)
## Next Steps
For architecture patterns, see `hubspot-reference-architecture`.Related Skills
workhuman-performance-tuning
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
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
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
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
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
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
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
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
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
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
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
Veeva Vault cost tuning for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva cost tuning".