# How Are Tokens Counted?

**URL:** <https://community.openai.com/t/how-are-tokens-counted/26354>\
**Category:** API\
**Created:** [December 25, 2022, 2:58am UTC](https://community.openai.com/t/how-are-tokens-counted/26354 "2022-12-25T02:58:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blazer](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/blazer/32/13663_2.png) [@Blazer](https://community.openai.com/u/Blazer)\
**Post date:** [December 25, 2022, 2:58am UTC](https://community.openai.com/t/how-are-tokens-counted/26354/1 "2022-12-25T02:58:00Z")

</div>

1. When submitting a request via API, am I being charged for the tokens of the PROMPT as well? Or only for the tokens used for the COMPLETION?

2. Am I charged for my usage inside the playground?

---

<div class="post-metadata">

**Author:** ![PaulBellow](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/paulbellow/32/597962_2.png) [@PaulBellow](https://community.openai.com/u/PaulBellow)\
**Post date:** [December 25, 2022, 3:52am UTC](https://community.openai.com/t/how-are-tokens-counted/26354/2 "2022-12-25T03:52:01Z")

</div>

1. Prompt + Token

2. Yes.

PS - welcome to the community!

---

<div class="post-metadata">

**Author:** ![Blazer](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/blazer/32/13663_2.png) [@Blazer](https://community.openai.com/u/Blazer)\
**Post date:** [December 25, 2022, 4:12am UTC](https://community.openai.com/t/how-are-tokens-counted/26354/3 "2022-12-25T04:12:40Z")

</div>

So every time I hit the “Submit” button in the playground, the token size is accumulating?  
For example, if AI writes a long essay and then I respond with “Thank you” and hit submit, I’m charged for the entire essay AGAIN because it’s included in my “prompt” (history)?

---

<div class="post-metadata">

**Author:** ![raymonddavey](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/raymonddavey/32/14125_2.png) [@raymonddavey](https://community.openai.com/u/raymonddavey)\
**Post date:** [December 25, 2022, 7:46pm UTC](https://community.openai.com/t/how-are-tokens-counted/26354/4 "2022-12-25T19:46:54Z")

</div>

If you include it in the prompt - tokens will be used

Thats why people start to look at fine tuning - so you dont have to include examples with every request and can swap from few-shot to one-shot queries after effective training is achieved

---

<div class="post-metadata">

**Author:** ![sdorward](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@sdorward](https://community.openai.com/u/sdorward)\
**Post date:** [April 13, 2023, 8:20pm UTC](https://community.openai.com/t/how-are-tokens-counted/26354/5 "2023-04-13T20:20:29Z")

</div>

Is there a way to estimate the cost (dollar) & token usage of a Playground test before I submit? If I have beginner users then will burn through my budget…
