{
  "@context": "https://schema.org",
  "@id": "https://aggr.aymericbeaumet.com/items/simonwillison-net/2026-10-08-ttok-0-4/#webpage",
  "@type": [
    "WebPage",
    "ArchiveComponent"
  ],
  "articleBody": "`ttok` is my CLI tool for counting tokens, using OpenAI's open source [tiktoken](https://github.com/openai/tiktoken) library.\n\nIt 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.\n\nIt works with `uvx`, so you can count tokens in anything like this:\n\n```\ncat file.txt | uvx ttok\n```\n",
  "authors": [],
  "captured_at": "2026-10-09T05:58:27.034165253+00:00",
  "category": "programming",
  "content_html": "<p><code>ttok</code> is my CLI tool for counting tokens, using OpenAI's open source <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/openai/tiktoken\">tiktoken</a> library.</p>\n<p>It hasn't been in updated in a couple of years, but I finally fixed a Click warning, updated CI, and added a <code>--list-models</code> command to list available models.</p>\n<p>It works with <code>uvx</code>, so you can count tokens in anything like this:</p>\n<pre><code><span class=\"code-snippet\">cat file.txt | uvx ttok\n</span></code></pre>\n",
  "content_markdown": "`ttok` is my CLI tool for counting tokens, using OpenAI's open source [tiktoken](https://github.com/openai/tiktoken) library.\n\nIt 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.\n\nIt works with `uvx`, so you can count tokens in anything like this:\n\n```\ncat file.txt | uvx ttok\n```\n",
  "dateCreated": "2026-10-09T05:58:27.034165253+00:00",
  "date_created": "2026-10-08T23:34:28+00:00",
  "date_modified": "2026-10-08T23:34:28+00:00",
  "date_published": "2026-10-08T23:34:28+00:00",
  "description": "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…",
  "external_url": "https://simonwillison.net/2026/Oct/8/ttok/",
  "git": {
    "commit": "ebb0941c5c06a2ab2377342d607535262a3e969e",
    "path": "items/simonwillison-net/2026/10/2026-10-08-ttok-0-4.md",
    "permalink": "https://github.com/aymericbeaumet/aggr-instance/blob/ebb0941c5c06a2ab2377342d607535262a3e969e/items/simonwillison-net/2026/10/2026-10-08-ttok-0-4.md"
  },
  "id": "urn:aggr:item:068ba4cca0919f9ba5b7e9ddd378b2150bf6ed74",
  "isBasedOn": {
    "@id": "https://simonwillison.net/2026/Oct/8/ttok/"
  },
  "mainEntity": {
    "@id": "https://simonwillison.net/2026/Oct/8/ttok/",
    "@type": "CreativeWork",
    "archivedAt": {
      "@id": "https://aggr.aymericbeaumet.com/items/simonwillison-net/2026-10-08-ttok-0-4/#webpage"
    },
    "dateModified": "2026-10-08T23:34:28+00:00",
    "datePublished": "2026-10-08T23:34:28+00:00",
    "headline": "ttok 0.4",
    "timeRequired": "PT1M",
    "url": "https://simonwillison.net/2026/Oct/8/ttok/",
    "wordCount": 60
  },
  "name": "Archived snapshot: ttok 0.4",
  "preview": null,
  "reading_minutes": 1,
  "replicated_at": null,
  "source": "simonwillison-net",
  "source_name": "Simon Willison's Weblog",
  "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",
  "tags": [
    "ai",
    "generative-ai",
    "llms",
    "openai",
    "projects",
    "tokenization"
  ],
  "temporalCoverage": "2026-10-09T05:58:27.034165253+00:00",
  "title": "ttok 0.4",
  "url": "https://aggr.aymericbeaumet.com/items/simonwillison-net/2026-10-08-ttok-0-4/",
  "word_count": 60
}