Skip to content
Betav0.62.0
All articles

Keep AI spend in check with per-person budgets and SpanDock Mind

Turn on the SpanDock model proxy, give each person a budget, choose what happens at the limit, and see what was spent and saved.

By The SpanDock team

4 min read

This guide turns on the SpanDock model proxy, sets a per-person budget, and decides what happens when someone reaches it. It is for engineering managers and administrators who pay for model API usage and want spending to be predictable without stopping people from working. You can also let SpanDock Mind, SpanDock's model advisor, pick a cheaper model when it is good enough.

What the model proxy does

With the model proxy on, SpanDock sits between your AI tools and the model providers. The server decides which model answers each call and records what it cost. Everything is configured on the server under Model routing, where the server can:

  • swap models with rules, for example sending Claude Code's Opus requests to Sonnet;
  • let SpanDock Mind pick a model for each new conversation;
  • keep each person within a budget.

For each call, the server decides in this order:

  1. The budget. Over the limit, the call is handled the way you chose.
  2. The conversation's earlier choice. A conversation keeps its model for 6 hours, so the model doesn't change mid-task.
  3. The first matching rule.
  4. SpanDock Mind, if it is on.
  5. The requested model, unchanged.

The budget comes first, so a limit holds whatever the rules or SpanDock Mind would otherwise choose.

Prerequisites

  • A SpanDock server. The model proxy is in every plan; budgets and SpanDock Mind are on Standard and up, and routing rules on Premium and up. See Licensing and activation for plans and the trial.
  • Provider API keys for the models your team uses.
  • Clients paired to the server (Pairing clients).

Only API-key traffic is routed. Claude Pro and Max sign-ins aren't used while the proxy is on, so people who rely on a subscription sign-in should know before you switch it on for them.

Step 1: add provider keys on the server

Calls through the proxy use the server's provider keys, set under Settings → AI assistant. The keys stay on the server, in the OS credential store. Tools on the clients authenticate only with a local proxy key that SpanDock sets up for them, so nobody on a client holds a provider key.

Step 2: turn the proxy on

The proxy runs on the server, and each computer opts in:

  • On one computer, turn on Settings → Model proxy.
  • For clients, turn it on from the server under Clients → Client defaults, or select clients and choose Edit settings.

Claude Code is then pointed at SpanDock automatically. Codex can be pointed at it with the snippet SpanDock shows.

Step 3: set per-person budgets

Budgets are per person. Assign clients to people first: a client that isn't assigned counts as its own person, so someone with two computers would otherwise get two budgets.

Each budget has a period (a day, a week or a month) and a limit. Spend is the total cost of the calls that went through the proxy, including SpanDock Mind's own cost.

Two thresholds shape what happens as spending grows:

  • Near the limit (80% of it), or when spending is ahead of pace, only models cheaper than the requested one are used.
  • Over the limit, you choose what happens.

Step 4: choose what happens at the limit

There are three options:

  • Block. Calls are blocked. This gives the firmest cap, but it can stop someone in the middle of their work.
  • Cheapest model. Calls go to the cheapest model. Work continues at a lower cost, possibly with lower quality.
  • Flag. Calls go through and are flagged. Spending isn't capped, but you can see who went over and follow up.

A sensible way to start is flag, so you learn what normal spending looks like for your team, then move to cheapest model or block once the limits reflect real use.

Step 5: turn on SpanDock Mind (optional)

SpanDock Mind looks at the start of a conversation, the person's budget and the candidate models, and chooses a cheaper model when it is good enough. It runs after the budget, the conversation's earlier choice and your rules, so rules you write always take precedence. Its cost is recorded and counts towards spend.

Verify it works

Every call through the proxy records the requested model and the model that answered, how the choice was made (rule, SpanDock Mind, budget, or unchanged), tokens, cost, savings, and SpanDock Mind's cost.

  1. On a client with the proxy on, use Claude Code as usual.
  2. Open Activity or Sessions on the server and find the calls. Check the requested and answering model and how the choice was made.
  3. Open Model routing for the month's summary, including savings.
  4. Open Models for the model cost leaderboard. It ranks the models your tools used by spend, tokens, calls, speed, reliability or cost per million tokens, and shows how each moved since the previous period.

Troubleshooting

  • Calls don't appear as proxied. Check that the proxy is on for that computer, under Settings → Model proxy or the client's settings on the server.
  • Someone's subscription stopped working. Claude Pro and Max sign-ins aren't used while the proxy is on. Only API-key traffic is routed.
  • Costs are marked as estimated. Many tools report tokens but not cost. SpanDock then estimates the cost from a price catalogue; you can set your own prices under Settings → Model prices.

Next steps

Cookie categories

Details: Cookie Policy.