Mindket
AdvancedFree

Claude API course: build an AI agent from scratch

A black banner titled "Claude API" over the line "Calls, tools, caching and an agent loop".

This Claude API course takes a developer from a first request to a working agent in four lessons. You make a Messages API call in Python and TypeScript, let Claude call your functions, cache a long prompt and write the agent loop yourself. Every step follows Anthropic's documentation as it stood on 4 November 2026.

What you'll be able to do

  • Make a Messages API call with a system prompt, stream it and read usage and stop_reason.
  • Define tools with JSON Schema and run the tool_use and tool_result round trip.
  • Place cache breakpoints, then read the usage fields to confirm a cache hit.
  • Write an agent loop with a turn limit, error results and a plan for context growth.
All courses

Who it's for

For developers who write Python or TypeScript and want to call Claude directly. You need a Claude Console account with an API key, Python 3.10 or later or Node.js 20 or later, and a terminal.

Lessons

  1. 1Claude API tutorial: your first call in Python and TypeScriptA Claude API tutorial for developers: get a key, install the SDK, make your first Messages API call in Python and TypeScript, stream it and read usage.8 min
  2. 2Claude tool use: define tools and handle tool calls in PythonClaude tool use for developers: define tools with JSON Schema, run the tool_use and tool_result round trip, set tool_choice and report tool errors.8 min
  3. 3Claude prompt caching: add cache_control and read the usage fieldsClaude prompt caching for developers: place cache_control breakpoints, check the minimum length per model, read usage and find out why a cache missed.9 min
  4. 4Build an AI agent with the Claude API from scratchBuild an AI agent with the Claude API from scratch: write the tool loop, cap the turns, report errors and plan for context growth in Python.8 min

Frequently asked questions

What do I need to follow the Claude API course?

A Claude Console account, an API key and Python 3.10 or later. Lesson 1 also shows TypeScript, which needs Node.js 20 or later. API usage is billed by tokens, so expect a small bill while you test.

Does the course use Python or TypeScript?

Lesson 1 shows both. The tool use, caching and agent lessons use Python, and the TypeScript SDK follows the same request shapes with camelCase helpers, so the ideas carry over.

Do the lessons use the Claude Agent SDK?

No. Lesson 4 writes the loop by hand so you see every step, then explains when the tool runner or the Agent SDK is the better tool.

Which model ids do the lessons use?

The ids on the models page on 5 November 2026, mainly claude-opus-5-5. Ids and versions change, so each lesson dates them and tells you where to copy the current ones.

What should I learn after this course?

The RAG course is next. It covers giving an agent your own documents to search, which this course leaves out.

Share this course

See finished AI agents

Browse agents built by other developers on Mindket, with their setup notes, then list one of your own.

Browse AI agents

All courses · All articles