Cost per Task: The Unit Economics of Every AI Request
LLM cost per task is the unit economics of AI. Learn how to compute real cost per request, find the expensive tasks, and cut waste.
Teams track total AI spend but almost nobody tracks cost per task — and without unit economics you cannot know what is expensive. A $400 monthly bill hides the real question: which of your fifty task types burns $250 of it?
Cost per task is the number that answers that. This guide shows the calculation, the per-task ledger, and the five levers that drop the unit cost. LayerFlow's cost tracking builds the ledger automatically; pricing shows how attribution works.
The calculation
Cost per task equals input tokens times input rate, plus output tokens times output rate, plus reasoning tokens when present, plus any caching premiums — converted to dollars, then divided by the number of completed tasks. Include latency cost if a slow answer blocks the team or the user.
Real example: a task uses 2,000 input and 800 output tokens. On a model at $15 input and $75 output per million tokens, that is 0.002 times 15, plus 0.0008 times 75 — about $0.09. On a fast small model, the same task costs roughly $0.02, about 78% less, for often-comparable output.
The per-task ledger
Keep a running ledger of cost per task type per week: task name, model used, average tokens, cost per run, runs per week, weekly cost, and quality score. Three weeks of data exposes the Pareto curve — typically 80% of spend in 20% of task types.
The five levers that drop unit cost
- Route by complexity: move tier-1 tasks off frontier models (40-85% savings).
- Compress context: a 5,000-token prompt becomes 1,000 without losing signal.
- Right-size output: stop requesting 4,000 tokens when the answer is 200.
- Cache repeats: cached input tokens for stable instructions cost a fraction.
- Batch cheap work: batch APIs for non-urgent tasks cut rates substantially.
Common mistakes
- Comparing model prices without comparing output tokens used.
- Ignoring reasoning tokens — they appear on newer models and are easy to miss.
- Forgetting rework: a cheap prompt that fails half the time is not cheap.
- Tracking cost but not task type, so the bill hides the culprit.
Internal next steps
Build on AI API Token Management Playbook and Token Cost Optimization Guide. For budgets, read Hard Budgets for AI Teams.
Start your ledger: sign in to LayerFlow and let cost tracking attribute spend per task type, or check pricing first.
FAQ
How do you calculate cost per LLM task?+
Multiply input tokens by input rate and output tokens by output rate (plus reasoning tokens and caching premiums), convert to dollars, and divide by completed tasks. Include latency cost and rework in a full unit-economics view.
What is a reasonable cost per AI task?+
Formatting and extraction should run under a penny; code review and summarization a few cents; frontier reasoning tasks are counted in tens of cents. The right number is task-dependent — compare yours against a routed baseline.
Why is my AI bill so high?+
Look at the ledger: usually 80% of spend lands in 20% of task types, and the expensive ones are over-specified models, bloated context, oversized output limits, or ignored rework.
Related posts
Aug 7, 2026 · Cost control
AI API Token Management: The Complete PlaybookThe complete AI API token management playbook: track tokens per project and model, set budgets, and avoid surprise bills with practical workflows.
Jul 30, 2026 · Cost control
Token Cost Optimization Guide for GPT, Claude, and GeminiPractical token cost optimization: shorter prompts, cheaper models, caching patterns, and routing strategies that cut LLM spend.
Aug 23, 2026 · Cost control
How to Estimate LLM Cost Per Month: Usage Math and BudgetingEstimate LLM cost per month with real usage math: token volumes, input/output pricing, caching, forecasting, and how to set hard budget caps.