---
title: ttok 0.4
link: https://simonwillison.net/2026/Oct/8/ttok/
source: simonwillison-net
published: 2026-10-08T23:34:28Z
updated: 2026-10-08T23:34:28Z
first_seen: 2026-10-09T05:58:27.034165253Z
labels:
- ai
- generative-ai
- llms
- openai
- projects
- tokenization
summary: 'Release: ttok 0.4 ttok is my CLI tool for counting tokens, using OpenAI''s open source tiktoken library. It hasn''t been in updated in a couple of years, but I finally fixed a Click warning, updated CI, and added a --list-models command to list available models. It works with uvx, so you can count tokens in anything like this: cat file.txt | uvx ttok Tags: projects, ai, openai, generative-ai, llms, tokenization'
content: extracted
html: 2026-10-08-ttok-0-4.html
---

`ttok` is my CLI tool for counting tokens, using OpenAI's open source [tiktoken](https://github.com/openai/tiktoken) library.

It hasn't been in updated in a couple of years, but I finally fixed a Click warning, updated CI, and added a `--list-models` command to list available models.

It works with `uvx`, so you can count tokens in anything like this:

```
cat file.txt | uvx ttok
```
