
Book 1 of 5 · Smilodon populator
AI That Answers
Your First LLM App in TypeScript: Prompts, Structured Output, and What Every Token Costs
Every tutorial gets you to “hello world” with a language model. Then you build the real thing, and the questions start. Why does the same prompt answer differently twice? What is resent on every turn? Why did the bill triple in a week?
- The raw HTTP call before any framework, so no abstraction is magic
- Streaming to a terminal and a browser, including the UTF-8 split trap
- Structured output with Zod: one schema, one type, a validated object
- Cost you can compute to the cent, and five levers to cut it



