Tutorials · the Currents timeline
Notes on streaming AI into real products: clients, models, costs and protocols.
-
Cancelling an AI Stream from the Client Side
Build a reliable Stop button for AI streaming with AbortController, safe cleanup, cancellation propagation, and practical testing steps.
-
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.
-
Streaming in Node.js with the OpenAI SDK
Build a streaming Node.js client step by step with the OpenAI SDK, incremental text handling, error checks, and Fluxio configuration.
-
Streaming in Python with the OpenAI SDK
Build a Python streaming client step by step, handle text chunks safely, and connect the OpenAI SDK to Fluxio.
-
Responses API Streaming Events: A Step-by-Step Guide
Build a Responses API streaming workflow with text deltas, tool-call events, completion checks, and practical error handling.
-
Timeouts for Long Streamed Generations: Step by Step
Configure streaming timeouts, prevent proxy disconnects, handle partial output, and test long AI generations with a practical walkthrough.
-
Handle 401 and 402 Errors in Chat Clients Gracefully
A step-by-step guide to authentication errors, payment failures, streaming recovery, and clear retry flows in AI chat clients.
-
Base URL Configuration in Popular AI SDKs
Configure custom API base URLs in Python, JavaScript, and Java SDKs, then validate authentication, endpoint paths, and streaming.
-
Streaming Structured JSON: A Step-by-Step Guide
Build streaming JSON responses with schema constraints, incremental previews, final validation, and reliable error handling.
-
Streaming Function Calls: Assemble Partial Arguments
A step-by-step guide to buffering streamed tool arguments, validating complete JSON, and executing function calls safely.
-
Concurrency Limits for Simultaneous AI Streams
A step-by-step guide to sizing AI stream concurrency, bounding queues, handling backpressure, and testing capacity safely.
-
Handle Rate Limits and 429s in Real-Time Apps
A step-by-step guide to handling HTTP 429 errors, retry delays, streaming interruptions, and traffic spikes in real-time AI apps.
-
Handling Reconnects and Partial Streaming Messages
Build resilient AI streaming interfaces with safe parsing, replay cursors, deduplication, bounded retries, and clear partial-message states.
-
Stream to the Browser with fetch and ReadableStream
Build a streaming AI interface step by step with fetch, ReadableStream, UTF-8 decoding, cancellation, and reliable backend delivery.
-
Proxy SSE Through nginx Without Buffering
Configure nginx for unbuffered SSE, set streaming headers and timeouts, and verify that AI responses arrive incrementally.
-
Server Stream Backpressure and Flushing, Step by Step
Learn how to pipe AI streams through your server with backpressure, prompt flushing, proxy configuration, cancellation, and slow-client tests.
-
Gemini streamGenerateContent with alt=sse: Step by Step
Build a Gemini SSE stream step by step, from an authenticated request to event parsing, incremental rendering, and production checks.
-
Get Streaming Token Usage with include_usage
A step-by-step guide to requesting, reading, and recording token usage in streamed Chat Completions without interrupting real-time output.
-
Anthropic Streams: message_start to message_stop
Follow Anthropic message streams step by step, from SSE parsing and content deltas to tool inputs, usage tracking, and message_stop.
-
Parsing OpenAI-Style Streaming Chunks Correctly
A step-by-step guide to decoding SSE, assembling text deltas, handling tool calls, and detecting completion in OpenAI-style streams.
-
Server-Sent Events for Chat Developers: Step by Step
Build streaming AI chat with server-sent events: choose a client, parse messages, render replies, and handle cancellation and reconnects.
-
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.
-
How to Read Usage Logs and Find Expensive Requests
Follow a practical walkthrough to rank AI requests by cost, investigate token usage, trace retries, and verify savings.
-
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.
-
Caching Repeated Context in Support Bots: 7 Steps
Build a layered caching strategy for support bots with stable prompt prefixes, safe cache keys, policy invalidation, and streaming benchmarks.
-
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.
-
Trial Credits and Abuse Prevention in Chat Apps
Build a safer AI chat trial with credit ledgers, streaming spend controls, signup checks, and abuse monitoring in six practical steps.
-
When Monthly Passes Beat Per-Token Coding Agent Bills
A step-by-step guide to comparing coding agent subscriptions with token billing, calculating break-even usage, and choosing a hybrid setup.
-
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.
-
Pay-as-You-Go vs Monthly Passes for Chat Products
A step-by-step guide to comparing token costs, monthly passes, usage limits, and margins as your streaming AI chat product grows.
-
-
Reasoning Models and Streamed Thinking Tokens
A step-by-step guide to reasoning models, thinking tokens, streaming APIs, latency, cost, and practical Fluxio integration.
-
Compare AI Models for Customer-Support Chat Widgets
A step-by-step guide to comparing support chatbot models on accuracy, streaming speed, safety, cost, and real customer outcomes.
-
Fable vs Opus: Choose a Premium Chat Flagship
A step-by-step guide to comparing Fable and Opus on answer quality, streaming latency, token costs, and premium chat reliability.
-
Which Model Streams Code Best in Chat?
Follow a practical walkthrough to compare coding models for streaming speed, code quality, cost, and a smoother chat interface.
-
Context Windows and Streamed Replies: A Practical Guide
Learn how context windows affect streamed AI replies, budget tokens, handle output limits, and build reliable real-time experiences.
-
How to Pick Models for a Voice Assistant Pipeline
Choose voice assistant models step by step, balancing latency, streaming, tool accuracy, speech quality, and cost with realistic tests.
-
MiniMax and Hunyuan Fallbacks for Streaming Chat
Build reliable streaming chat with MiniMax M3 and Hunyuan 4 fallbacks, safe retry rules, clear timeouts, and production monitoring.
-
Grok for Conversational Products: A Practical Guide
Build a streaming Grok chat experience step by step, from API setup and conversation state to safety, latency testing, and launch.
-
GLM and Qwen for Multilingual Live Chat
Build multilingual live chat with GLM and Qwen, streaming responses, reliable language handling, and practical production safeguards.
-
Build Kimi Long-Context Chats With Streaming
Build a streaming Kimi chat interface with secure API calls, context budgeting, incremental rendering, and reliable error handling.
-
Build Budget DeepSeek Chatbots That Stream Smoothly
A step-by-step guide to building a budget DeepSeek chatbot with token streaming, secure API access, cancellation, and cost controls.
-
Gemini 3.1 Pro vs Claude Opus 5.5: Reasoning Guide
Compare Gemini 3.1 Pro and Claude Opus 5.5 with a step-by-step test for reasoning quality, multi-turn reliability, streaming latency, and cost.
-
Gemini Flash Live Summaries: A Step-by-Step Guide
Build live summaries with Gemini Flash, streaming responses, rolling context, and a practical update loop through an OpenAI-compatible API.
-
Opus vs Sonnet for Streaming Chat: Step by Step
Compare Opus and Sonnet for streaming chat with practical steps for latency testing, quality evaluation, routing, and Fluxio integration.
-
GPT-6.1 Sol for Low-Cost Streaming Assistants
A step-by-step guide to building a fast, token-efficient streaming assistant with GPT-6.1 Sol and Fluxio.
-
GPT-6 Astra vs GPT-5.6 Sol: Long-Form Workflow
Compare GPT-6 Astra and GPT-5.6 Sol for long-form writing with a practical workflow covering prompts, streaming, quality checks, and cost.
-
When Haiku Is Enough for Real-Time Autocomplete
A step-by-step guide to choosing Claude Haiku 4.5 for fast, useful autocomplete without unnecessary model cost.
-
Debug a Coding Agent That Stops Streaming Halfway
Trace interrupted AI streams step by step, isolate buffering and timeout failures, and recover coding agents without duplicating tool actions.
-
Shell Aliases to Switch Your Coding Agent Models
Create shell aliases for Claude Code, switch models through Fluxio, and keep API keys out of your shell configuration.
-
Gemini CLI vs Claude Code: Refactoring Walkthrough
Compare Gemini CLI and Claude Code through a practical refactoring workflow, from repository inspection to tests, review, and streaming API setup.
-