Agenvix Enterprise Suite
Prompt Budgeting

LLM Token Counter & API Cost Calculator

Count tokens for GPT-5, GPT-4o, Claude and Gemini prompts, see the cost per request at current list prices and check how much of the context window you are using. OpenAI counts are exact (o200k_base / cl100k_base); Claude and Gemini are clearly labelled estimates. Nothing you paste leaves the browser.

How It Works
Exact OpenAI Encodings
Cost per Request
Editable Price Table
Prompts Stay Private
Agenvix Studio v2.0
o200k_base · exactGPT-5 · 400K context
Prompt:
311 characters · 51 words
Tokens:
60 input + 500 output budget
Cost:
$0.005 per request · 1,000 req ≈ $5.08
● Tokenizer loads on first keystrokeClaude / Gemini ≈ estimates
Quick Test Presets:Click to load
Tokenizer loads on first keystroke
100% Free

Token Counter Workspace

Paste a prompt, pick a model and set the expected output length. The tokenizer table (≈1 MB) is downloaded once on first use.

Exact count using o200k_base - identical to what the OpenAI API bills for this text.
GPT-5 · exact
60 tokens
Chars / token
5.18
Cost / request
$0.005075
Per 1,000 req
$5.07
Context used
0.14%

560 of 400,000 context tokens (prompt + reply)

Characters
311
Words
51
o200k
60
cl100k
63
ModelTokens$/1M in$/1M outPer req
60$0.005075
60$0.001015
60$0.000203
60$0.00515
60$0.000309
63$0.000782
67$0.007701
67$0.005134
67$0.0385
63$0.005079
63$0.001269
63$0.000206
List prices (USD per 1M tokens, standard tier) as reviewed 19 October 2026 - edit to match your contract. ≈ = estimated token count.
LLM list prices & model limits last reviewed 19 October 2026; next scheduled review 17 January 2027. Defaults are a starting point - confirm with each provider's official pricing page (OpenAI, Anthropic, Google) before relying on them. Every price is editable and your edits are kept on this device.

Why Builders Use the Agenvix LLM Token Counter

Budget prompts before they hit production.

Exact Where It Can Be

OpenAI publishes its tokenizers, so GPT-5, GPT-4o and GPT-3.5 counts match the API exactly. Other vendors do not publish theirs; those rows are marked as estimates with the calibration factor shown.

Real Cost Math

Input tokens × input price plus your expected output tokens × output price, per request and per 1,000 requests, for every model side by side.

Prices You Can Edit

List prices change and enterprise contracts differ. Edit any price inline and the comparison table updates - nothing is hard-wired.

Prompts Never Leave

System prompts and RAG context often contain customer data. Tokenisation runs locally in JavaScript; no request is made with your text.

Simple as 1-2-3

How the Counter Works

Byte-pair encoding in your browser.

01

Paste Your Prompt

System prompt, few-shot examples, retrieved documents - paste everything the model will read.

02

Tokenise Locally

The matching BPE vocabulary (o200k_base for GPT-5/4o, cl100k_base for older models and as the reference for estimates) splits the text into tokens.

03

Read the Budget

Token count, context-window usage, cost per request and the coloured token map update instantly.

Tokenizer Reference

Model Families & How They Are Counted

Accuracy you can expect per vendor.

Feature / SpecificationBest Use CaseEngine / Output StandardPrivacy & SecurityPerformance RatingAction
GPT-5, GPT-5 mini/nano, GPT-4oOpenAI Responses & Chat APIso200k_base (exact)200k vocabularyExact
GPT-4 Turbo, GPT-3.5, embeddings v3Legacy OpenAI modelscl100k_base (exact)100k vocabularyExact
Claude Sonnet / Opus / HaikuAnthropic Messages APIcl100k × 1.07 (estimate)Use count_tokens API for billing≈ ±10%
Gemini 2.5 Pro / FlashGoogle AI Studio / Vertexcl100k × 1.0 (estimate)Use countTokens for billing≈ ±10%
Images, audio, tool schemasMultimodal promptsNot counted hereVendor-specific rulesOut of scope
Comprehensive Guide

Tokens, Context Windows and API Costs

1. What a token actually is

Language models do not read characters or words; they read tokens produced by a byte-pair-encoding (BPE) vocabulary. Common English words are usually one token, rarer words split into pieces (" Summ" + "ar" + "ize"), and code, JSON, non-Latin scripts and emoji cost more tokens per character. The rough rule "1 token ≈ 4 characters of English" is only an average - this tool shows the real split for the vocabulary your model uses.

2. Why Claude and Gemini are estimates

OpenAI open-sourced its tokenizers (tiktoken), so o200k_base and cl100k_base counts here are identical to what the API bills. Anthropic and Google have not published theirs; the only exact source is their count_tokens / countTokens endpoints, which need an API key and a server.

For those vendors this page applies a calibration factor to the cl100k_base count. Published community measurements range from about 1.05 to 1.35 for different Claude generations and 0.95 to 1.05 for Gemini, so treat the figures as planning numbers (typically within ±10% for English prose, less reliable for code and CJK text) and confirm with the vendor API before billing decisions.

3. Turning tokens into dollars

Cost = input tokens × input price + output tokens × output price, with prices quoted per million tokens. Output tokens are usually 4-8× more expensive than input, so a short prompt that triggers a long answer can cost more than a long prompt with a short answer. Cached-input discounts, batch APIs and long-context surcharges (for example Gemini 2.5 Pro above 200K tokens) are not modelled here - edit the prices if your tier differs.

4. Practical ways to cut token spend

Trim boilerplate from system prompts, move stable instructions into cached prefixes, send only the retrieved passages that matter, prefer compact JSON keys in tool schemas, and set a max_tokens limit that matches the answer you actually need. Measure before and after with this counter - a 30% shorter prompt at scale is a 30% smaller invoice.

Frequently Asked Questions

Everything you need to know about counting tokens

Accuracy, encodings, pricing and privacy.

How accurate is the token count?

For OpenAI models it is exact - the same o200k_base and cl100k_base vocabularies the API uses run in your browser. For Claude and Gemini the count is an estimate derived from cl100k_base with a calibration factor; expect roughly ±10% on English text.

Which tokenizer does GPT-5 use?

GPT-5, GPT-5 mini/nano, GPT-4o and GPT-4.1 use o200k_base. GPT-4 Turbo, GPT-3.5 Turbo and the text-embedding-3 models use cl100k_base.

How do I count tokens for Claude exactly?

Use Anthropic's Messages count_tokens endpoint from your backend. This page gives you a quick local estimate for planning; the API is the source of truth for billing.

Are the prices up to date?

The table ships with vendor list prices as last reviewed on 19 October 2026 for standard, non-cached usage; the page shows that date and flags itself once a review is overdue. Prices change, so every value is editable - adjust them to your contract or the current pricing page, and your edits stay saved in this browser.

Does the counter include chat message overhead?

No. Chat APIs add a few tokens per message for role markers (typically 3-4 per message plus a per-reply constant). The counter reports the tokens of the text itself; add that overhead for precise budgeting.

Why is the first count slower than the rest?

The tokenizer vocabulary (about 1 MB compressed for o200k_base) is downloaded the first time you type. After that every count is instant and works offline.

Is my prompt sent to a server?

No. Tokenisation runs locally in JavaScript. Agenvix never receives your text.

Contextual Workflows

Related Developer Utilities

Discover companion utilities engineered for zero-log speed and browser-side execution.