patternfetch / Methodology / Token-cost study

Study · measured · snapshot 2026-07-20

What does raw OHLCV cost an LLM in tokens?

The homepage claims a brief is ~500 tokens of market state instead of 400,000 of raw candles. That belongs on a page that measures it, not one that asserts it. So we counted both — raw candles pulled from the Yahoo chart endpoint and the brief from the keyless /v1/demo — with a real tokenizer, across eight tickers and timeframes. The numbers below are honest, including the ones that complicate the claim.

8 tickers × TF120-candle windowYahoo + /v1/democl100k_baseas of 2026-07-20
≈300tokens — the actionable market-state read (measured 272–314 across 8 briefs)
3,100–4,500tokens — the same 120 raw candles as CSV / as JSON objects
≈25tokens per raw candle — so ~400K tokens is a ~16,000-candle history
$0.27 → $358monthly token bill, hourly agent: the read vs a 400K-token raw history, at $1.25/1M

TL;DR — For the exact 120-candle window a brief summarizes, the raw candles are ~3,100 tokens as CSV and ~4,500 as JSON; the brief's actionable market-state read is ~300 tokens — a real but modest ~10–15× reduction. The dramatic figures on the homepage (~800×, ~400K, ~$6/call) only appear when the raw alternative is a large history: at ~25 tokens/candle, 400,000 tokens is ~16,000 candles, and against that the read is ~1,000× smaller. Two honest complications: the full keyless demo payload is ~12,300 tokens (it ships the candle codec plus base-rate evidence, larger than a single raw window), and the counts are from a GPT-family tokenizer. Beyond cost, published work shows large contexts also degrade answer quality — with caveats stated below.

01 · The claim on trial

An asserted number is not a measured one.

The original pitch for patternfetch is a compression argument: a ticker and a timeframe become a token-compact read, so a model never has to swallow a wall of candles. The site states it as ~500 tokens of market state instead of 400,000 of raw candles, roughly 800× fewer, at ≈$6 a call saved. Good marketing. But nowhere is it measured, and an unmeasured number is a liability the moment someone checks it.

This page checks it. We fetch both sides for real — the raw OHLCV a developer would pull from the Yahoo chart endpoint, and the finished brief from POST /v1/demo — and count the tokens of each with gpt-tokenizer (cl100k_base, the GPT-3.5/4 tokenizer), across eight tickers and timeframes. Where the claim holds, we show by how much. Where it is generous, we say so.

Two things make this worth publishing rather than burying. First, a page that measures a token cost is the kind of citable data asset that earns real references — which is the one growth lever that works beyond one person's own reach. Second, it carries the product's actual advantage without a sales voice: the number, checkable, is the argument.

02 · What we counted, and how

The method, so you can repeat it.

For eight ticker/timeframe pairs — crypto and US equities, across daily and hourly — we did the same thing:

One honesty note up front. cl100k_base is OpenAI's tokenizer. Claude and Gemini tokenize differently — Anthropic states its tokenizer yields somewhat more tokens for the same text — so treat the absolute counts as a GPT-family baseline. The ratio between raw candles and the brief is the model-independent result, and it barely moves between the two tokenizers we tried.

03 · The result, one window

The same 120 candles, read as state, are ~10× lighter.

This is the like-for-like picture: how many tokens the model must read to know one market's state. The raw candles carry the same information; the read is the state extracted from them.

Tokens to convey one 120-candle market stateaveraged over 8 tickers/timeframes · cl100k_baseRaw OHLCV — 120 candles, JSON objects4,541Raw OHLCV — 120 candles, CSV rows3,111patternfetch market-state read299Same 120 candles. Read = summary + regime + S/R + RSI/EMA + patterns.
The read is the state, not the wall. A market-state read averages 299 tokens (measured 272–314) against 3,111 for the same candles as CSV and 4,541 as JSON — a ~10.4× reduction against CSV, ~15.2× against JSON. It substantiates the homepage's "~500 tokens" (in fact it beats it). What it does not yet show is the "400,000" or "800×" — those need a larger raw history, in §06. And it omits one complication, taken up in §07: the keyless demo ships more than the read.

The per-ticker counts, so nothing hides in an average. Read is the actionable state; Full demo is the entire keyless payload (read + compact candle codec + base-rate evidence for every detected pattern).

TickerTFRaw CSVRaw JSONReadFull demoRead vs CSV
BTC/USDT1d3,5985,02830512,26011.8×
ETH/USDT1h3,3444,77427217,40312.3×
AAPL1d2,9864,41631410,0659.5×
SPY1d2,9964,42630511,7669.8×
NVDA1h2,9924,42228913,96210.4×
TSLA1d2,9784,4083088,3929.7×
MSFT1h2,9984,42830212,9769.9×
QQQ1d2,9984,42829811,79510.1×
Average3,1114,54129912,32710.4×
04 · What it costs

Turn the token gap into a monthly bill.

A token difference is abstract until it is money. Take an agent that asks once an hour — 720 calls a month — and price the input tokens at published rates.

Monthly token bill · agent asking hourly (720 calls)input tokens only · $1.25 / 1M (Gemini 2.5 Pro, ≤200K)patternfetch market-state read$0.27Raw candles — 120, CSV$2.80Full demo payload (read + candles + evidence)$11.09A ~400K-token raw history runs ≈$358/month — off this chart (§06).
Small window, small gap. At $1.25 per million input tokens, the read is $0.27/month against $2.80 for the raw candles of one window. The full demo payload is $11.09 — a reminder that on a single window the evidence-laden payload costs more than raw candles, not less. The reduction becomes dramatic only when the raw side is a long history (§06). Prices: Gemini 2.5 Pro $1.25/1M (≤200K).

The same monthly bill across three published input prices. Anchors span the market: an economy model, a mid flagship, and a top flagship.

Payload / callTokens/callTokens/month@ $0.30/1M@ $1.25/1M@ $5.00/1M
Market-state read299215,280$0.06$0.27$1.08
Raw candles — 120, CSV3,1112,239,920$0.67$2.80$11.20
Full demo payload12,3278,875,440$2.66$11.09$44.38
Raw history — ~16,000 candles398,080286,617,600$85.99$358.27$1,433.09

Where the homepage's "≈$6/call" comes from. That 400K-token history at a premium legacy price of ~$15/1M input works out to $5.97 a call — the "$6" figure. At today's cheaper flagships the same call is $0.50 ($1.25/1M) to $2.00 ($5.00/1M); note that a 400K prompt also pushes Gemini 2.5 Pro into its >200K tier at $2.50/1M, exactly when you send the most tokens. The read stays flat at a fraction of a cent whichever model you pick.

Prices as published on ai.google.dev/gemini-api/docs/pricing (Gemini 2.5 Flash $0.30/1M; Gemini 2.5 Pro $1.25/1M ≤200K, $2.50 >200K) and Anthropic's published API pricing (Claude Opus $5.00/1M, Sonnet $3.00, Haiku $1.00), fetched 2026-07-20. Input tokens only; output, caching and per-request overhead are separate.

05 · The other reason, stated honestly

It is not only cheaper. Long context also reads worse.

Cost is the easy argument. The harder, more honest one is quality: a 400,000-token context does not just cost more, it tends to be reasoned over worse. Several strands of published work point the same way — and because it matters, here is what is well-supported and what is not.

What is well-supported

Where the evidence is thinner — say so

Net: a compact brief plausibly sidesteps a documented failure mode, on top of the measured cost saving. We present it as suggestive, not settled — which is the honest register for a claim the literature supports by analogy rather than by direct test.

06 · Where 400,000 comes from

Raw context grows with history. The read doesn't.

The single-window gap is ~10×. The headline gap needs the raw side to be a real history — which is what "let the model read the candles" becomes once you give it enough to judge regime and levels. At ~25 tokens/candle, raw tokens climb linearly while the read stays flat.

Raw OHLCV (CSV) fed to the modelpatternfetch market-state read
Tokens vs history lengthraw ≈24.9 tokens/candle · the read is flat0100K200K300K400Kmarket-state read ≈300 tok — flat≈400K = the homepage figure1202k5k10k16khistory fed to model (candles) · raw ≈ candles × 24.9 tokens
The line that earns the claim. A model asked to reason from raw data needs history, and history is linear in tokens: ~16,000 candles ≈ 400,000 tokens — the homepage figure, now measured. The read does not move: the state of a market is the same size whether you computed it from 120 bars or 16,000. Against a 400K history the read is ~1,000× smaller; against the full 12,300-token demo payload, still ~33×.
History fed to modelRaw CSV tokensRaw JSON tokensRead staysRead vs raw CSV
120 candles2,9864,426~30010×
500 candles12,44018,440~30041×
1,000 candles24,88036,880~30083×
2,000 candles49,76073,760~300166×
5,000 candles124,400184,400~300415×
~16,000 candles~398,000~590,000~300~1,300×

Projected from a measured per-candle rate (~24.9 CSV, ~36.9 JSON), itself averaged over pulls of up to ~3,500 real candles. The "800× fewer" on the homepage sits between the 2,000- and 5,000-candle rows — a fair description of an agent that pulls a few timeframes of working history, and an overstatement for one that pulls a single window.

07 · Limits — the part that keeps it honest

Where the brief is the wrong tool, and where our numbers bend.

A study that only flatters the product is an advertisement. Here is what the measurement does not say.

So who is it for? An agent that repeatedly asks "where is this market and what's printing" across many tickers and timeframes — polling, screening, multi-asset watch — is exactly where a flat ~300-token read pays off against a history that would otherwise grow without bound. An agent that needs the raw series for a custom computation, or asks once about one small window, should just send the candles: at that scale the gap is ~10×, real but not decisive. The brief earns its keep by volume and history, not by magic.

08 · Reproduce it

Two requests and any tokenizer.

Nothing here is behind a key. Fetch both sides and count them yourself.

# 1) the brief — keyless, returns 120 candles of analysis
curl -X POST https://patternfetch.com/v1/demo \
  -H "Content-Type: application/json" \
  -d '{"ticker":"AAPL","timeframe":"1d"}'

# 2) the raw candles — the public Yahoo chart endpoint, same window
curl "https://query1.finance.yahoo.com/v8/finance/chart/AAPL?range=1y&interval=1d"

# 3) count both with a real tokenizer (Node)
npm i gpt-tokenizer
node -e 'import("gpt-tokenizer").then(t=>{
  const csv = /* last 120 rows: time,open,high,low,close,volume */ "";
  const read = /* brief.analysis.nl + regime + levels + indicators */ "";
  console.log("raw csv:", t.encode(csv).length, " read:", t.encode(read).length);
})'

The brief object is documented in the API reference; the market-state read is analysis.nl, analysis.regime, analysis.levels, analysis.indicators plus the pattern names and their one-line base-rate signal — everything except the per-pattern evidence tables and the candle codec.

Questions

Common questions.

How many tokens does raw OHLCV data cost an LLM?
In this measurement, 120 candles serialize to about 3,100 tokens as minimal CSV and about 4,500 as JSON objects (cl100k_base, averaged over 8 tickers and timeframes). Cost scales at roughly 25 tokens per candle for CSV, so a long history of about 16,000 candles reaches about 400,000 tokens.
How many tokens is a patternfetch market-state brief?
The actionable market-state read — one-line summary, regime, support and resistance, interpreted RSI/EMA and pattern signals — averages about 300 tokens (measured 272 to 314). The full keyless /v1/demo payload, which additionally ships the compact candle series and the base-rate evidence for every detected pattern, averages about 12,300 tokens.
Is the brief really 800 times smaller than raw candles?
Only against a large raw history. Against the same 120-candle window the state read is about 10 to 15 times smaller. Against a 400,000-token history it is roughly 1,000 times smaller. The 800-times figure assumes the raw alternative is a multi-thousand-candle dump, which is what letting a model read enough history to judge regime and levels tends to become.
What does that save in money?
For an agent asking once an hour (720 calls a month) at 1.25 US dollars per million input tokens, the market-state read costs about 0.27 dollars a month versus about 2.80 for the raw candles of a single window, or about 358 dollars a month if the raw alternative is a 400,000-token history. Input tokens only; output and other overheads are extra.
Does a smaller context also improve answer quality, not just cost?
Published research finds that long contexts degrade retrieval and reasoning: performance is highest when the relevant text sits at the start or end and dips in the middle, effective context is often far below the advertised window, and irrelevant tokens lower accuracy on the relevant sub-task. A compact brief sidesteps a documented failure mode. But that literature mostly uses synthetic retrieval tasks rather than market data, and newer models degrade less than older ones, so treat the quality claim as suggestive rather than proven for this use case.
Which tokenizer did you use, and does it match Claude or Gemini?
cl100k_base (the GPT-3.5/4 family tokenizer) via gpt-tokenizer. o200k_base (the GPT-4o family) returned identical counts on this numeric content. Claude and Gemini tokenize differently — Anthropic notes its tokenizer produces somewhat more tokens for the same text — so absolute counts shift by model, while the ratio between raw candles and the brief is roughly stable.
What are the limits of this comparison?
The brief is an interpretation. It throws away the raw ticks a model could in principle use differently, and the full demo payload is larger than a single raw window because it ships the candle codec plus base-rate evidence for transparency. The context-quality evidence is drawn from synthetic benchmarks, and the claim that models miscompute indicators over raw candles is a mechanistic inference, not a direct measurement. If you need the exact ticks, they ship in codec.rows and via POST /v1/candles.
Can I reproduce these numbers?
Yes. Pull raw candles from the Yahoo Finance chart endpoint, POST the same ticker and timeframe to /v1/demo without a key, and count both sides with any tokenizer. The exact requests are listed in the Reproduce it section.
Try it

Count it against your own tickers.

The demo is keyless and returns the same object we counted here. A free key adds $3.00 of starter credit (300 briefs), no card.