What is API Gateway?

API Gateway gives your code a public web address and handles the security and traffic that comes with it.

1 min read

A Lambda function on its own has no URL. A browser or mobile app can't call it directly. Amazon API Gateway is the front door: it receives HTTPS requests from the internet, checks them, and forwards them to your backend (usually Lambda), then sends the response back.

Think of it like this

API Gateway is a restaurant host. Guests (requests) arrive at the front. The host checks reservations (authentication), stops the room from overflowing (throttling), and walks each guest to the right table (route → backend). The kitchen (your Lambda) never deals with the crowd at the door.

What it handles for you

  • HTTPS endpoints with TLS certificates managed for you
  • Routing: GET /notes goes to one function, POST /notes to another
  • Authentication: JWTs, Amazon Cognito, IAM, or your own Lambda authorizer
  • Throttling so a traffic spike or a misbehaving client can't overwhelm your backend
  • CORS so browser apps on another domain can call you
  • Stages like dev and prod, plus monitoring in CloudWatch

In our project

Across this site we build one small project, piece by piece: NoteSnap, an app where you upload a text note and get back an AI-written summary. Each service adds one part. API Gateway lets the NoteSnap web app fetch summaries with GET /notes/{id}.

How it flows
  1. 1Client

    Browser or mobile app

  2. 2API Gateway

    Auth, throttle, route

  3. 3Lambda

    Your code runs

  4. 4Response

    JSON sent back

Key takeaways

  • API Gateway is the HTTPS front door for your backend.
  • It handles routing, auth, throttling, and CORS, so your code doesn't have to.
  • The most common backend behind it is Lambda.

Check your understanding

Pick an answer to see the explanation.

  1. 1. Which of these does API Gateway NOT do for you?