Claude With The Anthropic Api
a self-paced course

Claude With The Anthropic Api

73 lessons, each a self-contained pack — study notes, flashcards, and a spoken recap. Open offline; learn at your own pace.

// lessons
73
// Flashcards
629
// audio
0 recaps
01lessons

The course, lesson by lesson.

Each card opens a full lesson: notes to read, cards to drill, and a recap to listen to. Start anywhere; they stand alone.

02 Lesson
Overview of Claude models

All three models share Claude's core capabilities: text generation, coding, image analysis, and other tasks

10 cards notes
Open lesson →
03 Lesson
Accessing the API

Step 1:** User enters text in web app and clicks send

8 cards notes
Open lesson →
05 Lesson
Making a request

Step 1**: Install packages in Jupyter notebook using `%pip install anthropic python-dotenv

8 cards notes
Open lesson →
06 Lesson
Multi-Turn conversations

The Anthropic API and Claude do not store any messages sent to them

9 cards notes
Open lesson →
07 Lesson
Chat exercise

Prompt user for text input using the built-in `input()` function

8 cards notes
Open lesson →
08 Lesson
System prompts

System prompts customize the style and tone of Claude's responses

7 cards notes
Open lesson →
09 Lesson
System prompts exercise

• **System prompts assign roles to Claude** - You can define a specific persona or role (e.g., "Python engineer") to guide the AI's behavior and response style

6 cards notes
Open lesson →
10 Lesson
Temperature

Claude tokenizes input text (breaks it into smaller chunks)

9 cards notes
Open lesson →
12 Lesson
Response streaming

User messages sent to Claude can take 10-30 seconds to receive a response

10 cards notes
Open lesson →
13 Lesson
Structured data

Technique for generating **structured data** (JSON, Python code, bulleted lists) with no extra commentary

8 cards notes
Open lesson →
14 Lesson
Structured data exercise

Generate three AWS CLI commands in a single response with no additional commentary or explanation

7 cards notes
Open lesson →
16 Lesson
Prompt evaluation

Prompt engineering**: techniques for writing/editing prompts to help Claude understand requests and respond as desired

7 cards notes
Open lesson →
17 Lesson
A typical eval workflow

No single standardized methodology for assembling evaluation workflows across the industry

7 cards notes
Open lesson →
18 Lesson
Generating test datasets

Create a prompt to help users write AWS-specific code

9 cards notes
Open lesson →
19 Lesson
Running the eval

Process each test case by merging it with a prompt, sending to Claude, and grading the output

7 cards notes
Open lesson →
20 Lesson
Model based grading

A grader takes model output and returns an objective signal (commonly a number between 1-10, where 10 = high quality, 1 = low quality)

10 cards notes
Open lesson →
21 Lesson
Code based grading

Code grader validates model output to ensure it returns only plain Python, JSON, or regular expressions without explanations

6 cards notes
Open lesson →
22 Lesson
Exercise on prompt evals

Goal: enhance model grader by providing context about what constitutes a good solution

8 cards notes
Open lesson →
24 Lesson
Prompt engineering

Series of videos building on a single prompt iteratively

10 cards notes
Open lesson →
25 Lesson
Being clear and direct

The **first line of your prompt is the most important** — use it to set the task clearly

7 cards notes
Open lesson →
26 Lesson
Being specific

Being specific means providing guidelines or steps to direct the model toward a particular output

8 cards notes
Open lesson →
27 Lesson
Structure with XML tags

Purpose**: XML tags clarify and organize content within prompts, especially when interpolating large amounts of data

7 cards notes
Open lesson →
28 Lesson
Providing examples

One-shot prompting**: Providing a single example in your prompt

9 cards notes
Open lesson →
29 Lesson
Exercise on prompting

Goal: Improve an existing prompt to extract topics from scholarly article passages

7 cards notes
Open lesson →
32 Lesson
Project overview

Build a Jupyter notebook project to teach Claude how to set reminders for future dates

8 cards notes
Open lesson →
33 Lesson
Tool functions

Tools allow Claude to retrieve extra information by executing Python functions automatically

7 cards notes
Open lesson →
34 Lesson
Tool schemas

JSON schema is a data validation specification—a set of rules for validating any JSON data

8 cards notes
Open lesson →
35 Lesson
Handling message blocks

Include a `tools` keyword argument when calling `client.messages.create()

8 cards notes
Open lesson →
36 Lesson
Sending tool results

Access the tool use block from Claude's response via `response.content[1]

9 cards notes
Open lesson →
37 Lesson
Multi-turn conversations with tools

Goal is to wire up multiple different tools to Claude, not just one

8 cards notes
Open lesson →
38 Lesson
Implementing multiple turns

Keep calling Claude in a loop until it stops requesting tool use

8 cards notes
Open lesson →
39 Lesson
Using multiple tools

Tool Implementation Already Provided**: The code for `add_duration_to_date_time` and `set_reminder` functions was pre-built in the tools and schemas cell

7 cards notes
Open lesson →
40 Lesson
Fine grained tool calling

Streaming delivers real-time API responses as a series of events

16 cards notes
Open lesson →
41 Lesson
The text edit tool

Claude has one built-in tool by default: the **Text Editor tool

8 cards notes
Open lesson →
42 Lesson
The web search tool

Built-in tool that allows Claude to search the web for current or specialized information

8 cards notes
Open lesson →
44 Lesson
Introducing Retrieval Augmented Generation

A technique for answering specific questions about large documents by retrieving relevant content before generating responses

10 cards notes
Open lesson →
45 Lesson
Text chunking strategies

RAG workflow: source document → chunk into pieces → user query → retrieve relevant chunks → add to prompt context

19 cards notes
Open lesson →
46 Lesson
Text embeddings

Semantic search** is the process of finding text chunks related to a user's question

10 cards notes
Open lesson →
47 Lesson
The full RAG flow

Step 1: Text Chunking** – Break source documents into separate pieces of text for processing

10 cards notes
Open lesson →
48 Lesson
Implementing the RAG flow

Implementing a complete RAG (Retrieval-Augmented Generation) flow using a vector database

10 cards notes
Open lesson →
49 Lesson
BM25 lexical search

Semantic search can miss relevant results in edge cases

8 cards notes
Open lesson →
50 Lesson
A Multi-Index RAG pipeline

Two search implementations (semantic/vector search and lexical/BM25 search) have nearly identical public APIs

8 cards notes
Open lesson →
51 Lesson
Extended thinking

Extended thinking allows Claude to reason about queries before generating final responses

10 cards notes
Open lesson →
52 Lesson
Image support

Claude can process images included in user messages

10 cards notes
Open lesson →
53 Lesson
PDF support

Claude can read and process content directly from PDF files, not just images

6 cards notes
Open lesson →
54 Lesson
Citations

Citations allow Claude to reference outside sources when generating answers

8 cards notes
Open lesson →
55 Lesson
Prompt caching

Claude performs extensive internal processing on input text before generating output (creating data structures and calculations)

7 cards notes
Open lesson →
56 Lesson
Rules of prompt caching

Initial request to Claude is processed and the work is saved to a temporary cache

9 cards notes
Open lesson →
57 Lesson
Prompt caching in action

Prompt caching allows you to cache repeated content (system prompts, tool schemas, messages) to reduce token usage and costs

10 cards notes
Open lesson →
58 Lesson
Code execution and the Files API

Upload files (PDFs, images, text files) to Claude and receive a unique **file ID

14 cards notes
Open lesson →
60 Lesson
Introducing MCP

A communication layer that provides Claude with context and tools without requiring developers to write extensive custom code

9 cards notes
Open lesson →
61 Lesson
MCP clients

Client provides communication between your server and an MCP server

8 cards notes
Open lesson →
62 Lesson
Project setup

Building a CLI-based chatbot to understand how MCP clients and servers work together

10 cards notes
Open lesson →
63 Lesson
Defining tools with MCP

Building an MCP (Model Context Protocol) server to add functionality to an existing CLI chatbot

8 cards notes
Open lesson →
64 Lesson
The server inspector

Activate your Python environment (check the readme for exact command)

8 cards notes
Open lesson →
65 Lesson
Implementing a client

The MCP client wraps a client session, which is the actual connection to the MCP server

9 cards notes
Open lesson →
66 Lesson
Defining resources

Resources** allow MCP servers to expose data to clients

10 cards notes
Open lesson →
67 Lesson
Accessing resources

MCP client needs a function to request resources defined in the MCP server

8 cards notes
Open lesson →
68 Lesson
Defining prompts

Prompts are pre-built, well-tested message templates that MCP servers expose to clients

8 cards notes
Open lesson →
69 Lesson
Prompts in the client

Call `self.session.list_prompts()` to retrieve all prompts defined in the MCP server

8 cards notes
Open lesson →
70 Lesson
MCP review

Tools**: Model controlled

9 cards notes
Open lesson →
72 Lesson
Anthropic apps

CloudCode** is a terminal-based coding assistant built and deployed by Anthropic

5 cards notes
Open lesson →
73 Lesson
Claude Code setup

Terminal-based coding assistant that runs in your terminal

9 cards notes
Open lesson →
74 Lesson
Claude Code in action

Cloud Code is not just a code-writing tool—it's like having another engineer working alongside you on a project

10 cards notes
Open lesson →
75 Lesson
Enhancements with MCP servers

Cloud Code has an embedded MCP (Model Context Protocol) client that allows connection to MCP servers

7 cards notes
Open lesson →
76 Lesson
Agents and workflows

Workflows and agents** are strategies for handling user tasks that cannot be completed by Claude in a single request

9 cards notes
Open lesson →
77 Lesson
Parallelization workflows

Asking Claude to evaluate multiple material options in one prompt is inefficient

10 cards notes
Open lesson →
78 Lesson
Chaining workflows

Prompt chaining** breaks down one large task into a series of smaller, sequential subtasks

6 cards notes
Open lesson →
79 Lesson
Routing workflows

Different topics require different video script styles and tones

8 cards notes
Open lesson →
80 Lesson
Agents and tools

Workflows** are best when you know the exact sequence of steps needed

9 cards notes
Open lesson →
81 Lesson
Environment inspection

Agents need to inspect their environment after (and sometimes before) taking actions to understand results

7 cards notes
Open lesson →
82 Lesson
Workflows vs agents

Predefined series of calls to Claude with a known sequence of steps

10 cards notes
Open lesson →
85 Lesson
Course Wrap Up

Anthropic offers **Haiku** (fast, smaller requests) and **Sonnet** (greater intelligence)

8 cards notes
Open lesson →