How to wire up Claude API tool use in a Next.js App Router SaaS -- defining tools, running the agentic loop until stop_reason is not tool_use, and keeping the route thin while business logic stays in the service layer.
How to use Anthropic prompt caching to cut Claude API costs by up to 90% in a Next.js SaaS -- where to put cache breakpoints, how to verify cache hits, and what belongs in system vs messages.
How to build a streaming AI chat endpoint in Next.js App Router -- Server-Sent Events, token-by-token output from the Claude API, and a client hook that reads the stream without EventSource.