# Assistant API Token Counting

**URL:** https://community.openai.com/t/assistant-api-token-counting/677565
**Category:** API
**Tags:** gpt-4, api
**Created:** [March 11, 2024, 1:54pm UTC](https://community.openai.com/t/assistant-api-token-counting/677565 "2024-03-11T13:54:17Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![habibulloxon](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/habibulloxon/32/280173_2.png) [@habibulloxon](https://community.openai.com/u/habibulloxon)
#### Post date: [March 11, 2024, 1:54pm UTC](https://community.openai.com/t/assistant-api-token-counting/677565/1 "2024-03-11T13:54:17Z")

</div>

I’m currently developing a chat bot using the Assistant API and I’d like to know if it’s possible to keep track of the number of tokens used so that I can count how much money is spent in total while using my bot.

---

<div class="post-metadata">

### Author: ![nikunj](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/nikunj/32/222621_2.png) [@nikunj](https://community.openai.com/u/nikunj)
#### Post date: [March 11, 2024, 4:12pm UTC](https://community.openai.com/t/assistant-api-token-counting/677565/2 "2024-03-11T16:12:48Z")

</div>

You can do this by looking at the usage parameter in the run and run steps objects: [https://platform.openai.com/docs/api-reference/runs/object#runs/object-usage](https://platform.openai.com/docs/api-reference/runs/object#runs/object-usage)
