Scrivio Interview library
LeadershipAdvanced6 min read · updated 12 November 2026

AI spend across your organisation is growing fast without clear value tracking. How would you manage it?

I would first make spend visible: every model call goes through a shared gateway or client library that tags it with team, feature and model, so we know who spends what. Then each feature must name the value it delivers and we compare that with its cost; budgets, alerts and rate limits stop surprises; shared guidance shows teams the cheaper patterns; and contracts are negotiated centrally and reviewed against value every quarter.

Why this question is asked

When AI adoption grows quickly, the bill usually arrives before the understanding of what it buys. A finance team sees one large invoice from a provider, nobody can say which features caused it, and the reaction is often a blanket freeze that hurts the useful work along with the wasteful. Interviewers ask senior engineers this question to see whether they can bring order without killing momentum. In this answer, we will walk through the situation, then go through attribution, value tracking, guardrails, shared guidance and central contracts, with the reasoning a senior leader uses for each.

1Understanding the Situation

Imagine twelve teams calling three providers with their own API keys. The monthly bill has grown from 20,000 to 140,000 dollars in six months. Some of it is a customer support assistant that clearly saves agent time. Some of it is an internal experiment that nobody switched off, and some is a batch job that reprocesses every document every night. Without data, we cannot tell these apart, so any decision we make now is a guess.

The goal is not to spend less at any price. The goal is to spend on things that pay back and to stop the things that do not. That means we need two numbers for every feature, its cost and its value, and a routine that looks at both.

2Make Every Call Attributable

The first step is technical. All model calls go through one path we control: either an internal AI gateway, a service that proxies requests to providers, or a shared Java client library, typically a Spring Boot starter built on Spring AI. Either way, every call is tagged with the team, the feature, the model and the environment, and the token counts are recorded as metrics. Provider keys are issued to the gateway, not to teams, so a call cannot bypass the tags.

Notice why we do this before anything else. With tags, the 140,000 dollars becomes a table: support assistant 48,000, document summaries batch 37,000, a forgotten experiment 9,000. The conversation with each team changes from a general warning to a specific question about their number.

Java
// In the shared starter: every ChatClient built by teams gets the same advisor
@Bean
ChatClientCustomizer costTagging(MeterRegistry registry, AppIdentity app) {
return builder -> builder.defaultAdvisors(new UsageAdvisor(registry, app.team(), app.feature()));
}
// Metric emitted per call:
// ai.tokens{team="support", feature="assistant", model="large-v2", type="input"} 9120
Step throughWhere spend control lives
  1. Teams' servicesbuild features with the shared starter
  2. Shared client or gatewaytags team, feature, model; rate limits
  3. Metrics and cost storetokens times price per model
  4. Budgets and reportsalerts per team, quarterly value review
  5. Providerscontracts negotiated centrally

5 layers, from the top down. Step through them one at a time.

Spring AI already records token usage through Micrometer observations; the shared starter adds the business tags that the provider cannot know, such as team and feature.

3Ask Each Feature What Value It Moves

Cost alone tells us nothing about whether to keep a feature. So every AI feature states the metric it is meant to move: tickets deflected, minutes saved per case, conversion on a product page, documents processed per analyst hour. The team measures it, ideally with a comparison group, and we put it next to the cost. A support assistant that costs 48,000 dollars a month but deflects 12,000 tickets worth 5 dollars each is clearly worth it. A summary job that costs 37,000 dollars and that nobody reads is not.

This is also where we are fair to experiments. A new feature gets a time-boxed budget to find its value, say three months. After that it either shows a number or it gets switched off or redesigned.

4Budgets, Alerts and Rate Limits

Budgets give each team a monthly amount with alerts at 50, 80 and 100 percent, so overruns are seen within days. Rate limits at the gateway protect against the failures that create the largest bills: an agent stuck in a tool-calling loop, a retry storm during an outage, or a public endpoint being abused. A per-user and per-feature token limit per minute turns a potential 30,000 dollar weekend into a paged engineer on Saturday morning.

The reason for alerts rather than hard stops in most cases is that a hard stop takes a customer-facing feature down. We use hard caps for experiments and batch jobs, and alerts plus human decision for production features.

5Publish the Cheaper Patterns

Most waste comes from teams not knowing the options, not from carelessness. The platform team publishes guidance with examples: route simple steps to small models, limit retrieved context and chat history, put stable prompt text first so provider prompt caching applies, cache repeated answers, and use the providers' batch APIs for offline work such as nightly classification, which are often around half the price in exchange for slower results. The shared starter makes the right choice the default, so a team gets a sensible memory window and token limit without thinking about it.

6Contracts and the Quarterly Review

Once spend is visible and grouped, we can negotiate as one customer instead of twelve. Committed-use discounts, private deployments and data terms are agreed centrally, and the gateway lets us move traffic between providers when prices change. Every quarter, engineering, finance and product leads review the table of features with cost and value side by side, decide what to grow, what to optimise and what to stop, and adjust budgets. The review is what turns the data into decisions.

Step throughQuarterly review of one feature
  1. Read cost and value for the quarter
  2. Value clearly above cost?
    YesKeep; consider more budgetNoNext question
  3. Can a cheaper pattern close the gap?
    YesOptimise with a deadlineNoStop or redesign

3 steps in order. Play them, or step through them one at a time.

7Follow-up questions

How do you get teams to adopt the gateway?

Make it easier than going direct: provide the starter with good defaults, handle keys and provider contracts for them, and give them dashboards they could not build alone. Then make direct provider keys unavailable for production, so the paved road is also the only road.

What if a team cannot measure value yet?

Give it a time-boxed experiment budget and agree up front which metric it will try to move. If after the period there is still no measurable effect, we decide openly whether to stop or to redesign it.

Would you charge costs back to teams?

Showback first: every team sees its spend. Chargeback, where the cost hits their budget, works once the numbers are trusted, and it gives teams a natural reason to optimise.

8Conclusion

In this answer, we saw that managing AI spend starts with attribution: a shared gateway or client tags every call with team, feature and model. Each feature then names the value it moves so cost can be compared with benefit. Budgets, alerts and rate limits prevent runaway bills, published patterns and good defaults make cheap choices easy, and central contracts with a quarterly review turn the numbers into decisions about what to grow and what to stop.

What to say in the interviewAbout 80 seconds aloud

Open with

My first goal would be visibility, because without it every decision is a guess. I would route all model calls through a gateway or a shared Spring Boot starter built on Spring AI, which tags every call with team, feature and model and records tokens as metrics, and I would issue provider keys only to that path.

Then, if they want more

That turns one big invoice into a table per feature. Next, I would ask every feature to name the value it moves, such as tickets deflected or minutes saved, and put that next to its cost. Experiments get a time-boxed budget to prove value.

For protection, I would set budgets with alerts per team and rate limits per user and feature, because the biggest bills come from loops, retry storms and abuse. Then the platform team publishes the cheaper patterns, like model routing, context limits, prompt caching, answer caching and batch APIs for offline work, and bakes them into the starter as defaults.

Finally, I would negotiate contracts centrally and hold a quarterly review with finance and product where we look at cost against value and decide what to grow, optimise or stop.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Spring AI reference
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "AI spend across your organisation is growing fast without clear value tracking. How...": https://scrivio-interview-library.netlify.app/spring-boot/spring-ai/e6e93f797a/