Web Development

The Token Tax: Why I'm Finally Counting What I Send to LLMs in Production

A

Adil Sher

Author

Oct 28, 2026
4 min read
3 views
The Token Tax: Why I'm Finally Counting What I Send to LLMs in Production

Last month, a client's CRM integration started costing us three times what we quoted. I spent an afternoon digging through API bills only to realize we were sending entire sales call transcripts, complete with dead air, tangents, and repeated greetings, to an LLM endpoint on every update. That's when I understood something I'd been glossing over: every token you send to an LLM has a price tag, and the cost compounds when you're processing data at scale.

I'd been thinking about LLM integration like I think about database queries, get the right answer, optimize later. But token economics work differently. When you're processing hundreds of call recordings daily, "later" arrives at invoice time, and by then you've already burned money on context that didn't matter.

The Real Problem Isn't Transcripts, It's Waste

Here's what I missed: the cheapest-looking API call isn't always the cheapest operation. A long transcript sent through an LLM costs money on both the input and output. Retries multiply that cost. But more importantly, extra context doesn't always improve results, it often just pads the bill.

The original article nails something I've been learning the hard way: the goal isn't shorter transcripts at any cost. The goal is the smallest evidence window that preserves what actually matters, the customer's need, who owns the next step, what was committed to, what happens next. Everything else is noise.

In my CRM implementation, I was sending speaker labels, timestamps, and entire opening conversations. None of it affected whether the LLM extracted the right owner or due date. Cutting it would've saved tokens. But I didn't cut it because I wasn't measuring it.

Measure Before You Optimize

This is where the article's approach clicked for me: store the original call, record the selected evidence, track input token count, capture output count, and evaluate the result against a fixed rubric. All in one evaluation record.

I started building this into my Python workers. I set a 12,000-character guard as a preprocessing boundary, not because it's a magic number, but because it's visible, trackable, and forces me to be intentional about what I'm passing downstream.

The rubric matters more than the count. A lower token count is a fail if the model drops the due date or misses the account owner. I've seen that happen. The semantic search returned the wrong passage. The reranker picked something that sounded relevant but wasn't actionable.

Smart Retrieval Over Raw Context

This is where I'm experimenting now. Instead of passing the entire call, I'm using retrieval to extract targeted evidence: separate queries for customer need, commitments, ownership, and open questions. Then I merge a bounded set of relevant passages.

Embeddings work well for this because the LLM gets evidence instead of noise. But retrieval creates its own failure modes, the highest-scoring passage might mention an objection while the actual owner and date sit in the next result. That's why I'm building eval sets with hard examples: long calls, repeated names, corrections, commitments buried at the end.

My Take: This Changes How I Build

I agree with the article's core argument, but I'd push it further: token optimization isn't a cost-reduction tactic. It's a design constraint that forces you to think clearly about what your LLM actually needs to do.

Before, I'd build a feature, then ask "how much will this cost?" Now I'm asking "what's the minimal contract this needs?" and working backward. That shift has changed how I design prompts, truncate transcripts, and structure data.

Here's a practical example I'm using:

from dataclasses import dataclass

@dataclass(frozen=True)
class EvalRecord:
 original_call: str
 selected_evidence: str
 input_token_count: int
 output_token_count: int
 extracted_action: dict
 truncation_occurred: bool
 retrieval_recall: float
 pass_rubric: bool

# Store this alongside every LLM call.
# Query it to find which evidence windows work best.

The goal is a feedback loop. Run enough calls, score the results, analyze which evidence selections consistently produce correct extractions. Then standardize on that pattern.

The Question I'm Still Sitting With

The article assumes you have control over the CRM output contract and can keep it small. But what if the next feature request wants more fields? What if stakeholders push for richer context? Token discipline is easy until business requirements arrive.

I'm curious how others handle that trade-off. Have you found a way to push back on scope creep when it directly impacts LLM costs?

Source: This post was inspired by "Python LLM API Token Count Impact on CRM Cost and Usage Reduction" by Dev.to. Read the original article

Share this article

Written by Adil Sher

Full stack developer building high-traffic platforms, AI services, and custom web applications. Explore my portfolio, learn about my background, or get in touch.

Related Articles

Why I'm Seriously Reconsidering How My AI Agents Access the Web
Web Development Oct 27

Why I'm Seriously Reconsidering How My AI Agents Access the Web

I hit a wall last month that I didn't expect. I'd built a Claude-powered agent to help me research competitor pricing and API documentation across various SaaS platforms. It worked for maybe 30% of my targets. The rest? Either blocked by Cloudflare, or returning empty divs that t...

Stop Copy-Pasting Your Analytics Into ChatGPT Like It's 2023
Web Development Oct 26

Stop Copy-Pasting Your Analytics Into ChatGPT Like It's 2023

I spent twenty minutes last Tuesday doing something stupidly manual. I pulled traffic data from my analytics dashboard, exported it as CSV, pasted it into ChatGPT, asked "which pages performed best," got an answer, and then had to manually cross-reference it with another report b...

Why I Stopped Treating Dead-Letter Queues as a Trash Bin
Web Development Oct 25

Why I Stopped Treating Dead-Letter Queues as a Trash Bin

Three months ago, I shipped a reservation expiry system that silently swallowed failures. A payment hold stayed open for days past its window because a webhook timed out, nobody logged it, and the retry logic just gave up. The customer's balance looked wrong. My manager asked wha...