Back to Alchemy
Alchemy RecipeBeginnerguide

From Code to Ship Faster: How Development Teams Can Track and Optimise AI Assistant Spending

25 March 2026

Introduction

Development teams are shipping faster than ever with AI assistants, but speed comes with a cost. Every API call to Claude, GPT-4, or other large language models adds up quickly. Without visibility into spending, you might find your budget exhausted mid-sprint, or worse, discover you're paying for duplicate tooling across your team.

This guide walks you through setting up practical tracking and optimisation for AI assistant spending. We'll cover four tools that work together to give you control: Burnrate monitors your spending patterns in real time, Mutable AI helps you write and review code efficiently, Source AI identifies code that could be refactored or removed, and Windsurf lets you build faster whilst keeping costs visible. The goal is not to limit your team's productivity but to make informed decisions about where AI spend actually delivers value.

By the end, you'll know how to set up cost alerts, identify which team members or projects are burning through budget, and optimise your AI workflows before the bill arrives. This is particularly important if you're managing multiple projects, teams, or experimenting with different AI models across your organisation.

What You'll Need

Accounts and access:

  • A Burnrate account (free tier available, paid plans start at $10/month).

  • Mutable AI access (free tier supports up to 1,000 code generations per month).

  • Source AI account (free tier includes basic analysis).

  • Windsurf IDE installed on your development machines.

  • API keys from your primary language model providers (OpenAI, Anthropic, etc.).

  • Admin access to your team's development environment or CI/CD pipelines.

Budget planning:

Start by estimating your current spend. If your team makes 100 API calls per day at an average cost of $0.01 per call, that's roughly $30/month per developer. Five developers could run $150/month before tooling costs. These figures vary significantly based on model choice (GPT-4 is more expensive than GPT-3.5) and token usage, so baseline tracking is essential before optimisation.

Technical requirements:

You'll need basic familiarity with environment variables, webhook configuration, and reading logs. If your team uses GitHub, GitLab, or Slack, integration is straightforward. For teams on other platforms, you may need to write simple scripts to pass data to these tools.

Step-by-Step Setup

1.

Setting Up Burnrate for Spending Visibility

Burnrate is your central dashboard for understanding where money goes. Start by creating an account and linking your API keys.

Log in to Burnrate and navigate to the Integrations section. Add your OpenAI, Anthropic, or other model provider credentials. Burnrate will read your usage logs without storing your full keys.


export BURNRATE_API_KEY="your_burnrate_key_here"
export OPENAI_API_KEY="your_openai_key_here"
export ANTHROPIC_API_KEY="your_anthropic_key_here"

Once integrated, Burnrate will begin collecting data on your API calls. Check the dashboard after 24 hours; you should see a breakdown by model, date, and (if configured) by team member or project.

Setting up cost alerts:

Go to Settings, then Alerts. Create a threshold alert for $500/month. Burnrate will email you if projections exceed this amount. If you have multiple projects, create separate alerts per project to catch unexpected spikes early.


Example Burnrate webhook for Slack integration:
POST https://hooks.slack.com/services/YOUR/WEBHOOK/URL
{
  "text": "Burnrate Alert: Monthly spend projected at $450",
  "colour": "warning"
}

Configure this in Burnrate's webhook settings and select your Slack workspace.

2.

Integrating Mutable AI into Your Workflow

Mutable AI generates code quickly, but without tracking, it's easy to bloat your codebase with unused suggestions. The key is treating Mutable AI as a code generation tool you actively review, not a black box.

Install the Mutable AI extension in your IDE (VSCode, JetBrains, etc.). Create a workspace-level config file:


# .mutable.config.json in your project root
{
  "model": "gpt-4-turbo",
  "maxTokens": 500,
  "language": "typescript",
  "trackCost": true,
  "costAlertThreshold": 50
}

This configuration caps generated code to 500 tokens (roughly 125 words) per suggestion and enables cost tracking. Shorter generations are cheaper and often better quality because they force specificity.

Train your team to use Mutable AI for repetitive tasks: boilerplate, test scaffolding, and code reviews. Avoid asking it to generate entire modules; instead, break work into smaller chunks. A developer should review every suggestion, not treat it as gospel.

Set up a shared Slack channel where team members post Mutable AI stats weekly:


Weekly Mutable AI Report
User: alice@company.com
Generations: 42
Avg tokens per generation: 180
Estimated cost: $3.50

This creates peer accountability and lets you spot if anyone's using the tool excessively.

3.

Using Source AI to Identify Dead Code and Refactoring Opportunities

Source AI scans your repository and flags code that could be simplified, removed, or consolidated. This reduces the amount of code you need to maintain and, indirectly, the number of AI-assisted code reviews and rewrites.

Connect Source AI to your GitHub or GitLab repository:

  1. Authorise the Source AI app in your Git provider.
  2. Select your primary repositories.
  3. Run an initial analysis (this takes 5-10 minutes per 10,000 lines of code).

Review the report. Source AI typically identifies:

  • Dead imports and unused variables.

  • Duplicate functions that could be consolidated.

  • Overly long methods that should be split.

  • Test coverage gaps.

Export the report as a CSV and prioritise fixes by impact. Focus on functions used by multiple modules first; consolidating these saves the most ongoing maintenance.

Create a backlog ticket for each high-priority finding:


Title: Refactor UserAuth module - 3 duplicate validation functions
Description:
validateEmail() in auth.ts, validators.ts, and utils.ts all do the same thing.
Consolidate into a single function in auth.ts.
Source AI confidence: 95%
Estimated effort: 2 hours
Monthly AI cost savings post-refactor: ~$12

Run Source AI monthly to track progress and identify new issues introduced during development.

4.

Setting Up Windsurf for Efficient Code Pairing

Windsurf is an IDE that integrates AI assistance directly into your editor and shows cost estimates in real time. Unlike some AI assistants that hide the bill, Windsurf makes spending visible as you code.

Download Windsurf from the official site and install it on your machines. On first run, configure your API providers:


# Windsurf config file: ~/.windsurf/settings.json
{
  "ai.provider": "openai",
  "ai.model": "gpt-4",
  "ai.showCostEstimate": true,
  "ai.costAlertThreshold": 25,
  "editor.formatOnSave": true
}

The key setting is showCostEstimate: true. This displays the projected cost of each AI-assisted action (code completion, refactoring, review) before you commit to it. You'll quickly learn which operations are expensive and train yourself to use them judiciously.

Example workflow:

  1. You start typing a function; Windsurf suggests completions. The cost is shown as $0.01. You accept it.
  2. You highlight a block of code and ask Windsurf to refactor it. The cost estimate says $0.05. You review it first, accept it, cost is logged.
  3. At day's end, you've spent roughly $2-3 across 100+ interactions. Windsurf logs all of this to Burnrate.

Set up Windsurf to export usage logs daily:


# Windsurf export command (run via cron or CI/CD)
windsurf export-usage --format json --output logs/windsurf-usage-$(date +%Y%m%d).json

Parse these logs and feed them into Burnrate so you have a unified view of all AI spend across tools.

Tips and Pitfalls

Common mistakes to avoid:

  1. Ignoring small costs: A single API call might cost $0.001, but 10,000 calls add up to $10 quickly. Train developers to review AI suggestions critically; accept only what you'd actually use.

  2. Using expensive models by default: GPT-4 costs roughly 10x more than GPT-3.5. For routine tasks like code completion, use cheaper models. Reserve GPT-4 for complex logic and architecture decisions.

  3. Not setting budget alerts: Without alerts, you discover overspend at month-end. Set up weekly Slack notifications so surprises surface early.

  4. Treating AI as truth: AI assistants hallucinate. Every suggestion must be reviewed. This is especially critical for security-sensitive code, database migrations, and anything touching customer data.

  5. Forgetting to track: If you don't integrate Burnrate or similar tools, you're flying blind. Make tracking mandatory across your team by tying it into your CI/CD pipeline.

Best practices:

  • Use AI for code generation and refactoring, not business logic validation. Let tests confirm correctness.

  • Pair AI tools with code review. The second set of human eyes catches mistakes the AI misses.

  • Run Source AI quarterly to identify refactoring opportunities; these reduce long-term costs.

  • Review Burnrate dashboards in your weekly standup. Transparency keeps everyone accountable.

  • Experiment with different models in staging environments before committing to one for production use.

Cost Breakdown

ToolPlanMonthly CostNotes
BurnrateFree£0Basic tracking; recommended for small teams. Paid tier ($10/month) adds advanced analytics and webhooks.
BurnratePro£8Advanced alerting, historical data retention, team management.
Mutable AIFree£01,000 generations/month; suitable for testing.
Mutable AIPro£20Unlimited generations; analytics dashboard.
Source AIFree£0Monthly scans; 5 repositories. Basic reports.
Source AITeam£30Unlimited scans; automated weekly analysis; Slack integration.
WindsurfSubscription£12IDE + AI assistant. Includes cost tracking.
OpenAI APIPay-as-you-goVariableGPT-4 Turbo: ~$0.01 per 1,000 tokens (input). Varies by model and volume.
Anthropic APIPay-as-you-goVariableClaude 3 Opus: ~$0.015 per 1,000 tokens (input).

Example team budget (5 developers):

Assume 500 API calls/day per team at $0.01 average cost:

  • OpenAI/Anthropic API: ~$150/month
  • Burnrate Pro: £8
  • Mutable AI Pro: £20
  • Source AI Team: £30
  • Windsurf (5 seats): £60

Total: roughly £268/month or $340/month. Savings through Source AI refactoring and smarter model choice (GPT-3.5 instead of GPT-4 for routine tasks) could reduce this by 20-30%.

Summary

Tracking and optimising AI assistant spending doesn't mean limiting your team's tools; it means making conscious choices. Use Burnrate to see where money goes, Mutable AI to generate code efficiently, Source AI to reduce technical debt, and Windsurf to keep costs visible during development. Set up alerts, review weekly, and refactor regularly. Done right, you'll ship faster and spend less.