GENAI 102
M02 · L05
Overview

The Doorway Between Programs

An API is the doorway one program uses to ask another for something. It is how the frontend talks to the backend — and how your code talks to a model. Learn this once, and most of software fits together.

01 / 08
GENAI 102
M02 · L05
REST & Endpoints

You Ask, It Responds

Most web APIs follow a style called REST. You send a request to an endpoint; you get a response back.

  • An endpoint is a URL plus a verb — a specific thing you can do
  • GET reads data · POST creates it
  • PUT replaces · PATCH edits · DELETE removes
  • Each response carries a status code — 200 means OK, 404 means not found
02 / 08
GENAI 102
M02 · L05
The Common Language

Everyone Speaks JSON

JSON is the data format both sides agree on. It is a simple key/value shape — a label, then its value — that any language can read and write.

A tiny example
{ "task": "ship deck", "done": false }
03 / 08
GENAI 102
M02 · L05
Who You Are, How Often

Keys & Limits

Both matter the moment you call a paid model API.

API keys / tokens
A secret that proves who you are — keep it out of your code
Rate limits
A cap on how often you may call — go over it and you are told to wait
04 / 08
GENAI 102
M02 · L05
Backends With No Face

What a Service Is

A service is a backend with no screen of its own — no buttons, no pages. Other programs call it over its API and do something with the answer.

The one you will use most
An LLM provider is exactly this: you POST text, you get text back. No UI — just a doorway your code speaks through.
05 / 08
GENAI 102
Build It
Design One Endpoint

Build It

How to implement: write out one endpoint your tool needs, in the shape “VERB /path → returns what.” For example: POST /tasks → the created task. That one line is a contract between two programs.

  • Weekly AI Tasks tracker — the messaging app delivers messages to your backend via a webhook (an endpoint it calls); the LLM is reached over its API. Watch auth and rate limits.
  • Personal brand site — if static, it may call no APIs at all; if it generates anything at build time, that is one API call you make once.
06 / 08
GENAI 102
Knowledge Check

Check what stuck

Three questions from this lesson. Answer to see why — the explanation appears whether you were right or wrong. Nothing is scored or saved.

Question 1 of 0
Score 0/0

07 / 08
GENAI 102
Summary
Recap

What you learned

An API is a doorway; REST endpoints are URL-plus-verb; JSON is the shared data format; keys prove who you are and rate limits cap how often you call; a service is a backend other programs reach — an LLM provider being the one you will use most.

Next Lesson
08 / 08