307 Flashcards for About $1.20 in Tokens
01 / The receipt line: 307 cards for about $1.20 in tokens
Here is the whole plan in one paragraph. Take one PDF textbook part, extract plain text with free tools, cut it into 200-word blocks, ask a cheap model one question per block, save the answers as a CSV, and import that CSV into Anki. That is the entire pipeline. No subscription, no flashcard service, no 40-hour video course.
The run behind this article covered roughly 60,000 words of an introductory textbook part, about 150 printed pages. It produced 307 usable cards. The calls consumed about 108,000 input tokens and 46,000 output tokens, call it 154,000 tokens total. At the rate I pay for DeepSeek V4 Flash through CheapRelay, that bill came to about $1.20. CheapRelay is a pay-as-you-go AI relay: one key reaches many models, billing is per real token including cache reads and writes, and there is no monthly fee. Treat the $1.20 as a receipt from one real run, not as a quote. Your number moves with the model you pick and how much of the book you turn into cards.
The point of this walkthrough is not to save a fortune. It is to show that a study habit that used to require a paid app now costs less than a coffee refill, and that the work is three short scripts and one long evening.
02 / Extract text with free tools before a single token is spent
Textbooks are hostile to machines. Two columns, figures in the middle of paragraphs, running headers, page numbers, answer keys. Every one of those artifacts costs tokens later, so spend free CPU time now instead of paid tokens later.
Start with pdftotext, which ships with poppler-utils on Linux and is a brew install away on macOS. The layout flag keeps reading order sane. If the output looks like English when you scroll through it, you are done with extraction. If the output is empty or garbled, the book is a scan and you need OCR: tesseract with an English model will chew through 150 pages in a few minutes on an old laptop. Money cost of both tools: zero.
- ■ Delete running headers, footers, page numbers, and index lines with a grep or a small Python script.
- ■ Drop figure captions. They describe pictures you did not extract, and models make up the missing visual context.
- ■ Keep bolded terms and their definitions. Those are the highest-value material for cards.
- ■ Convert tables by hand into short sentences. Tables tokenize badly and models drop cells.
After cleaning, I had about 60,000 words of clean prose. That number matters, because every word you keep is a word you pay to send.
03 / Split the chapter into 200-word blocks and keep the prompt tiny
One giant request per chapter looks efficient and is not. The model loses fine detail in long inputs, and a failure costs you the whole call. 200 words is a small, checkable unit: roughly one textbook paragraph plus its neighbour, enough context for a single testable fact and nothing more.
My script cut the cleaned text into 250 blocks of 200 words with a 20-word overlap so definitions that straddle a boundary are not lost. The overlap is the only duplication I paid for. At 200 words, each block is about 265 tokens. The prompt attached to each call is about 95 tokens. So each call runs near 360 input tokens, and 250 calls cost about 90,000 input tokens before output.
- ■ Never change the system prompt between calls. Identical text across calls is cache-friendly, and cache reads and writes are billed, so consistency keeps the arithmetic predictable.
- ■ Ask for exactly one card per block, with permission to skip blocks that contain no testable fact. Skips are free quality control.
- ■ Ask for plain text fields, not markdown tables. You will parse the output, and tables break parsers.
- ■ Batch 20 blocks per script run and write results to disk incrementally, so a crash costs you 20 calls, not 250.
04 / The 95-token prompt that produced clean front and back fields
This is the whole prompt I sent with every block, and it is deliberately blunt. Long prompts are expensive when they are repeated 250 times, and vague prompts cost you more in editing than they save in typing.
You are making one study flashcard from the textbook excerpt below. Write only these three lines. Line 1 starts with Q: and contains one specific question about a fact, definition, mechanism, or comparison in the excerpt. Line 2 starts with A: and contains the answer in at most 30 words, using the terminology of the excerpt. Line 3 starts with T: and contains the chapter topic in at most 5 words. If the excerpt has no testable fact, write exactly SKIP. Do not add explanations, numbering, or blank lines.
Two rules did most of the work. The 30-word answer cap prevents the model from writing mini essays, which would have roughly doubled my output tokens and made the cards unreadable at review time. The three-line format makes parsing a one-line regex instead of an afternoon.
Output was about 150 tokens per card across 307 cards, so 46,000 output tokens. I threw away 12 cards by hand after import: 7 duplicated a neighbouring block because of the overlap, 3 asked about a figure I had deleted, and 2 were generic questions I would have answered without studying. That is a 4 percent throwaway rate, which is cheap. Fixing a bad card costs a minute; learning from a wrong one costs an hour.
05 / Counting tokens so the bill stays under two dollars
The arithmetic is simple enough to do on paper. Input tokens are roughly blocks times 360. Output tokens are roughly cards times 150. Multiply both by the per-token rate shown for the model you choose, add the two products, and you have your bill before you spend it.
- ■ 300 blocks at 360 input tokens is about 108,000 input tokens.
- ■ 300 cards at 150 output tokens is about 45,000 output tokens.
- ■ Ask for short answers. A 30-word cap is the single biggest lever on output cost.
- ■ Reuse one prompt everywhere. Predictable repeated text keeps cache behaviour simple, and cache reads and writes are billed either way.
- ■ Run 5 blocks first and read the result before sending 250. A bad prompt discovered at call 6 costs pennies to fix.
For this run I used DeepSeek V4 Flash. For heavier chapters with dense derivations I would switch to a larger model for the 20 hardest blocks only and keep the cheap one for the rest. Splitting the workload like that is the whole reason a relay beats paying one vendor: the same key and the same OpenAI-compatible routes work for both calls.
06 / Clean, import, and review the deck over fifteen days
Export the parsed cards as CSV with three columns: front, back, tag. Anki imports that directly. The tag column carries the chapter name, so you can suspend a whole chapter if your syllabus changes and never waste a review minute on material you will not be tested on.
- ■ Sort by question text and delete duplicates before importing, not after.
- ■ Check for answers longer than 40 words and cut them. Long answers do not survive first-pass review.
- ■ Spot-check every card whose question contains a number, because models round and reorder figures.
- ■ Set the deck to 20 new cards a day. 307 cards then last about 15 days instead of drowning you in one weekend.
The finished stack is boring on purpose: pdftotext for extraction, tesseract only if the book is a scan, a 60-line Python script for chunking and parsing, one API key, and a CSV. No dashboard, no account tiers, no lock-in. The expensive part of studying was never the cards. It was re-reading 150 pages and pretending that counted as practice.
If you want to run this on your own textbook, sign up at CheapRelay and use the single key with any OpenAI SDK. The API base is https://api.cheapapirelay.com with OpenAI-compatible routes under /v1, and billing stays per real token with no monthly fee. Then send five blocks, read the output, fix your prompt, and only then send the rest of the chapter.
Sign up Try the prices yourself, sign-up credit included.
More reading
| Date | Aisle | Written in | Title |
|---|---|---|---|
| 2026-10-30 | Cheap how-tos | EN | $3 a Month Bought Our Team a Prompt Style Guide A beginner walkthrough for writing a team prompt style guide on a $3 monthly budget: templates, token math, tests and a weekly review. |
| 2026-10-30 | Cheap how-tos | EN | Trim Prompt Cost from $12.40 to $1.40 a Week A beginner walkthrough for cutting user data out of prompts, with worked token math that turns a $12.40 week into $1.40. |
| 2026-10-30 | Cheap how-tos | EN | A $10 Test Budget for Judging AI Output A beginner walkthrough for judging AI output quality with a spreadsheet, a rubric and a $10 budget. |
| 2026-10-30 | Cheap how-tos | EN | $3.80 a Month After Dropping the Free Tiers A beginner walkthrough for moving a hobby project from free AI tiers to pay-as-you-go on a five-dollar monthly budget. |
| 2026-10-30 | Cheap how-tos | EN | A $2.17 Receipt for My Personal Knowledge Chatbot A beginner walkthrough: 46 documents, 240 chunks, 1.42M tokens, one $2.17 monthly receipt. No subscription, no vector database, no fixed cost. |
| 2026-10-30 | Cheap how-tos | EN | $20 a Month, Hard Cap: My Side-Project AI Bill A beginner walkthrough for capping a tiny side project at $20 a month, with token math, a dry run and the CheapRelay setup I use. |