Advanced for Developers
0 of 23 done
StartContinueBuild a Work Bot with Tool Use
This section is for people who want to go beyond using Claude in the app and work with it directly through code and the API. Across 23 tutorials, centered on runnable code, you’ll build work bots, build your own agents, connect MCP servers, automate with CI, and manage output quality.
Who is this section for?
Section titled “Who is this section for?”- Developers, or power users who are comfortable reading code and using a terminal
- People who have already tried Claude Code and the API at least once
We don’t repeat the basics. This section is written for readers who have read Claude Code core features (C14), Dividing work among models (C15), and Getting started with the API (C16). If you hit a term you don’t know, go back to those lessons.
What you’ll need
Section titled “What you’ll need”- A Claude API key (manage it only through environment variables; never write it directly in code)
- Python 3.10 or later
- Node.js (needed for the TypeScript and JavaScript examples, MCP servers, and Claude Code)
- A terminal and Git
Suggested learning order
Section titled “Suggested learning order”- API basics: Tool use (01) → Cost optimization (02)
- Agents: Agent SDK (03) → Managed Agents (04)
- Extending and deploying: MCP servers (05) → Skills and plugins (06)
- Automation and quality: Headless mode and CI (07) → Evals (08)
- Applications: Internal document Q&A (09) → Computer and browser tools (10) → Usage and cost analytics API (11) → Web search and web fetch tools (12)
Tutorials in this section
Section titled “Tutorials in this section”- Advanced for Developers
Build a Work Bot with Tool Use
An advanced tutorial: implement the tool definition and tool_use/tool_result loop by hand, shorten it with the SDK tool runner, and build an internal inventory and schedule lookup bot with error handling and an iteration cap
Advanced60 min
- Advanced for Developers
Cut API Costs with Prompt Caching, Batches, and Effort
An API cost optimization reference covering cache read pricing, the 50% Message Batches discount, effort tuning, dividing work among models, token counting, and usage logging, with Python examples and price comparison calculations
Advanced60 min
- Advanced for Developers
Build Your Own Agent with the Claude Agent SDK
A hands-on guide to the Agent SDK, which lets you call the same agent loop as Claude Code from Python or TypeScript code: from a read-only agent to custom tools, locked-down permissions, subagents, and resuming sessions
Advanced60 min
- Advanced for Developers
Run Agents on a Server with Managed Agents
A hands-on guide to Claude Managed Agents (beta), where Anthropic runs the agent loop and sandbox for you: understand the architecture, create an agent, environment, and session, stream the results, and set up dynamic workflows and cost caps
Advanced60 min
- Advanced for Developers
Build Your Own MCP Server and Connect It to Claude
How to build a two-tool MCP server with the official Python SDK and connect it to Claude Code (claude mcp add) and to the Claude app as a custom connector, including least privilege and prompt injection cautions.
Advanced60 min
- Advanced for Developers
Package Skills and Plugins and Roll Them Out to Your Team
A reference covering SKILL.md design principles, plugin structure, marketplaces, quality checks with claude plugin eval, team rollout through repo and org settings, and the Anthropic directory submission portal
Advanced75 min
- Advanced for Developers
Claude Code Headless Mode and GitHub Actions Automation
How to run Claude Code from scripts and CI with claude -p, and automate PR reviews and issue triage with the official GitHub Action. Covers permissions, secrets, and cost caps.
Advanced60 min
- Advanced for Developers
Manage LLM Output Quality with Evals
Build a small Python eval script that uses a test set, answer-based grading and LLM grading to produce scores, and compares regressions every time you change a prompt or model.
Advanced60 min
- Advanced for Developers
Build an Internal Document Q&A Tool: The Files API and Citations
Upload internal PDF and text documents with the Files API and build a Python Q&A tool whose answers come with citations. Also covers when to choose long context vs. RAG, cost, and privacy and retention cautions
Advanced60 min
- Advanced for Developers
Automate On-Screen Work with the Computer and Browser Tool APIs
Understand how the computer toolset (computer_toolset_20260801) and browser toolset (browser_toolset_20260801) are structured, and build a minimal agent loop in Python that runs only in an isolated environment. Includes safety rules and cost caps
Advanced60 min
- Advanced for Developers
Build a Team Usage Dashboard with the Usage and Cost Analytics API
An advanced tutorial on using the Usage and Cost Analytics API (beta) to pull tokens and costs by model, workspace, API key, and user into a CSV and a simple HTML dashboard, including how it differs from the older Usage and Cost API (legacy) and how data delays work
Advanced60 min
- Advanced for Developers
Let Claude Search and Read the Web via the API: Web Search and Web Fetch Tools
Add the web search and web fetch server tools to a Claude API request, restrict domains, cap cost with max_uses and max_content_tokens, show citations, and apply the October 2026 organization-level web fetch controls
Advanced50 min
- Advanced for Developers
Get Reliable JSON from Claude with Structured Outputs
Use output_config.format with a JSON schema (or a Pydantic model) so Claude's reply always parses, add strict tool use for tool inputs, and learn the schema limits, refusal and max_tokens cases, and costs from the official docs
Advanced45 min
- Advanced for Developers
Estimate Costs Before You Send with the Token Counting API
Use the free count_tokens endpoint to measure a request's input tokens, turn the count into a cost estimate with the official price list, and learn what it cannot count, from the official docs
Advanced30 min
- Advanced for Developers
Stream Claude API Responses in Real Time
Turn on streaming for the Messages API, read the server-sent event flow, collect tool-call JSON and thinking deltas, and handle errors and interrupted streams, from the official docs
Advanced40 min
- Advanced for Developers
Process Large Jobs with the Message Batches API
Send thousands of Messages requests as one asynchronous batch at half price: build the request list, poll for completion, match results by custom_id, handle errors, and know the limits, from the official docs
Advanced40 min
- Advanced for Developers
Use Adaptive Thinking and Effort in the Claude API
Turn on Claude's thinking in the Messages API: adaptive thinking versus the legacy budget_tokens mode, the display and effort settings, reading thinking blocks and token usage, and the cost, caching, and streaming cautions, from the official docs
Advanced40 min
- Advanced for Developers
Send Images and PDFs to the Claude API
Put images and PDFs into Messages API requests: base64, URL, and Files API sources, supported formats, size and page limits, how image tokens are counted, and the accuracy limits, from the official docs
Advanced40 min
- Advanced for Developers
Cut Cost and Latency with Prompt Caching
Go deeper than the cost overview: where to put cache breakpoints, automatic versus explicit caching, 5-minute and 1-hour lifetimes, minimum lengths, what invalidates a cache, the usage fields, and cache diagnostics, from the official docs
Advanced50 min
- Advanced for Developers
Handle Claude API Errors, Rate Limits and Retries
What each HTTP error from the Claude API means, which ones to retry, how retry-after and the rate limit headers work, what the SDK retries for you, and how to spot a spend-cap 429, from the official docs
Advanced40 min
- Advanced for Developers
Write Effective System Prompts for Your Claude API App
Where the system prompt goes in the Messages API, and how to give Claude a role, context, clear instructions, examples and an output format with XML tags, based on the official prompting best practices
Advanced35 min
- Advanced for Developers
Manage Your Organization with the Claude Admin API
How the Admin API differs from a regular API key, who can create an Admin key, which endpoints manage members, invites, workspaces and API keys, and how to audit your organization with read-only calls, based on the official docs
Advanced40 min
- Advanced for Developers
Run Claude Managed Agents on Your Own Infrastructure
What changes when you self-host Claude Managed Agents: which parts you run, how to choose a model provider, what leaves your network, which hosted features differ, and how a first local session is started, based on the official docs (access by request)
Advanced45 min