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".
What this skill does
# 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
- [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 in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.