CDX-301e · Module 3

Cost-Per-Task Analysis

3 min read

Cost-per-task is the fundamental unit of cloud execution economics. It consists of three components: model cost (input + output tokens), compute cost (VM time), and overhead cost (boot time, dependency installation, git operations). For a typical 10-minute task, model cost is 60-80% of the total, compute cost is 15-30%, and overhead is 5-10%. The leverage is in model selection and task duration — a task that completes in 5 minutes on GPT-4.1 costs a fraction of the same task taking 15 minutes on o3-high.

When you multiply by parallelism, cost scales linearly. Ten parallel tasks cost 10x one task. Best-of-3 on five parallel tasks costs 15x. A daily batch of 50 tasks with best-of-2 costs 100x a single task. These multipliers are obvious in isolation but easy to miss when building automation. The discipline is to calculate the steady-state cost before deploying any automated batch workflow: tasks per day * cost per task * days per month = monthly cloud spend. Compare this to the value delivered — hours saved, bugs caught, quality improvement.

# Cost-per-task breakdown (illustrative)

Model: GPT-4.1
  Input tokens:    ~50K ($0.10)
  Output tokens:   ~10K ($0.04)
  Model subtotal:  $0.14

Compute:
  VM time:         8 minutes @ $0.02/min = $0.16
  Boot overhead:   30 seconds (included in VM time)
  Compute subtotal: $0.16

Total per task:    $0.30

# Cost multipliers
Best-of-3:         $0.90 per logical task
5 parallel tasks:  $1.50 per batch
Daily batch (50):  $15.00 per day
Monthly (22 days): $330.00 per month

# Optimization levers
- Model selection:  GPT-4.1 vs o3 = 3-5x cost difference
- Task scoping:     Smaller tasks = shorter VM time
- Cache hits:       Warm pools reduce boot overhead
- Retry reduction:  Better AGENTS.md = fewer failures

Do This

  • Calculate monthly cost projections before deploying automated batch workflows
  • Use GPT-4.1 for routine tasks and reserve o3 for tasks that genuinely need reasoning depth
  • Track cost per task type to identify which workflows deliver ROI and which are overpriced
  • Optimize failure rates first — eliminating retries is the highest-leverage cost reduction

Avoid This

  • Deploy batch automation without a budget — uncapped parallelism creates uncapped costs
  • Use the most expensive model for every task because "quality matters" — match model to task complexity
  • Ignore boot overhead — it is a fixed cost that dominates for short tasks
  • Forget that best-of-N multiplies the entire cost, not just the model cost