AI · Cost optimization

AI API cost optimization: same answers, smaller bill

Most LLM bills grow from a few habits: the biggest model for every call, the same long prompt sent without caching, context nobody trims. We find them in your usage data and fix them, starting with the changes that carry the least risk to quality.

Get a cost audit

When the monthly OpenAI or Anthropic invoice starts to matter, the cause is usually visible in the usage data: which feature calls which model, how many tokens each request carries, how much of it repeats. We audit that, then apply the levers in order of risk: prompt caching and trimming context first, routing simple requests to a cheaper model next, the batch API for anything that does not need an instant answer, and only then, if volume justifies it, moving inference to your own GPUs. That last step took Nocodo from $10,000 to $2,000 a month. We hold our own website assistant to the same discipline.

What a cost optimization engagement includes

A usage audit: spend by model and token type from provider dashboards, and by feature from your application logs
Prompt caching and context trimming
Model routing: a smaller model for simple requests, the large one where it earns its price
The batch API for work that can wait, at a lower price per token
Output limits and sensible retries, so failed requests are not repeated blindly at full price
A test set from your real requests, so every saving is checked against answer quality
Self-hosted inference (vLLM behind LiteLLM) when volume makes GPUs cheaper than tokens
A monthly cost dashboard with alerts

Tools we work with

OpenAI APIAnthropic Claude APILiteLLMvLLMOllamaPythonGrafanaPrometheusPostgreSQLDockerKubernetes

AI API cost optimization - FAQ

When does moving to our own GPUs pay off?+

When volume is high and steady. Per-token APIs usually win for low or spiky traffic, while a rented GPU server costs about the same busy or idle. We calculate the break-even for your traffic before recommending it; the method is in on-prem LLM cost vs cloud API.

Will answer quality drop?+

We check rather than hope. We build a small test set from your real requests and run every change against it; a change that saves money but loses answers is rolled back. Prompt caching does not change what the model is asked, only what you pay for the repeated part, which is why it comes first.

How much can we save?+

It depends on how the bill is built, so we give a number after the audit, not before it. For reference, Nocodo cut its AI spend by 80% by moving from the OpenAI API to an on-premises model.

What access do you need?+

For the audit we start with usage data from provider dashboards and API logs, and ask for application logs where a feature's cost is not visible otherwise. For the fixes we work in your repository or alongside your developers, whichever suits your team.

How much does it cost?+

€65/hour. The audit has a fixed estimate agreed upfront; implementation is estimated per lever, so you can stop after the ones with the best return. See pricing.

Explore further

Your AI bill grows faster than your usage?

Send us a month of usage data. We will show where the money goes and which fixes pay back first. €65/hour, fixed estimate for the audit.