On Day 4, our code officially connected to the outside world. Up until today, everything was running offline on our local laptops. Today, we learned how computers talk to other computers across the internet using APIs.

1. What is an API Anyway?

Rashmi gave a great restaurant analogy: You are the customer at the table (the client). The kitchen is where the food gets prepared (the server/database). But you can't just walk into the kitchen yourself—you give your order to the waiter (the API), who brings back your meal (the response). That is all an API is: a standardized messenger between apps.

2. Speaking JSON

We looked at JSON (JavaScript Object Notation), which is the universal language for web APIs. If you know Python dictionaries with keys and values, you already know JSON. It's lightweight, clean, and every programming language can read and write it effortlessly.

3. Building the Gemini AI Chatbot Route

For our main project, we used Flask (a lightweight Python web framework) and integrated Google's Gemini API. While several students were getting confused by API keys and JSON parsing, I got our local Flask server route running smoothly. You type a prompt into the endpoint, Flask packages it into JSON, sends it to Gemini-1.5-flash, and streams the answer back. Rashmi tested my bot live and was super happy with the clean setup.

Key Learnings

  • Understanding client-server communication and the request-response lifecycle.
  • Reading, formatting, and parsing JSON data between Python and web services.
  • Writing clean Flask backend routes that accept POST requests.
  • Authenticating and fetching real-time AI responses using Google's Gemini API.

Tools & Stack

  • Flask
  • Gemini API
  • JSON
  • Python 3.11
  • Postman / Curl

Challenges Overcome

  • Safely managing API keys so they don't get accidentally hardcoded into Git repositories.
  • Handling network timeouts when the external AI server takes a moment to respond.

Task to be Performed

  • Study HTTP requests (GET vs POST) and status codes (200, 404, 500).
  • Parse nested JSON objects into Python dictionaries.
  • Build a working Flask backend route connected to the Google Gemini API.

Related Logs

Day 00

Day 00: Onboarding, Orientation, and the 2-Week AI Roadmap

Walking into Virtual Height for day zero: getting our badges, meeting our lead mentors, and mapping out what we will build over the next two weeks.

May 29, 2026 • 4 min readRead Log ➔
Day 01

Day 01: First Day as an AI Intern, Python Basics, and a Wild Flex

Day 1 kicks off with lead mentor Rashmi. We break down AI vs ML vs Deep Learning, test Python terminal scripts, and demo my custom chatbot to the room.

Jun 01, 2026 • 4 min readRead Log ➔