FIELD NOTES / 5 MIN READ

Why Your Bot's Tool-Calling Cost Estimate Is Wrong If You Ignore Thinking Tokens

Headline per-token prices undercount what a bot's tool-calling run actually costs, because both Anthropic and Google bill reasoning (thinking) tokens at the output rate, and the visible answer text is only part of what you pay for. This piece gives a reproducible way to compute real cost from a model's own usage response instead of the price sheet.

AI-assisted editorial: researched and drafted with AI using the primary sources linked below. Check the cited evidence and any stated test scope. Illustrative examples are not measured product results. Editorial policy.

Key takeaways

  • Thinking tokens bill at the output rate on both Claude and Gemini, so a bot's real cost is input_tokens × input_rate + (thinking_tokens + output_tokens) × output_rate, not input × output on the visible text alone.
  • The visible answer and the billed token count are different things: Claude charges for the full thinking process even when it only returns a summary, and Gemini counts thinking as part of the same output bucket as the answer.
  • Build your cost model from each response's usage object after a real call, not from the price sheet alone, because thinking depth varies by prompt and setting, not by a fixed ratio you can assume in advance.

The direct answer

Compute a tool-calling bot's cost per run as: input_tokens × input_rate, plus (thinking_tokens + visible_output_tokens) × output_rate, minus whatever discount applies to cached input. That third term is the one most back-of-envelope estimates skip, and on an agent that reasons before or between tool calls it is often the largest one.

Both major providers confirm this billing rule in their own documentation. Anthropic's platform docs state plainly that reasoning has a cost: Thinking has a cost: the tokens Claude spends reasoning are billed as output tokens, even when the thinking text isn't returned to you, and they count toward max_tokens alongside the response text. Google's own pricing page makes the equivalent point for Gemini: Every token the model processes is counted and billed, including thinking tokens and internal tool system instructions and function declarations when using tools.

For a tool-calling agent this matters more than for a single chat turn, because a turn with tool use typically produces at least one round of internal reasoning before the tool call and another after the tool result comes back. Anthropic's context-window documentation is explicit that all of this counts: The output Claude generates for the turn, including its extended thinking, counts too. And separately: Thinking tokens are a subset of your max_tokens parameter, are billed as output tokens, and count toward rate limits. A pricing estimate built only on the visible reply text will be wrong by whatever share of the turn was reasoning.

Sources: Thinking - Claude Platform Docs, Gemini Developer API pricing | Gemini API | Google AI for Developers, Context windows - Claude Platform Docs.

A worked illustrative example

This example is illustrative arithmetic, not a measured BotBento test or a vendor benchmark. It uses Google's own published rate for Gemini 4 Hydrogen, which Google's launch announcement states directly: Gemini 4 Hydrogen is priced flat across its entire 1 million-token context window at $1.50 per million input tokens and $7.50 per million output tokens. Nothing here reflects an Anthropic price, since the search results available for this piece did not surface a current, confirmed first-party per-token rate for a specific Claude model to quote directly.

Suppose a small-team bot looks up a teammate's calendar availability through a connected tool. One turn: the model reads 3,000 tokens of conversation and tool-schema context, reasons for 1,200 tokens before deciding to call the tool, then reasons for another 300 tokens after the tool result comes back, and writes a 300-token visible answer. Using the formula above: input cost = 3,000 × $1.50 / 1,000,000 = $0.0045. Output-side cost = (1,200 + 300 + 300) × $7.50 / 1,000,000 = 1,800 × $7.50 / 1,000,000 = $0.0135. Total: about $0.018 for the turn, of which three-quarters is reasoning and answer tokens, not input.

Now change only the thinking depth, not the model or the task: if the same tool call runs at a higher reasoning setting and spends 5,000 thinking tokens instead of 1,500, output-side cost becomes (5,000 + 300) × $7.50 / 1,000,000 = $0.0398, more than doubling the turn's cost while the input side stays fixed at $0.0045. The lesson is not that Hydrogen is cheap or expensive in absolute terms; it is that the thinking-level or effort setting you choose moves the bill more than the headline per-token rate does, and a cost estimate that assumes a fixed thinking-to-output ratio across tasks will be off by whatever that task's actual reasoning depth turns out to be.

Sources: Introducing Gemini 4 Hydrogen for Agentic Workflows.

Where this estimate breaks

Assuming the visible text is what you're billed for. Anthropic's docs are explicit that this assumption fails: You're charged for the full thinking tokens generated by the original request, not the summary tokens. The billed output token count does not match the count of tokens you see in the response. If your cost tracker reads response text length instead of the usage field, it will systematically undercount.

Treating prompt caching as free input. Caching cuts cost on repeated prefixes, but it does not remove the token count from your accounting, and it introduces more categories to track, not fewer: If you use prompt caching, the input count is split across input_tokens, cache_read_input_tokens, and cache_creation_input_tokens, and all three count toward the window. A pipeline that logs only a single "input_tokens" number after turning on caching will misreport what it actually spent.

Assuming one provider's thinking rules carry over to another's model, or to a newer version of the same model. Thinking levels, defaults, and whether thinking can be disabled all vary by model and have changed across recent Claude and Gemini releases. Re-check the current documentation for the exact model ID you are calling before reusing an old cost formula; a rule that held for one dated snapshot is not guaranteed to hold for the next one.

Estimating cost before a call instead of reading it after. Thinking depth depends on the prompt and the task, not just the setting you chose, so a planner built purely from rate-card numbers cannot know in advance how many reasoning tokens a given tool-calling turn will spend. The only reliable number is the one the model reports back.

Sources: Thinking - Claude Platform Docs, Context windows - Claude Platform Docs.

What to do before you trust a cost number

Read the usage object, not the price sheet, for your actual spend. Every real response carries exact counts of input, thinking, and output tokens; pull those after a representative batch of real tool-calling runs rather than guessing a ratio up front.

Separate the thinking-level or effort setting from the model choice when you compare costs. Two runs on the same model at different reasoning depths can differ in cost more than two different models at the same depth, so a fair comparison needs to hold that setting constant, or report it explicitly when it isn't.

Rebuild the estimate after any model migration, price change, or default change. A retirement notice, a new model version, or a changed default thinking level each reset the ratio between input, thinking, and output tokens for your workload, and an old spreadsheet formula will quietly drift from reality until you check it again against the current response usage data.

Primary sources

Sources checked 2026-12-04. Standards and product documentation can change; follow the linked version when implementing.

  1. Introducing Gemini 4 Hydrogen for Agentic Workflows — Google
  2. Gemini Developer API pricing | Gemini API | Google AI for Developers — Google AI for Developers
  3. Thinking - Claude Platform Docs — Anthropic
  4. Context windows - Claude Platform Docs — Anthropic

BotBento is in development. Suggest a correction.