GUIDES / Pricing

How Much API Budget for a Batch of Documents? A Worked Example

Six original EN/ZH documents tokenized with a real tokenizer; two hypothetical workloads (50 one-off, 500 repeated) computed low/mid/high with caching, batch and retries. Budget examples only.

The short answer

A document batch budget is four multipliers: documents per month × tokens per document × price class (input/output/cache/batch) × fault tolerance (retries). Nothing here is exotic — but two inputs ruin most back-of-envelope budgets: guessing tokens from page counts, and forgetting that retries re-bill the whole request. Below we tokenize six original documents with a real tokenizer, state every assumption, and compute low/mid/high monthly budgets for two hypothetical workloads. Every figure is a budget example, not a measured bill.

First: characters are not tokens (measured, not guessed)

We wrote six original demo documents — English and Chinese memos in short / mid / long lengths — and counted their tokens with OpenAI's open-source tokenizer (tiktoken, o200k_base encoding). Those counts are the actual output of that encoding, not estimates — but an encoding is not automatically the tokenizer of every OpenAI model; check which encoding your model maps to, and treat the count each vendor API returns in its usage field as the authoritative figure. Other vendors use different tokenizers entirely, so our counts are an anchor, not a universal constant.

SampleCharactersTokens (o200k_base, measured)Chars per token
EN short298793.77
EN mid1,3992834.94
EN long2,3804954.81
ZH short102771.32
ZH mid4013091.30
ZH long6675151.30

In these six samples, English prose ran ≈ 4–5 characters per token and Chinese ≈ 1.3, so our 401-character Chinese memo cost more tokens (309) than the 1,399-character English memo (283) — a per-character density gap of about 3.8× for this kind of text. That is a property of these samples, not a law: do not convert it into a fixed "Chinese costs 4× English" multiplier, and never budget from page counts. Measure (or get vendor counts for) your own documents — genre, formatting and vocabulary all move the ratio.

Note:How to get real counts yourself: tiktoken for OpenAI encodings (what we used), and for any vendor the token counts returned in the API response's usage field — a single test call per document shape gives you the exact per-document figure. Keep the largest document you process as your "high" anchor and re-measure when document templates change.

The assumptions (all stated, all adjustable)

AssumptionOne-off small batch (S1)Repeated processing (S2)
Volume50 documents / month500 documents / month
Instruction prefix (input, every request)400 tokens (small, not worth caching)4,000 tokens (shared instruction/RAG context, cacheable)
Output per document (summary-style)200 / 400 / 800 tokens (low/mid/high)same
Doc length anchorsactual tokenized samples: 77–515 tokenssame
Retries5% of requests, re-billed in full3% of requests, re-billed in full
Cachenone (no stable prefix)prefix written once, then read at cache price — an idealized warm-cache assumption; see the warm-to-cold range under S2 (terms in the billing guide)
Rates (checked 2026-11-11)DeepSeek ¥2/¥8 peak; OpenAI $2/$10same + DeepSeek off-peak half; OpenAI Batch 50%

The formula per document is the same one our cost calculator uses: cost = (input tokens × input price + output tokens × output price + cache reads × cache price) / 1,000,000, then × documents × (1 + retry rate). Output tokens are a stated assumption — summaries here; translation would scale output with document length instead.

Scenario S1 — one-off small batch (50 docs/month)

Language / tier (doc tokens)DeepSeek peak, /monthOpenAI sol, /monthPer 1,000 docs (DS / OAI)
EN low (79 tok)¥0.13$0.16¥2.7 / $3.1
ZH low (77 tok)¥0.13$0.16¥2.7 / $3.1
EN mid (283 tok)¥0.24$0.28¥4.8 / $5.6
ZH mid (309 tok)¥0.24$0.28¥4.8 / $5.7
EN high (495 tok)¥0.43$0.51¥8.6 / $10.3
ZH high (515 tok)¥0.43$0.52¥8.6 / $10.3

Fifty small documents cost less than a coffee. The budget-relevant reading is the last column: per 1,000 documents you are in the ¥3–9 / $3–10 range across the low/high spread — including the 5% retry cushion. If someone quotes you a four-figure monthly "AI budget" for this workload, the number is not coming from token math.

Scenario S2 — repeated processing (500 docs/month, cached prefix)

The table below is an idealized warm-cache lower bound: it bills the 4,000-token shared prefix at the cache-read price on every request, i.e. it assumes the prefix stays cache-hot for the whole month. Real months land between the warm bound here and the cold range right after the table, depending on how request pacing compares with the vendor's TTL. The 4,000-token prefix clears OpenAI's documented 1,024-token minimum cacheable prefix, so caching applies.

Variant (warm-cache bound; retries included; EN 79/283/495 tok, ZH 77/309/515 tok)low EN / ZHmid EN / ZHhigh EN / ZH
DeepSeek peak (¥2/¥8)¥0.99 / ¥0.99¥2.02 / ¥2.05¥3.89 / ¥3.91
DeepSeek off-peak (= half)¥0.49 / ¥0.49¥1.01 / ¥1.02¥1.94 / ¥1.95
OpenAI sol ($2/$10)$1.32 / $1.32$2.56 / $2.58$4.84 / $4.86
OpenAI Batch (= 50%, deferable)$0.66 / $0.66$1.28 / $1.29$2.42 / $2.43

Per 1,000 documents in the mid tier (twice the 500-doc column, per language): DeepSeek peak ¥4.04 (EN) / ¥4.10 (ZH), off-peak ¥2.02 / ¥2.05; OpenAI sol $5.11 (EN) / $5.17 (ZH); OpenAI Batch $2.56 (EN) / $2.58 (ZH). Three structural notes: (1) with a 4,000-token shared prefix the cache saving is modest at these document sizes — caching becomes dramatic only when the shared context is large relative to the document; (2) the discounts stack differently by vendor (Batch halves everything on OpenAI; DeepSeek halves by running off-peak — see the billing guide); (3) quarterly re-processing of the same corpus re-bills every request unless you cache at the application layer and nothing changed.

The warm bound is not the bill you should expect by default. If requests stop for longer than the cache TTL, the next request pays to write the cache again: OpenAI's GPT-5.6+ models bill writes at 1.25× input for the 30-minute TTL ($2.50/1M here) or 2.5× for 12 hours ($5/1M) — replacing the input charge on those tokens; DeepSeek has no write fee, so a cold request just pays the normal cache-miss input price. Computed on the mid EN workload, the spread is: warm $2.56 → cold-every-request $7.50 (30m TTL) or $12.65 (12h TTL) per 500 docs on OpenAI, and warm ¥2.02 → cold ¥6.06 on DeepSeek peak — roughly a 3× swing from caching alone. A one-shot backfill of 500 documents in a single afternoon behaves like the warm bound; one document per working hour all month behaves like the cold bound. Pick your end of the range from your own schedule, and treat a vendor's returned usage counts as the ground truth when costs matter.

An earlier version of this section labeled the OpenAI 500-doc figures ($2.58/$1.29) as per-1,000 numbers and mixed the English-sample table with Chinese-sample model counts; the tables and the per-1,000 sentence are now generated from one dataset per language and were corrected on 2026-11-12.

What is NOT in these numbers

  • OCR — scanned paper needs text extraction first (a separate step with its own cost or its own quality risk); the tables assume clean digital text.
  • Embeddings / vector storage — retrieval-augmented setups pay for embedding calls and a vector database; not modeled here.
  • Human review — someone reading summaries and fixing mistakes is usually the largest cost in the pipeline; it never appears in an API bill.
  • Peak traffic spikes — the monthly totals assume steady volume; a one-day 10× spike multiplies that day's cost by 10×.
  • Model changes — rates moved to a different tier change the budget, not the arithmetic.

YYYSI tool packs vs vendor API — different products

If your need is occasional manual tasks (summarize one file now and then), the YYSI toolbox's AI tools cover that with 3 free site-wide trials, then one-time usage packs ($4.99 / 100 uses, $9.99 / 250) — a per-use product for human-driven tasks, with files processed through YYSI's server to the AI provider. A document pipeline (hundreds of documents, triggered automatically, results fetched by code) needs the vendor API with a billed account — usage packs are not designed for that and the trials will not stretch. Pick by shape of work, then budget with this page's method.

Budget checklist

  1. Measure tokens on your real documents (tiktoken for OpenAI encodings; or the usage counts returned by one test call per document shape on your vendor) — never from page counts. If your text is Chinese, expect a higher token density than English (our samples: ≈1.3 vs ≈4–5 chars/token), and measure rather than assume a fixed multiple.
  2. Write down the instruction prefix and whether it is stable enough to cache.
  3. Assume an output length and say it out loud — output tokens often rival input cost on verbose tasks.
  4. Add a retry multiplier (2–5% is typical) and accept that retries re-bill the whole request.
  5. Decide which discounts legitimately apply: Batch only for deferable work; off-peak only on DeepSeek and only at night; caching only for genuinely shared prefixes.
  6. List the excluded costs (OCR, embeddings, storage, human review) so the budget is honest about its boundary.
  7. Re-check rates on the prices-data page or model-prices JSON before committing, and re-run the calculator with fresh numbers.

Try it with our documents

The six sample documents and the full assumptions/model file are the exact material behind every number above (YYSI-made synthetic text; no real companies or people). Tokenize them yourself and compare — then swap in your own documents and re-derive the low/mid/high anchors the same way.

Rates were verified on official pages on 2026-11-11 and re-verified on 2026-11-12 (sources linked above); the tokenizer was tiktoken o200k_base. The arithmetic script and its console output are preserved in YYSI's private run directory for reproducibility.

Sources & verification

Sources checked Token counts for the six sample documents were measured with tiktoken's o200k_base encoding on 2026-11-11 — that measurement is real and unchanged; it is an actual tokenization under that specific encoding, not a verified mapping to every OpenAI model (a model may use a different encoding; the authoritative count is the usage figure each API response returns). The earlier ±10-30% estimate for other vendors and the "Chinese ≈ 4x English per page" generalization were not evidenced beyond these six samples and were narrowed on 2026-11-12. API rates were verified on official pages on 2026-11-11 and re-verified 2026-11-12. Corrections of 2026-11-12: (1) the per-1,000-documents sentence repeated the 500-document OpenAI figures ($2.58/$1.29) and mixed the English-sample table with Chinese-sample model numbers — the S1/S2 tables now label language per row/column and per-1,000 values were recomputed from the same data; (2) the S2 table assumed a fully warm cache all month — it is now labeled an idealized warm-cache lower bound and a computed warm-to-cold range was added. Volumes, instruction-prefix sizes, output lengths and retry rates are stated assumptions for hypothetical workloads — every figure in this guide is a budget EXAMPLE, not a measured bill, and YYSI did not run any vendor billing for this article. The arithmetic script and its output are preserved in YYSI's private run directory; the sample documents and the full assumptions/model file are downloadable below.

Read our editorial standards or send corrections to [email protected].