Check my levelCoursesProgramsFor teamsPricing
UKSign inSign up
Check my levelCoursesProgramsFor teamsPricingClaude quizPromptsBlogFAQSearchSign upUK
AcademlCoursesAnthropic API Fundamentals
Get started free

Online course, Engineering, Claude

Anthropic API Fundamentals: a Python course from pip install anthropic to vision

6 lessons of 20 minutes, about 2 hours: SDK setup, the Messages API format, model choice, parameters, streaming and images. Python code in every lesson.

Start: 7 days freePreview the first lesson, no sign-in

No card needed. The first two lessons are free after sign-up, all lessons come with Pro at $9 a month.

A streamed answer: each line is one word longer than the previous oneLesson 1, 20 minFirst Steps: Installation and Your First Request
  • Beginnerlevel
  • 2 h 15 min6 lessons, 6 modules
  • At your own paceupdated Nov 9, 2026
  • Certificatewith a check code
What you will learnLessonsCertificateQuestionsStart the course

What you will learn

  • Install the SDK, keep the key in .env with python-dotenv and create the Anthropic() client
  • Send a request with the three required fields: model, max_tokens and messages
  • Read the Message object: content, stop_reason and usage with token counts
  • Build a conversation history with alternating user and assistant roles and a console chatbot
  • Give the model few-shot examples right inside the messages array
  • Compare models and effort levels on response time, quality and cost for your own task with the benchmark_models exercise
  • Cap length with max_tokens, cut output with stop_sequences, get JSON through structured outputs and set a role in system
  • Stream responses with client.messages.stream and handle message_start, content_block_delta and message_delta events
  • Send images as base64, several images in one request labeled “Image 1:”, “Image 2:”
  • Get structured answers about images with few-shot examples

How to start with the Claude API in Python

Install the SDK with pip install anthropic (the current version needs Python 3.10+), put your key in the ANTHROPIC_API_KEY variable and call client.messages.create with model, max_tokens and messages. The course walks this path in 6 lessons based on Anthropic's materials, then covers the Messages API format, model choice, parameters, streaming and images.

Pricing and what's free →
01
Free lesson

First Steps: Installation and Your First Request

Install anthropic and python-dotenv, keep the key in a .env file, create the Anthropic() client and send a first request to claude-haiku-5-5: a haiku from Claude in a few lines of code. The lesson reads the answer from blocks with type == "text": current models may return a thinking block before it.

Open the lesson →

Course lessons

Setup and first request → Messages API format → model choice → generation parameters → streaming → vision. One lesson per module, the first two are free.

Module 1 · 1 lesson · 20 min

Getting Started with Claude SDK

Install the SDK, authenticate, and make your first request to the Claude API.

1First Steps: Installation and Your First Requestfree20 minHow to install the anthropic SDK, securely store your API key with dotenv, and send your first request to Claude — from installation to printing the response.
Module 2 · 1 lesson · 20 min

Messages API Format

Message structure, response object, few-shot prompting, and building a chatbot.

2Messages API: Format, Response Object, and Chatbotfree20 minThe messages structure with role and content, the Message object (id, stop_reason, usage), reading text from response blocks, the response format through structured outputs (prefill returns a 400 error since Claude 4.6), few-shot prompting, mid-conversation system messages and a simple chatbot.
Module 3 · 1 lesson · 25 min

Claude Models

Comparing models by speed and capabilities, and criteria for choosing the right one.

3Choosing a Model: Speed, Capabilities, Cost25 minThe current lineup (Fable 5.2, Opus 5.5, Sonnet 5.5, Haiku 5.5): comparing latency, quality and price on real tasks, effort as a second lever, and how to choose a model for your own task.
Module 4 · 1 lesson · 25 min

Generation Parameters

max_tokens, stop_sequences, structured outputs, effort and the system prompt, plus why API version 2026-10-21 removed temperature.

Who the course is for

  • Python developers connecting Claude to a script or a service for the first time
  • Analysts and data engineers who want Claude inside a Jupyter notebook
  • People who use claude.ai and want to do the same work from code, in batches or on a schedule
  • Anyone heading for tool use, RAG or agents: the course gives you the request basics

How each lesson works

  1. A 20-minute lesson with Python codeCode based on Anthropic's API fundamentals notebooks with every step explained. The first four lessons run on current Claude models.
  2. A hands-on task in every lessonFor example, a translate(word, language) function with few-shot examples in messages, or a console chatbot with streaming and a token counter. AI checks your solution and explains what to fix (after sign-up).
  3. Ready code and common mistakesA key hardcoded instead of .env, load_dotenv() called after os.getenv(), reading content[0].text when a thinking block comes first, Claude's reply missing from the conversation history.
  4. A 3-question quiz and an AI tutorThe quiz locks in the lesson, the tutor answers questions on the topic.
  5. CertificateAfter all lessons you get a certificate with a unique verification code.

Certificate of completion

You get it when you finish every lesson. Each certificate has its own code, so an employer can check it on our site. You can add it to LinkedIn.

See how a certificate is checked
Sample

What to change in the lesson code in 2026

Anthropic wrote the course for Claude 3, and every model in its notebooks is now retired: claude-3-haiku-20240307 on April 20, 2026, claude-3-5-sonnet on October 28, 2025, claude-3-opus on January 5, 2026. The first four lessons are updated: they use claude-haiku-5-5 for practice and claude-opus-5-5, where Anthropic recommends starting, read text from blocks with type == "text", and set the format with structured outputs in place of prefill and temperature. The streaming and vision lessons still show claude-3-opus-20240229, claude-3-haiku-20240307 and claude-3-5-sonnet-20240620: swap them for current IDs. A fresh pip install anthropic gives you SDK 2.x with API version 2026-10-21, which answers temperature, top_p and top_k with a 400 error. With thinking on, a stream also carries thinking_delta events that have no text field: print only text_delta or use stream.text_stream. The SDK now runs on httpx2, so install httpx separately for the image download examples. Images can also be passed by link with a type: "url" source.

  • Anthropic — API fundamentals course on GitHub (6 notebooks)
  • Claude API — Get started: install and first request in Python
  • PyPI — the anthropic package (version and Python requirement)
  • Claude API — models overview and pricing
  • Claude API — retired models and parameters
  • Claude API — migrating to version 2026-10-21
  • Claude API — streaming
  • Claude API — vision

What is free and what it costs

  • The first two lessons, setup with a first request and the Messages API format, are open with no payment after a free sign-up.
  • After sign-up you get 7 days of full access to all 6 lessons and the whole catalog, no card needed.
  • After that, Pro costs $9 a month or $79 a year. Online card payment is not connected yet: write to info@academl.com and we open access manually.
  • Claude API calls from the examples run on your own key and are billed by Anthropic at its rates.

Questions about the Anthropic API and the course

How do I install the anthropic library for Python?+

Run pip install anthropic, ideally inside a virtual environment (python3 -m venv .venv). The current SDK 2.x requires Python 3.10 or newer. In Jupyter use %pip install anthropic. The SDK reads the key from ANTHROPIC_API_KEY, and a .env file with python-dotenv is a convenient place to keep it.

Which model should replace claude-3-haiku-20240307?+

Claude 3 Haiku was retired on April 20, 2026, and requests to it fail. The updated lessons use claude-haiku-5-5, the cheapest current model, from $0.10 per million input tokens. Anthropic recommends starting with claude-opus-5-5 at $4 per million input and $20 per million output tokens. Lesson three shows how to compare models on your own task.

Why does temperature return a 400 error?+

API version 2026-10-21 removed temperature, top_p and top_k: a request that sends them gets a 400 error even at the default value, and SDK 2.x no longer has these parameters. Delete them from old code and sampling runs at temperature 1.0. Claude 4.7 and later models already accepted only the defaults. The parameters lesson shows what to use for format, accuracy and variety: structured outputs, effort and the prompt.

Why does message.content[0].text sometimes fail?+

Claude 5 models have thinking on by default, so content can start with a thinking block that has no text field. Loop over the blocks and take those with type == "text", as the quickstart in Anthropic's docs does. The first four lessons read text this way; the streaming and vision lessons still use content[0].text, which worked with Claude 3 models.

How is this different from “Claude API from A to Z”?+

Anthropic API Fundamentals is six short Python lessons based on Anthropic's open notebooks, from setup to images. Claude API from A to Z is 16 lessons with code mostly in TypeScript: tool use, the Message Batches API, prompt caching, computer use and production patterns. Start with the fundamentals if you have never called Claude from code.

The course in short

level
Beginner
For whom
For developers
Task
Code and products
Tool
Claude
Format
Lessons, quizzes and tasks checked by AI
Lesson language
English

Is this course right for you?

Check your level in 3 minutes. We will show which course to start with.

Check my level

More courses on this topic

Full catalog
Intermediate, Claude

Design with Claude: from idea to design system

7 lessons: how to give Claude design tasks, build a DESIGN.md with tokens and components, generate screens in Stitch and code from Figma over MCP.

3 h 12 min, 7 lessonsCertificate
Intermediate, Claude

Claude Code & Agentic Development

10 lessons on Claude Code in real projects: CLAUDE.md, slash commands, task plans, git and PRs, test-first debugging, MCP servers, VS Code, JetBrains and CI.

4 h 10 min, 10 lessonsCertificate
Intermediate, Claude

Claude API from A to Z

16 Claude API lessons with TypeScript code: Messages API, model choice, prompting, tool use, streaming, batches, prompt caching, vision, production.

6 h 28 min, 16 lessonsCertificate
Intermediate

AI Coding: Claude Code, Codex, Cursor, Windsurf

A one-hour course on choosing and using AI coding tools: Claude Code, Codex, Cursor, Windsurf, TDD with AI, plan-based refactoring and a team AI policy.

1 h 5 min, 4 lessonsCertificate

What next

pip install anthropic and your first Claude request — free lesson →Claude API from A to Z: tool use, batches and prompt caching →Tool use in Claude: function calling in Python →Anthropic's interactive prompt engineering tutorial →Prompt evaluations: Anthropic's course with promptfoo →Claude Opus 5.5: what changed and API pricing →

Send your first request to Claude

The lessons on SDK setup and the Messages API format are open after a free sign-up. Sign up with email or Google to get 7 days of full access to every lesson in the course and the whole catalog.

Sign up
CoursesLLM coursesFor teamsPricingFAQBlogAboutPrivacy
© 2026 AcademlDevelopment & promotion —MMIX — Marketing Mix
4
max_tokens, temperature, stop_sequences, and system prompt
25 min
How max_tokens caps all output including thinking, stop_sequences stop it at the right spot, structured outputs return valid JSON, effort sets how much work the model does and the system prompt sets the role. Plus why API version 2026-10-21 removed temperature.
Module 5 · 1 lesson · 20 min

Streaming

Token-by-token streaming to improve Time to First Token and user experience.

5Streaming: Real-Time Responses20 minHow stream=True changes API behavior, SSE event types (MessageStart, ContentBlockDelta, MessageDelta), Time to First Token, the client.messages.stream helper, and custom event handlers.
Module 6 · 1 lesson · 25 min

Vision: Working with Images

Multimodal prompts: images from files and URLs, multiple images, prompting tips.

6Vision: Images in Claude Prompts25 minThe image content block format with base64 encoding, passing images from files and URLs via httpx, multiple images in one request, and few-shot prompting for structured output from images.
Certificate
Your name
for the course
API Fundamentals: Based on Anthropic Materials
ACADEML · VERIFIED · ACADEML · VERIFIED · SAMPLE
Do I need programming experience?+

Basic Python is enough: install a package, run a script, write a function. The course is for people just starting with the API. You create the key in the Claude Console at platform.claude.com, and requests are billed at Anthropic's rates.

Is this course connected with Anthropic?+

It is built on Anthropic's open API fundamentals course from the anthropics/courses repository: the same six topics and the code from the notebooks. Academl added the lesson texts, AI-checked tasks, quizzes and a tutor. The repository is now archived, so the API changes since the course was recorded are collected on this page.

How much does the course cost?+

The first two lessons are always free. After sign-up you get 7 days of full access with no card. Pro opens every lesson in the catalog for $9 a month or $79 a year.