AI coding costs

How to cut AI coding costs without slowing down delivery

Measure cost per completed task. Trim the code you send, use a cheaper model for bounded work, and set a budget before giving a coding agent room to iterate.

Why coding bills started varying by task

In July 2025, Cursor clarified its changes to individual billing and offered refunds for unexpected charges during the transition. In April 2026, GitHub announced a June move from premium requests to AI credits calculated from token consumption. These are historical announcements, so check the current plan and the meter your team actually uses.

A short request can start a long agent session. Each additional round can resend context and tool results, and a larger model can cost more across retries. A cheap first request does little for your budget if it takes several attempts to reach a passing change.

“we will refund any unexpected charges you may have incurred for usage over the past 3 weeks”

Cursor pricing clarification, 4 July 2025

Build a baseline you can repeat

For example, spending a synthetic $18 to finish nine accepted changes costs $2 per accepted change. Spending $15 to finish only five costs $3 each. Use the same review rubric and include tool subscriptions and platform charges where they apply.

  1. Choose ten representative tasks such as adding a test, changing a UI component, fixing a bug across two services, and planning a migration. Write down what counts as done and hold that bar constant.
  2. Record input, output, caching, failed attempts and model switches where your tool exposes them. Track whether the resulting change passed tests and review.
  3. For mechanical edits, give the model the specific files and a focused test. Try a lower-cost model on the same task. Reserve higher-cost models for tasks where that tradeoff proves worthwhile.
  4. Cap spend at the workspace or provider level that actually sees the requests. Use narrower agent tasks, bounded retries and a stop condition when tests keep failing.

Apply controls on the path you own

A provider-managed subscription and a request sent using your own key can be billed through different paths. If your client supports a configurable API endpoint, you can route compatible requests through Spendplane to apply available budgets, track model usage and use your own provider key. Use the coding tool's own controls for traffic that stays on its managed service.

The Spendplane planner can model scenarios before rollout. Treat its results as estimates, and compare them with your own usage export after launch.

References

Practical guides