How we cut an AI agent's cost per run from $5 to under $1
One of our AI agent pipelines runs every day. It reads new government contract listings, checks each one against a company’s requirements, files the good ones in Jira and drafts a proposal for a person to review. Its first version cost about $5 per run.
This pipeline runs daily, so a cost like that grows every month. We brought it down to between $0.30 and $0.90 per run, which is 80 to 94% lower. It took three changes.
Where the money goes
Most language model APIs charge for the text you send in (input tokens) and the text you get back (output tokens). In an agent pipeline, input is usually the bigger part of the bill. Every step sends the instructions, the data and often the history of earlier steps. When a pipeline is first built, it’s common to give every agent everything, just in case.
That is where to look first.
1. Give each agent only what it needs
An agent that decides whether a contract qualifies needs the listing and the company’s requirements. It doesn’t need the attachments, the proposal template or the notes from yesterday’s run.
We trimmed each agent’s context down to what it uses for its own step. Everything else came out, and each call got much smaller.
A simple test: if you removed a piece of context and the agent’s answers didn’t change, that context was costing you money for nothing.
2. Cache what repeats
Some content is the same on every call: long instructions, the company’s requirements, reference facts for the proposal writer. Most model providers now offer prompt caching, which charges much less for input the model has seen recently.
To use it well, put the parts that don’t change at the start of the prompt and the parts that change (today’s listing) at the end. The cache then covers the stable part of every call.
3. Split the work across agents
One big agent that does everything has to carry everything. Several small agents, each with one job, carry much less.
In our pipeline, the agent that screens listings doesn’t write. The agent that drafts proposals doesn’t screen. Each one has a short, focused prompt, and the expensive drafting step only runs for listings that already qualified.
What stayed the same
The drafting agent still writes only from the company’s own facts and figures, and a person still reviews every draft before anything goes out.
Try this on your own agents
If you run an agent on a schedule, check three things this week:
- What each step sends to the model, and which parts of it the step uses
- Which parts of your prompts are identical on every call, and whether they’re cached
- Whether one agent is doing a job that two smaller ones could share
Our own product, Etlyst, went from about $3 to about $0.20 per run. If you’d like us to look at your pipeline, tell us about it.