salesforce-cost-tuning
Optimize Salesforce costs through API call reduction, edition selection, and license management. Use when analyzing Salesforce costs, reducing API consumption, or choosing the right Salesforce edition for your integration needs. Trigger with phrases like "salesforce cost", "salesforce pricing", "reduce salesforce costs", "salesforce license", "salesforce API usage", "salesforce budget".
Best use case
salesforce-cost-tuning is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Optimize Salesforce costs through API call reduction, edition selection, and license management. Use when analyzing Salesforce costs, reducing API consumption, or choosing the right Salesforce edition for your integration needs. Trigger with phrases like "salesforce cost", "salesforce pricing", "reduce salesforce costs", "salesforce license", "salesforce API usage", "salesforce budget".
Teams using salesforce-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/salesforce-cost-tuning/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How salesforce-cost-tuning Compares
| Feature / Agent | salesforce-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 Salesforce costs through API call reduction, edition selection, and license management. Use when analyzing Salesforce costs, reducing API consumption, or choosing the right Salesforce edition for your integration needs. Trigger with phrases like "salesforce cost", "salesforce pricing", "reduce salesforce costs", "salesforce license", "salesforce API usage", "salesforce 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
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
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 Agents for Marketing
A curated list of the best AI agents and skills for marketing teams focused on SEO, content systems, outreach, and campaign execution.
SKILL.md Source
# Salesforce Cost Tuning
## Overview
Optimize Salesforce costs by reducing API call consumption, choosing the right edition, and monitoring API usage budgets. Salesforce charges per-user licenses (not per-API-call), but API limits are tied to edition + license count.
## Prerequisites
- Access to Salesforce Setup > Company Information
- Understanding of current API usage patterns
- Access to contract/license details
## Instructions
### Step 1: Understand Salesforce Pricing Model
| Edition | Per-User/Month | API Calls/Day (Base) | Per-User API Calls |
|---------|---------------|---------------------|-------------------|
| Developer | Free | 15,000 | N/A (1 user) |
| Essentials | ~$25 | 15,000 | +1,000/user |
| Professional | ~$80 | 15,000 | +1,000/user |
| Enterprise | ~$165 | 100,000 | +1,000/user |
| Unlimited | ~$330 | 100,000 | +5,000/user |
| API Add-on Pack | Varies | +200K-10M/day | Per org |
**Key insight:** API calls are per-org, not per-user. A 50-user Enterprise org gets 100,000 + (50 * 1,000) = 150,000 daily API calls. All integrations share this pool.
### Step 2: Monitor Current Usage
```typescript
const conn = await getConnection();
const limits = await conn.request('/services/data/v59.0/limits/');
const apiUsage = {
daily: {
used: limits.DailyApiRequests.Max - limits.DailyApiRequests.Remaining,
remaining: limits.DailyApiRequests.Remaining,
max: limits.DailyApiRequests.Max,
percentUsed: ((limits.DailyApiRequests.Max - limits.DailyApiRequests.Remaining) / limits.DailyApiRequests.Max * 100).toFixed(1),
},
bulk: {
ingestJobs: limits.DailyBulkV2QueryJobs,
queryJobs: limits.DailyBulkV2QueryJobs,
},
storage: {
dataMB: `${limits.DataStorageMB.Max - limits.DataStorageMB.Remaining}/${limits.DataStorageMB.Max} MB`,
fileMB: `${limits.FileStorageMB.Max - limits.FileStorageMB.Remaining}/${limits.FileStorageMB.Max} MB`,
},
};
console.log('API Usage:', JSON.stringify(apiUsage, null, 2));
```
### Step 3: Reduce API Call Count (Biggest Cost Lever)
```typescript
// BEFORE: 1 API call per record = expensive
for (const contact of contacts) {
await conn.sobject('Contact').create(contact); // 1000 calls for 1000 records
}
// AFTER: Batch with sObject Collections = 5 calls for 1000 records
for (let i = 0; i < contacts.length; i += 200) {
const batch = contacts.slice(i, i + 200);
await conn.sobject('Contact').create(batch); // Max 200 per call
}
// AFTER: Use Bulk API for 10K+ records = 1 job regardless of count
await conn.bulk2.loadAndWaitForResults({
object: 'Contact',
operation: 'insert',
input: csvData, // Can be millions of rows
});
// Bulk API has its own separate daily limit (15,000 jobs)
// Cache describe calls — saves 50+ calls/day if you describe objects frequently
const describeCache = new Map();
async function cachedDescribe(objectName: string) {
if (!describeCache.has(objectName)) {
describeCache.set(objectName, await conn.sobject(objectName).describe());
}
return describeCache.get(objectName);
}
```
### Step 4: API Call Budget Tracking
```typescript
class ApiCallBudget {
private dailyBudget: number;
private callsToday = 0;
constructor(dailyBudget: number) {
this.dailyBudget = dailyBudget;
}
async refreshFromOrg(conn: jsforce.Connection): Promise<void> {
const limits = await conn.request('/services/data/v59.0/limits/');
this.callsToday = limits.DailyApiRequests.Max - limits.DailyApiRequests.Remaining;
// Note: this call itself costs 1 API call — don't check too frequently
}
canSpend(estimatedCalls: number): { allowed: boolean; reason?: string } {
const projected = this.callsToday + estimatedCalls;
if (projected > this.dailyBudget * 0.95) {
return { allowed: false, reason: `Would exceed 95% of ${this.dailyBudget} daily budget` };
}
if (projected > this.dailyBudget * 0.80) {
console.warn(`API budget warning: ${this.callsToday}/${this.dailyBudget} used`);
}
return { allowed: true };
}
}
```
### Step 5: Edition Right-Sizing
```
Decision tree for Salesforce edition:
If API calls/day < 15,000:
→ Developer Edition (free) or Professional ($80/user/month)
If API calls/day 15,000-150,000:
→ Enterprise Edition ($165/user/month)
If API calls/day > 150,000:
→ Unlimited ($330/user/month) or API Add-on Pack
→ OR reduce calls with batching/caching (usually cheaper)
If you need just data sync:
→ Consider Heroku Connect ($$$) for automatic bi-directional sync
→ Eliminates most API calls — data syncs via Change Data Capture
```
## Output
- Current API usage analyzed
- Cost reduction strategies applied (batching, caching, Bulk API)
- API call budget tracking implemented
- Edition recommendation based on usage
## Error Handling
| Issue | Cause | Solution |
|-------|-------|----------|
| Unexpected API call spike | Unoptimized loop/query | Use Collections or Bulk API |
| Budget exceeded | Missing monitoring | Add budget tracking class |
| Storage limit | Too many records/files | Archive old data, delete test data |
| License overspend | Unused integration licenses | Audit active users quarterly |
## Resources
- [Salesforce Editions & Pricing](https://www.salesforce.com/editions-pricing/overview/)
- [API Request Limits by Edition](https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_api.htm)
- [Limits REST Resource](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_limits.htm)
## Next Steps
For architecture patterns, see `salesforce-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".