Portfolio 11 · request envelope

LLM token and context budget planner

Work only with pasted or estimated counts—not prompt content—to reconcile system text, tool definitions, retained history, retrieval, provider overhead, and reserved output.

Decision this answers: How many conversation turns fit before the first invalid request, and which component should be trimmed without pretending an estimate is tokenizer-exact?

Scenario

Numeric scenario inputs

Model-specific request envelope.

published list[1]

Paste an official count or use a visibly estimated local count.

measured[2]

Serialized schema count, kept out of the URL.

measured[1]

Count after the selected retention policy.

model estimate[3]

Counted chunks actually placed in the request.

measured[1]

Capacity reserved before sending the request.

measured[2]

The complete default scenario is server rendered. Interactions stay in this browser.

Decision summary

Complete envelope

79200model estimate

The evidence class cannot be stronger than its weakest component.

[1][2][3]

Remaining capacity

48800model estimate

Default request fits: true.

[1]

Complete turns retained

15exact-derived

Simulation stops before the first invalid request.

[3]

Context utilization

61.9%model estimate

Envelope divided by the selected limit.

[1]
Direct-labeled result profile

The tables below are the accessible source of truth; bar lengths never carry identity alone.

Count provenance ledger

Count provenance ledger
CandidateCountEvidenceIncluded in linksBoundaryActionEvidence
Provider CountTokens resultPaste numeric resultMeasuredNumber onlyModel-specificUse directlymeasured[1]
Local tokenizer estimateNumeric estimateModel estimateNumber onlyTokenizer/version-specificDo not call exactmodel estimate[2]
Unknown provider overheadUnknownUnknownNo contentCannot prove fitPaste official countunknown[3]

Official surface versus this site

Gemini CountTokens API

Use the official surface to confirm native prices, counting rules, limits, and product eligibility.

This offline workbench

Provider counting APIs return authoritative model-specific counts. This offline page lets those counts be pasted locally, combines them into a complete envelope, and simulates retention without transmitting content.

Sources and methodology

Every result-affecting reference is visible here without JavaScript and is retained in the JSON export.

[1] Gemini CountTokens API
Authority
Google
Native identifier
models.countTokens
Unit
tokens
Evidence
measured
As of
2026-08-01
Retrieved
2026-08-01
Freshness
reference
Normalization
Official counts can be pasted as numbers; no content is transmitted by this page.

Open the authoritative source

[2] OpenAI token counting guide
Authority
OpenAI
Native identifier
token counting guide
Unit
tokens
Evidence
measured
As of
2026-08-01
Retrieved
2026-08-01
Freshness
reference
Normalization
Model-specific counts remain distinct from local estimates and raw content is never exported.

Open the authoritative source

[3] Anthropic token counting
Authority
Anthropic
Native identifier
token counting API
Unit
tokens
Evidence
measured
As of
2026-08-01
Retrieved
2026-08-01
Freshness
reference
Normalization
Provider results can be entered numerically while prompt and tool text stay local and out of URLs.

Open the authoritative source

Limits and non-claims

  • Share links contain numeric counts only—never prompts, messages, documents, or tool schemas.
  • A total containing an estimate remains an estimate even when the addition is exact.
  • Context fit does not imply quality, latency, output completion, or provider acceptance.