Blog · July 18, 2026
Tokens are the currency of working with language models, and almost every tool asks you to spend them blind. You paste a wall of text, hit send, and find out afterwards what it cost — if you ever look. This week we shipped TokenLens on every chat input in app.nyquest.ai: a live token count, a real cost estimate for the model you have selected, and an Optimize button that can shrink or sharpen your prompt before it goes anywhere — without ever losing the details that matter.
The count you see is computed by the same tokenizer stack that powers our compression engine — typically in about a millisecond. When an exact count is not available, TokenLens shows an approximation and marks it (≈) instead of pretending. Costs come from the same live model registry that prices your requests: real per-million rates for the model you actually picked. If we do not have a price, we show nothing — never a made-up zero.
Tap the count for the full picture: your message, the output reservation you have planned, the model's context window, what remains, and projected output cost — labeled as projected, because nobody knows how long a model will ramble before it does.
Every prompt optimizer faces the same temptation: the easiest way to save tokens is to delete things, and the model doing the deleting does not always know what was load-bearing. An IP address. A file path. The words "do not execute this."
So TokenLens treats optimization as a pipeline with a conscience:
The negative-requirement check is the part we are proudest of. If you wrote "do not change the API URL" three slightly different ways, the optimizer is allowed to say it once — that is good compression. What it is never allowed to do is stop saying it. The validator compares prohibitions by meaning, not by counting sentences.
Here is the part that belongs on an engineering blog. While testing with a deliberately adversarial prompt — a rambling networking request stuffed with an API endpoint, three IP addresses, a router hostname, an environment variable, a function name, retry counts, and a fake credential planted to test secret detection — the integrity validator flagged a dropped URL. Working that failure exposed five real bugs in our own pipeline before any user hit them: a silent parsing failure that was quietly discarding the entire rewrite stage, markdown backticks getting glued onto extracted URLs, prose like "the variable (see above)" being mistaken for a function name, sentences being split in the middle of api.example.com, and filler words polluting the prohibition matcher.
We fixed the pipeline, not the test. That adversarial prompt now runs against production every morning as part of our daily suite — all thirteen protected details must survive optimization, the prohibitions must survive, and the planted credential must be detected and warned about. The suite is at 125 assertions, and the results are emailed to us whether they flatter us or not.
Being precise about the claim, as usual: optimization savings depend entirely on the prompt. Rambling, repetitive prompts shrink a lot; tight prompts full of protected technical detail shrink very little, and TokenLens will tell you so rather than inflate the number — "This prompt is already efficient" is a result we show proudly. When a prompt is mostly IP addresses and prohibitions, refusing to compress it is the feature working. And if it detects something that looks like a credential in your text, it warns you before the text goes anywhere for optimization.
Verified before shipping:
TokenLens is built as a self-contained core with no dependencies on the rest of our frontend — deliberately. The same counting, integrity, and diff machinery that guards prompts inside Nyquest is designed to travel: a browser extension that brings the same lens to any chat window you use is on the roadmap. The platform that gets cheaper the longer you talk now also shows you the meter.