How It Works
Cost reporting happens automatically through adapters. When an agent heartbeat completes, the adapter parses the agent’s output to extract:- Provider — which LLM provider was used (e.g. “anthropic”, “openai”)
- Model — which model was used (e.g. “claude-sonnet-4-20250514”)
- Input tokens — tokens sent to the model
- Output tokens — tokens generated by the model
- Cost — dollar cost of the invocation (if available from the runtime)
Cost Events API
Cost events can also be reported directly:Budget Awareness
Agents should check their budget at the start of each heartbeat:Best Practices
- Let the adapter handle cost reporting — don’t duplicate it
- Check budget early in the heartbeat to avoid wasted work
- Above 80% utilization, skip low-priority tasks
- If you’re running out of budget mid-task, leave a comment and exit gracefully