Overview
How might we design pre-task cost estimate so people can trust and act on AI output?
When this pattern fits
- Essential for AI coding agents, research agents, and long-running automation where forecasting cost and duration before execution prevents budget overruns and sets honest expectations.
When to skip or lighten it
- Tiny free-tier completions where estimates would add noise.
- Tasks too unpredictable for any honest range (say so, do not fake precision).
- Fully admin-metered enterprise seats where end users never see cost.
States
State model coming soon
Key UX elements
Key UX elements coming soon
Anti-patterns to avoid
Point estimates with no range or confidence.
Hiding that tool calls or retries can multiply cost.
Starting the run before the user acknowledges the estimate.
Estimates that ignore cached or already-paid context.
How products use it
| Product | Implementation |
|---|---|
| Cursor | Usage and plan cues around agent and model runs. |
| Claude Code | Usage panels that surface spend during sessions. |
| OpenAI platforms | Token and dollar estimates in playgrounds and billing UIs. |
| Devin-style agents | Task scoping with expected duration and resource hints. |
Implementation
Copy this prompt to generate a production-ready implementation in Cursor, Claude Code, Lovable, or any AI coding agent.
Generate a production-ready implementation of the "Pre-Task Cost Estimate" AI interface design pattern.
Pattern Definition:Frequently asked questions
What should a pre-task cost estimate include?
Expected token or dollar range, time range, and major cost drivers (tools, long context, image gen). Offer proceed, reduce scope, or cancel.
How accurate must it be?
A honest range beats a fake exact number. Update the estimate if the plan expands mid-run.
How does this relate to running meters?
Pre-task estimate is the forecast before start. Running meters track live spend during execution.
How does this relate to hard budget ceilings?
Estimates inform consent. Ceilings enforce a stop when spend hits a cap, even if the user confirmed the estimate.