Agent skill · marketing growth · jeremylongshore
apify-cost-tuning
Optimize Apify platform costs through memory tuning, compute unit
Why this skill is useful
Provides specific cost optimization strategies and scripts for managing Apify platform expenses that the AI wouldn't reliably generate on its own.
What it needs
Requires apify-client installed locally. Requires apify account access. About 3k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
Apify Cost Tuning Overview Apify charges on three axes: compute units (CU), proxy traffic (GB), and storage. One CU = 1 GB of memory running for 1 hour, so cost scales with both memory allocation and run duration. This skill walks the investigate → tune → guard loop that finds where spend is going, cuts it at the biggest lever (memory), and installs guardrails so it stays down. Full pricing tables (plan CU prices, proxy rates, storage rules) live in pricing-model.md. Prerequisites An Apify account with API access and APIFYTOKEN set in the environment. The apify-client package installed (npm install apify-client). At least one Actor with run history to analyze. Instructions The workflow is six steps. Each is summarized here with its core lever; the full, runnable code for every step is in implementation.md. 1. Analyze current costs — roll up the last N days of runs into total CU, USD, and duration, and surface the single most expensive run: 2. Reduce memory allocation (biggest lever) — sweep memory from 4096 MB down to 256 MB and stop at the first failure to find the sweet spot. Most CheerioCrawler Actors are over-provisioned. Sweet spots: simple Cheerio 256-512 MB, complex 512-1024 MB, Playwright 2048-4096 MB. 3. Optimize crawl duration — higher maxConcurrency, tighter requestHandlerTimeoutSecs, a maxRequestsPerCrawl cap, fewer retries, and selective enqueueLinks. Faster crawls consume fewer CUs. 4. Minimize proxy costs — prefer datacenter (free with plan), only reach for residential when a site blocks it, block images/fonts/CSS to save residential GB, and reuse proxy sessions with useSessionPool. 5. Cost guard for runaway Actors — start the run, poll usageTotalUsd every 30s, and .abort() once spend crosses a hard cap. 6. Monitor monthly usage — iterate every Actor's runs since the 1st of the month and print a cost-descending report so the top spenders are obvious. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/apify-cost-tuning