Claude API tutorial
The fastest useful way to learn the Claude API is to build one small service that has to make real engineering tradeoffs. This tutorial uses a customer-support triage API: it classifies an incoming ticket, decides when a person must review it, and measures whether the result is reliable.
Structured outputs with TypeScript and Zod
Claude structured outputs let you give the model a schema and receive a validated, typed result instead of hoping a prose instruction produces parseable JSON. In TypeScript, define the schema once with Zod, use it to constrain the API response, and handle the possibility that no parsed result is available.
Claude tool use
Claude tool use lets a model request facts from your systems before it answers. A reliable implementation does not merely expose functions: it gives the model clear rules for when to call them, executes only the approved tools, caps the loop, and records the full trace and total cost.
Prompt caching and evals
Prompt caching lowers input cost when many requests share a long, stable prefix such as a policy handbook. Evals tell you whether the change preserved the behavior you need. Use them together: caching without measurement can hide a cost regression, and evaluation without usage data can miss the cost of an otherwise correct system.