tokcount

tokcount

// count tokens. know before you send.

installation

npm install -g pnkd-tokcount

usage

# count tokens in file
tokcount prompt.txt

# count for specific model
tokcount prompt.txt --model gpt-4

# count from stdin
cat prompt.txt | tokcount

# show cost estimate
tokcount prompt.txt --cost
← back to all tools