Skip to main content
Submitted by lwinmaungmaung on
AI Token Consumption - Image by <a href="https://pixabay.com/users/bluebird6-5616990/?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=4506393">Adrian</a> from <a href="https://pixabay.com//?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=4506393">Pixabay</a>

AI token consumption is we faced everyday around these years. When you are middle of working with AI agent and you got the message of quota completed, you are doomed. In this topic, I want to share how to do in your project to make the work most out of it and reduce the token consumption.

AI Token Consumption explained

When you command an AI agent to start working on a task, the agent will do the analyzing the whole project. It scans its capabilities using agent.md in your project. After that, it will do it task based on your project type, and do the math. Then, write the test case and viola, you are done.

The AI token consumption calculates everything inside the task. If you choose the higher knowledge thing, it will cost you more. However, if you request the mini and work like a typist or stenographer, it will cost a lot less.

Token cost calculation

When your token cost calculated, we need to aware that the token cost is not an unlimited thing. In codex, it is limited per month and also limited under the five hours window. So, if you tried to consume higher means you will run out of tokens within five hours for a window of 30 minutes and you job will get stalled for another four and half hours. To make sustainable, you need to choose the best way to optimize the delivery of your code.

Things to avoid hight token consumption

This may be the best part. When I was working on a project, one time I chose the GPT 5.5 with high reasoning. It consumes about 5% on each prompt. After I switched back to the GPT5.5 mini, it consumes the same. Even though, I am working with mini, normal with low reasoning. These little things consume my qouta. i have no idea about it and exploring via search engines do not give me the solution what I want.

I tried cleaning the chat, restarting the IDE and even the system will not sufficiently make the solution. The token is still consumes a lot.

Then, I found one solution. 

The AI is working with the history. When I am working with the large model and switched back to the old young model. The system is reading the old history of the whole project and then they are recalling the memory of the x high reasoning. Then it will make the cost higher and higher. The only solution I got is to clear the chat, delete all the history in history tab and stop using for some hours. 

The project architecture is also necessary to consider token usage. When I am using the monolith application, the delivery will be fast but it will consume more tokens based on the project sizes. So, microservices becomes a necessary tool to manage the cost of AI token consumption. DO IT ON YOUR OWN RISK, IT WILL CREATE ANOTHER MESS. TRUST ME.