What tokens cost
Notes on streaming AI into real products: clients, models, costs and protocols.
-
Build a Typing Indicator From the Token Stream
Build a stream-driven AI typing indicator with clear states, safe event parsing, cancellation, and reliable completion handling.
-
Billing When a User Closes the Tab Mid-Stream
A step-by-step guide to cancelling AI streams, reconciling token usage, and preventing duplicate charges when users close their tabs.
-
Keep Your Hobby Chatbot Affordable, Step by Step
Build a budget-friendly hobby chatbot with token tracking, lean context, streaming replies, sensible model choices, and spending controls.
-
Relay vs. Direct Provider Pricing: A Walkthrough
Compare AI relay and direct provider pricing step by step, including token rates, caching, streaming performance, and integration costs.
-
Cost Dashboards for Chat Features: What to Track
Build a chat cost dashboard step by step, tracking token spend, streaming gaps, retries, conversation costs, and budget alerts.
-
Budgeting max_tokens in Streaming AI Apps
A step-by-step guide to setting output token budgets, handling truncated streams, tracking usage, and controlling AI application costs.
-
Trim System Prompts Without Losing Reliability
A step-by-step guide to cutting system prompt tokens, testing behavior, and measuring real savings in streaming AI applications.
-
Measure AI Cost per Conversation, Not per Call
A step-by-step guide to tracking AI conversation costs, accounting for streaming usage, and optimizing spending without sacrificing outcomes.
-
Stop Runaway Agent Loops Before Surprise Bills
A step-by-step guide to controlling agent costs with shared budgets, turn limits, bounded retries, streaming cancellation, and usage tracking.
-
Choose Cheaper AI Models for First-Draft Replies
Build a draft-first AI workflow with cheaper models, quality checks, selective escalation, and streaming that keeps replies responsive.
-
How to Set Per-User Budgets in a Chat Product
Build per-user AI budgets with atomic reservations, streaming usage tracking, clear limits, and reliable cost reconciliation.
-
What a Streamed Response Costs, Token by Token
Walk through streaming AI costs, from input tokens and output pricing to usage tracking, interrupted streams, and production budgets.
-
Cut Token Spend With Rolling Conversation Summaries
Build rolling summaries step by step to trim conversation history, preserve important context, and measure real token savings.
-
Prompt Caching: Budgeting a Streaming Chat
A step-by-step guide to prompt caching, streaming token costs, cache-hit measurement, and realistic chat budget calculations.
-
How Cached Input Tokens Are Billed: Step by Step
Learn how cache reads, cache writes, and uncached tokens affect API bills, with a worked example and practical steps for streaming AI apps.
-
-
Reasoning Models and Streamed Thinking Tokens
A step-by-step guide to reasoning models, thinking tokens, streaming APIs, latency, cost, and practical Fluxio integration.
-