OpenAI Developer Community
Feature request: Query token counts via API
Prompting
sps
March 2, 2022, 6:01pm
2
Hi
@gg
Welcome to the community.
Here’s some tools that should help:
node.js -
gpt-3-encoder - npm
python -
Tokenizer
show post in topic
Related topics
Topic
Replies
Views
Activity
Token count for completion call?
API
6
2164
December 19, 2023
Official token count differs from OpenAI tokenizer
API
15
1890
January 3, 2024
Please, add a text token counter API endpoint
Feedback
3
50
October 9, 2024
Struggling to get correct token count
Community
gpt-4
,
gpt-35-turbo
,
api
2
1897
September 4, 2023
How do I calculate the pricing for generation of text?
API
11
7288
March 6, 2023