We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

Build an AI Agent in Python

Build a tiny coding agent that can read files, edit code, run Python, and loop on feedback.

What you'll learn in this Python course

Write a toy agentic code editor in Python, similar to Claude Code or Cursor's Agent Mode. Understand how agents work from scratch by using free models on OpenRouter (via the OpenAI SDK) to create an LLM-powered code agent. You'll use function calling and feedback loops to build an agent that can find and fix bugs in a real project!

Chapter List

1
LLMs
Learn how LLMs work and send prompts to LLMs on OpenRouter using the OpenAI Python SDK
2
Functions
Write the functions your AI agent will need to modify files and run Python code
3
Function Calling
Give your AI agent the ability to call functions based on its system prompt and context window
4
Agents
Give your tool a proper feedback loop to make it truly "agentic" and fix a real bug

Join 20,010 students in the Build an AI Agent in Python course

Read reviews of their learning experiences

Im still dizzy about all of this

(5/5)
Jacky  profile image

Jacky

Indonesia

The last two chapters were worthwhile. I believe that using a more contrived example and avoiding the OS filesystem setup for a significant portion of the lessons would have allowed us more time to focus on the AI agent integrations.

(3/5)
Larry Custodio profile image

Larry Custodio

United States

I'm interested in the coding used for AI but the way the lessons were set up weren't that digestable for me. The limited call requests due to the free LLM usage also caused a much slower pace. I was not a fan of this lesson at all and didn't feel like I learned very much.

(2/5)
Chikara Sekiguchi profile image

Chikara Sekiguchi

Japan

10

(5/5)
Irfan Mahmud Ekon profile image

Irfan Mahmud Ekon

Bangladesh

Unpredictable reviews, frustrating limitations -> Not enjoyable

(1/5)
Boalq  profile image

Boalq

Germany

Pretty cool course I enjoyed the concepts. It was more difficult then the previous courses

(2/5)
Sebastian Klemkosky profile image

Sebastian Klemkosky

United States

Honestly, the end product is limited but it's AMAZING to watch it work.

(5/5)
Jon Siegrist profile image

Jon Siegrist

United States

Enjoy it

(4/5)
Mustafa Semary profile image

Mustafa Semary

Egypt

It was really nice journey I had fun coding and learned few things along the way! It gives nice insights into how ai agents work under the hood.

(5/5)
Damian  profile image

Damian

Poland

Showing 1-9 of 812

or view more reviews

Mediocrity doesn't cut it anymore

The only way to become a great developer is to write a lot of code

Avoid tutorial hell

by writing a ton of code

Stay motivated with

a game-like curriculum

Build portfolio projects

to prove your skills

Delve deeper

into foundational concepts

Learn flexibly online

without interrupting your life

For 1% the price of college

to minimize your financial risk

Frequently asked Questions

Got questions? We've got answers

No. You'll use free models on OpenRouter through the official OpenAI Python SDK. The free tier is limited to about 50 requests a day, which is enough to finish the course. A one-time $10 credit would bump that to roughly 1,000 a day if you want to go faster.