Budget & Cost Tracking
Agent HQ tracks the cost of every AI interaction, giving you visibility into spending.
How costs are calculated
Section titled “How costs are calculated”Every message and task execution consumes tokens — the units AI models use to process text. Costs are calculated as:
cost = (input_tokens × input_price) + (output_tokens × output_price)Different models have different pricing. More capable models (like Claude Opus 4.6 or GPT-4o) cost more per token than lighter models (like Claude Haiku 4.5 or Gemini Flash).
Per-task cost tracking
Section titled “Per-task cost tracking”Each task shows its cost:
- Input tokens — tokens sent to the model (your instructions + code context)
- Output tokens — tokens generated by the model (code + explanations)
- Cost in cents — the dollar cost of the task
This information is available in the task detail view.
Per-message tracking
Section titled “Per-message tracking”Individual chat messages also track token usage, so you can see the cost of each conversation turn.
Cost optimization tips
Section titled “Cost optimization tips”- Use lighter models for simple tasks — Haiku or Gemini Flash for quick fixes
- Write clear instructions — reduces back-and-forth and wasted tokens
- Set project instructions — gives Pilot context upfront, reducing the need for large code reads
- Use Cloudflare Workers AI — free models for experimentation
- Review before retrying — understand why a task failed before running it again