How Much Does Tool Use in LLMs Cost?
Tool use lets an LLM call functions, search and run code, but every call adds tokens and turns. Here is what drives the cost and how to keep it under control.
On this page
Short answer
Tool use in LLMs costs the price of the tokens in every prompt and reply, plus the cost of each extra round trip the model makes to call a tool and read the result. A single user question can become three or four model calls, so the bill depends on how many tools run and how much context each one adds.
What is tool use in an LLM?
Tool use in an LLM is the ability of a model to call a function, search a database, fetch a web page or run code while it answers a question, instead of answering only from what it was trained on. The model reads a list of available tools, picks one, sends it arguments, and then reads the result before writing its final answer.
A typical exchange has several turns. The user asks a question, the model calls a search tool, the tool returns results, the model calls a second tool to fetch a page, and only then does it write the answer. Each turn is a separate model call with its own input and output tokens.
Tool use is what turns a chatbot into an agent. The same mechanism powers support agents that look up orders, coding assistants that read files, and research tools that check sources. The cost question matters because each of those steps is billed, and a careless setup can run ten turns where two would do. For a baseline on pricing, see the LLM API cost calculator.
How is tool use billed?
Tool use is billed the same way as ordinary LLM calls: by the tokens the model reads and the tokens it writes. The difference is that tool use multiplies both, because every tool call adds a turn and every tool result is fed back into the next prompt.
| Cost item | What you pay for | Typical driver |
|---|---|---|
| Input tokens | Prompt, tool list and tool results | Long tool results and big tool lists |
| Output tokens | Model replies and tool-call arguments | Verbose reasoning and long answers |
| Extra turns | Each model call in the chain | Tools that call other tools |
| Tool execution | Search, database or API charges | Paid APIs behind the tools |
| Context growth | History carried into later turns | Long conversations with many tools |
The largest hidden cost is the tool result itself. A search tool that returns a full page of text adds thousands of input tokens to the next call, and the model reads those tokens even if it only needs one line. Trimming results to the fields the model actually needs is often the biggest single saving.
Some providers also charge more for models that support tool use, or for reasoning models that think before each call. Check the pricing page for the model you use, and measure the real per-task cost from your own logs rather than guessing from the rate card.
What drives the cost up most?
The cost of tool use is driven up most by long tool results, too many tools on offer, and chains that loop when a tool fails or returns the wrong thing.
First, the tool list itself costs tokens on every call. A model offered forty tools reads the description of all forty before it picks one, even for a question that needs none of them. Teams that give every agent every tool pay for that list on every turn.
Second, retries multiply the bill. If a tool call fails and the model tries again with a slightly different argument, each attempt is a full model call. If it tries five times, you pay five times. A clear failure message and a hard limit on retries stop the loop before it gets expensive.
Third, long conversations carry the whole history forward. Ten turns of tool results become the input for turn eleven, so the cost of each later turn grows. Summarising the history or dropping old tool results keeps the context short and the price steady.
How can you cut the cost of tool use?
You cut the cost of tool use by shrinking what the model reads, limiting how many turns it can take, and routing simple questions to cheaper paths before the agent starts.
- Trim tool results. Return only the fields the model needs, not whole records or pages. A search tool should return a short summary, not the full document.
- Offer fewer tools. Give each agent only the tools its job needs. A support agent does not need the deployment tools, and a research agent does not need the billing tools.
- Cap the turns. Set a maximum number of tool calls per task, such as five, and stop with a clear message when the cap is hit.
- Cache repeated lookups. If many users ask about the same product or document, cache the tool result and reuse it instead of calling the tool again.
- Use a smaller model for simple calls. A routing step or a short summary does not need your most capable model, and the price gap between model sizes is large.
- Log cost per task. Record tokens and turns for each task type so you can see which jobs are expensive and why, instead of debating it in the abstract.
Start with the trim and the turn cap: they are quick to build and they usually cut the bill the most. If you are planning an agent that relies heavily on tools, a team that does LLM development for production applications can help design the tool set and the cost controls together.
Example (hypothetical): pricing one support task
Example (hypothetical): a support agent answers a question about a delayed order. It calls a lookup tool, reads the order record, then calls a shipping tool and reads the tracking result, then writes the reply. The whole task uses three model calls.
Suppose each call reads 2,000 input tokens and writes 300 output tokens, and the provider charges 5 units per million input tokens and 15 units per million output tokens. One call costs 2,000 times 5 divided by 1,000,000, which is 0.01, plus 300 times 15 divided by 1,000,000, which is 0.0045, for a total of 0.0145 per call. Three calls cost about 0.0435 per task.
At 10,000 tasks a month, that is about 435 per month. If the shipping tool returns a full tracking page and the input grows to 6,000 tokens per call, the same task costs about 0.1035, or about 1,035 per month. Trimming that one result back to the fields that matter saves about 600 a month without changing the answer.
What are the common mistakes?
The most common mistakes are giving the model every tool, returning whole documents from tools, and never measuring what a task actually costs.
- One agent with all the tools. A long tool list costs tokens on every call and makes the model pick the wrong tool more often. Split the work across focused agents.
- Full results from tools. A tool that returns a whole page or record feeds thousands of tokens back into the model. Return the fields that matter and nothing else.
- No turn limit. A model that retries a failing tool five times pays five times. Cap the turns and return a clear failure instead.
- Guessing the cost. Rate cards do not show how your tasks behave. Log tokens per task and review the numbers weekly.
- Using the biggest model everywhere. Routing and summarising steps run fine on smaller models at a fraction of the price.
Key takeaways
- Tool use turns one question into several model calls, and each call is billed in tokens
- The biggest hidden cost is long tool results fed back into the next prompt
- Offer only the tools each agent needs, and keep the tool list short
- Cap the turns, cache repeated lookups, and trim results to the fields that matter
- Log tokens per task so you can see which jobs are expensive and why
- A smaller model is often enough for routing and summarising steps
Frequently asked questions
How is tool use different from a normal LLM reply?
A normal reply is one model call with one prompt and one answer. Tool use adds turns: the model calls a tool, reads the result, and may call another tool before answering. Each turn is billed separately, so the cost depends on the number of turns and the size of the tool results.
Does tool use cost extra beyond the token price?
The model provider bills the tokens in every turn, and the tools themselves may add charges, such as a paid search API or a database query. The tool execution cost is usually small next to the token cost, unless the tool calls an expensive paid service.
Why does my agent cost more than the rate card suggests?
The rate card shows the price per million tokens, but a tool-using agent makes several calls per task and carries tool results forward as input. Measure the tokens per finished task from your own logs to get the real number.
Can I use a cheaper model for tool use?
Yes, for many steps. Routing a question, summarising a tool result and formatting an answer often work well on smaller models. Keep the most capable model for the steps where judgement matters, such as choosing between tools or handling an unclear request.
How many tool calls should a task take?
Most tasks should finish in one to five calls. If a task regularly takes more, the tool set is too broad, the results are too long, or the task needs to be split into smaller steps with clearer instructions.
Should I cache tool results?
Yes, when the same lookup repeats. Product details, policy text and document summaries change slowly, so caching them avoids paying for the same tool call on every user question. Set a short expiry so stale data does not linger.