---
title: "LLM Token Counter ($0.002/call)"
method: POST
path: "/count"
tags: ["tokens", "tokenizer", "tiktoken", "llm", "gpt", "context-window"]
---

# LLM Token Counter ($0.002/call)

`POST /count`

## Request

- Base URL: `https://x402.shizu.me`
- URL: `https://x402.shizu.me/count`
- Auth: none declared

Exact token count for text using OpenAI tokenizers. Body: {text, encoding?} where encoding is cl100k_base or o200k_base (default). Returns tokens and char_count. Use to budget prompts and context windows.

Paid endpoint: $0.002 per call via the x402 protocol (USDC on Base). An unpaid request returns 402 with payment requirements in the PAYMENT-REQUIRED response header; attach payment and retry.

## Response `200`

Paid result (JSON)

## Other responses

- `402`: Payment required — x402 requirements in the PAYMENT-REQUIRED response header

---

[API](https://skmtc.dev/shizu/apis/scrape402.md) · [All operations](https://skmtc.dev/shizu/apis/scrape402/llms.txt) · [OpenAPI document](https://skmtc.dev/shizu/apis/scrape402/revisions/0852d74798b8?raw)
