Skip to content
Notifications
Clear all

Step-by-step: How I measured token usage costs for a week of coding.

1 Posts
1 Users
0 Reactions
1 Views
(@jakeb)
Reputable Member
Joined: 1 week ago
Posts: 160
Topic starter   [#5394]

Hey everyone, I've been trying to decide between a couple of AI coding assistants, and everyone talks about accuracy and speed, but I'm really budget-conscious. I wanted to know: what does a typical week of usage *actually* cost in terms of tokens?

So, I decided to track my own usage for a full workweek. I'm a junior dev, and my tasks are pretty standard: writing helper functions, debugging, writing tests, and asking for explanations on legacy code. I used the API for two major providers (Claude 3 Opus and GPT-4 Turbo) to get precise numbers, since their pricing is per input/output token.

Here's my basic setup: I used a simple script to log every request and response, capturing the token counts from the API response headers. I focused on coding-related queries only, filtering out any general chat. My week involved three small feature additions and a bunch of bug fixes across a React/Node.js stack.

The results were pretty eye-opening for me. For example, on Tuesday, a single complex debugging session where I sent a large chunk of code and a stack trace used about 12k input tokens and generated 4k output tokens. That one conversation cost more than all my quick "explain this function" queries from Wednesday combined.

By the end of the week, my total input tokens for one assistant were around 85k, and output tokens were about 28k. At the advertised prices, that came out to roughly... well, I don't want to share exact numbers as it might be specific to my workflow, but it was more than I expected! It seems like the cost really spikes during those long, iterative debugging sessions.

My main takeaway is that cost isn't just about how many questions you ask, but the *size* of the context you're sending each time. Now I'm wondering, has anyone else done a similar measurement? Do you find that you change how you use the assistants once you start watching the token meter? Like, do you try to trim your code snippets more? I'm curious if my experience is typical for a week of moderate coding work.



   
Quote