The complete cost playbook for e-commerce owners running AI agents — stop bleeding money on unnecessary token spend and run a lean, powerful operation.
The single most impactful cost rule: if a task is just "run this command," use exec. Don't pay an LLM to do it.
AI agent platforms have two ways to do work:
| Task | Before (AgentTurn) | After (Exec) | Savings |
|---|---|---|---|
| Pull daily sales data | ~$3/run | $0 | $3/run |
| Site health check (every 30 min) | ~$2/run | $0 | $96/day |
| Pull ad performance metrics | ~$4/run | $0 | $4/run |
| Scrape competitor prices | ~$5/run | $0 | $5/run |
| Pull email campaign stats | ~$3/run | $0 | $3/run |
| Pull inventory levels | ~$2/run | $0 | $2/run |
List every recurring task in your system. For each one, ask: "Is this collecting data, or analyzing data?"
If it's collecting data, write a bash script. Here's the pattern:
#!/bin/bash # Pull daily sales from Shopify API — Cost: $0 RESPONSE=$(curl -s -H "X-Shopify-Access-Token: $SHOPIFY_TOKEN" "https://your-store.myshopify.com/admin/api/2024-01/orders.json") echo "$RESPONSE" > /tmp/daily-sales-$(date +%Y-%m-%d).json echo "Done: $(echo $RESPONSE | jq '.orders | length') orders"
Only use the LLM for the part that actually needs intelligence — interpreting the data, making recommendations, writing insights.
Not every task needs your most expensive model. Match the model to the job.
Think of it like hiring. You don't pay a senior strategist to file paperwork. You don't hire an intern to redesign your business model. Match the skill level (and cost) to the task.
Data collection, health checks, API calls, scraping, monitoring thresholds. If a script can do it, a script should do it.
Routine monitoring, simple formatting, status reports, template responses, standard customer inquiry categorization.
Deep analysis, strategy, complex reasoning, creative work, anomaly investigation, cross-channel performance synthesis.
Every bloated session is money on fire. This is the cost killer most people don't even know about.
Every message in a conversation adds to the context window. The more context, the more tokens processed per message, the more you pay. A fresh session with 10K tokens? Cheap. A bloated session with 200K tokens? $15–25 per session.
"We're at 50% context. Time to summarize and clear." This is the mandatory trigger point.
Write key decisions, action items, and important context to a memory file before clearing.
Start a new session. Pull only relevant context from the memory summary. Lean sessions = cheap sessions.
| Context Level | Cost Per Interaction | Typical Session Total |
|---|---|---|
| 25% (50K tokens) | Low | ~$3–5 |
| 50% (100K tokens) | Medium | ~$8–12 |
| 75% (150K tokens) | High | ~$12–18 |
| 100% (200K tokens) | Maximum | ~$15–25 |
/agents/<agent-name>/memory/ 2026-04-24.md ← Today's context summaries 2026-04-23.md ← Yesterday's 2026-04-16.md ← Last week When session resets: agent writes what matters to memory. New session: reads only relevant recent memory files.
Your automated jobs are either your biggest cost saver or your biggest cost center. Design them right.
Every 30 minutes:
~$4/run × 48 runs/day = $192/day
Every 30 minutes:
~$0/run normally · ~$5–10/day total
Before ANY task runs — cron, sub-agent, multi-step workflow — calculate the cost first. This prevents surprise bills.
Identify the tier: Free / Cheap / Premium. This is your cost ceiling.
~80K input + ~5K output for a typical analysis task. Multiply by model cost per token.
Double-check: does this actually require LLM reasoning, or is this a script job in disguise?
Commit to a number before running. If it's over your gate threshold — stop.
Sub-agents are powerful, but each one is a new session with its own token costs. Never spawn sub-agents on your most expensive model unless explicitly approved.
Three sub-agents on a premium model = 3× the cost. Three sub-agents on a cheap model = a fraction of one premium session.
Hard spending cap: $10/hour across ALL agents. No exceptions. This is the safety net. Even if every other rule fails, this cap prevents catastrophic spending.
| Category | Before | After | Savings |
|---|---|---|---|
| Data collection crons (28+ jobs) | $85–120/day | $0/day | 100% |
| Analysis & reporting | $25–40/day | $5–8/day | 75% |
| Ad hoc agent tasks | $15–30/day | $3–5/day | 80% |
| Sub-agent spawns | $10–20/day | $1–2/day | 90% |
| Session bloat waste | $20–40/day | $0/day | 100% |
| Total | $155–250/day | $9–15/day | ~93% |
Monthly AI spend: $4,650–7,500
Annual AI spend: $55,800–90,000
Daily average: $155–250/day
Monthly AI spend: $270–450
Annual AI spend: $3,240–5,400
Annual savings: $50,000–85,000
| Agent Role | Before | After | What Changed |
|---|---|---|---|
| Sales monitoring | $450/mo | $15/mo | Moved data pulls to scripts |
| Ad performance | $380/mo | $25/mo | Scripts for collection, LLM for weekly analysis |
| Customer service | $200/mo | $60/mo | Template responses on cheap model |
| Competitive intel | $350/mo | $30/mo | Scraping via scripts, analysis on schedule |
| Content/creative | $250/mo | $80/mo | Premium model justified — creative work needs it |
| Site monitoring | $300/mo | $0/mo | 100% bash scripts now |
| All agents total | ~$5,000/mo | ~$350/mo | 93% reduction |
Print this. Review it every time you set up a new agent or cron job.
This playbook isn't theoretical. These are the exact rules running in our system right now, managing 10+ AI agents for an eight-figure e-commerce brand. They were born from real incidents — $100 days, duplicate runs, runaway API scrapes, bloated sessions.
Every rule exists because we broke something first.
Start with Rule #1 (Exec vs AgentTurn). Audit every task in your system and ask: "Does this need an AI to think about it?" You'll find that 60%+ of your tasks don't. Move those to scripts. That alone will cut your costs in half.
Then layer in the other rules one at a time. Within a week, you'll have a system that's just as capable but costs 90% less to run.
Join THE AI INCOME LAB — free community where e-commerce business owners share how they're running AI-powered operations that actually make money.
Join Free →