Learning path
Building with the Claude API
Learn to build with the Claude API from your own code: the Messages API, tool use, structured output and prompt caching, then evaluate and trace what you built.
Bookmark
Bookmarks are kept in your free account, so you can find this page again on any device.
Sign in to bookmarkWhat you will be able to do
- Send Messages API requests with a system prompt and a multi-turn conversation
- Define a tool, handle a tool_use response and return a tool_result
- Get schema-valid JSON back and validate it in your code
- Use prompt caching to cut cost and latency on repeated prefixes
- Test and trace an LLM feature before it reaches users
Steps
Step 1: Get started with Claude (opens on Claude Docs in a new tab)
Create an API key and make your first request.
External resource, not tracked
Step 2: Working with the Messages API (opens on Claude Docs in a new tab)
External resource, not tracked
Step 3: Prompting fundamentals: clear tasks, examples and formats
How to write a good prompt: frame the task, say who the output is for, show an example and specify the format, so a model's answers are useful and repeatable.
Step 4: Tool use with Claude (opens on Claude Docs in a new tab)
Work through the client tool round trip until you can write it from memory.
External resource, not tracked
Step 5: Get reliable JSON from an LLM with structured outputs
Describe the output as a schema, let the provider enforce it, validate it with Pydantic AI or the AI SDK, and handle failures.
Step 6: Workflows vs agents: start with the simplest thing that works
Most LLM features should be a fixed workflow, not an agent. How to tell which one you need, when an agent earns its cost, and the useful patterns in between.
Before you build anything agent-shaped, check whether a fixed workflow would do.
Step 8: Write your first LLM eval
Turn real outputs into a small test set, add code-based checks in promptfoo and run them in CI to catch regressions on every change.
Step 9: Add tracing and cost tracking to an LLM app
One trace per user action, with tokens, latency and cost for each model call, so slow and costly features stand out.
Building with the Claude API quiz
8 questions with explanations. Your score is saved when you are signed in.
Final quiz
Related paths
Prompt and context engineering
Go from single prompts to deciding what a model sees at each step, from instructions and examples to files and tools.
AI for test engineers
An AI course for testers: apply generative AI to everyday test automation, from AI-assisted test design to generating, healing and reviewing Playwright tests.
AI foundations
The working vocabulary of modern AI, from prompting and structured output to retrieval, MCP, Agent Skills and prompt injection.