100x·FDE Roadmap
On this page

Practice set · Block 1 · Week 2 · Building APIs and the backend

Building APIs

One chat app. One raw POST request. Proof against your golden pair.

Building APIs and the backendSelf-pacedBlock 1 · Ship the first system

The exercise in one sentence

Connect your Gradio app with a raw requests.post to an LLM, carrying your own prompt and your user's real input, and prove the reply is useful by checking it against your golden pair.

0/5
The five stepsSection 02
0/4
Prediction logThree requests, two failures
0/6
DeliverablesSection 07

Which track are you on?

01Why This Exercise Exists

A passenger enjoys the comfort of a car. A driver understands its controls and knows what to do when things go wrong.

Comfort without understanding comes at the cost of control.

In software, SDKs, libraries, no-code/vibe-coding tools are like comfortable passenger seats. They make the journey easier by hiding the machinery underneath.

But hidden machinery doesn't disappear.

When something breaks, what you understand determines what you can fix.

To drive software machines, understand its controls: APIs, endpoints, authentication, requests, and responses.

Use abstractions for comfort. Build understanding for control.

A 200 proves the call worked. Only your verifier proves the reply helps.

02The Five Steps

Track B · Aarav as the user

Input: his weekly workflow. Output: a plan to automate part of it. Starting prompt:

"Here is the workflow of an analyst working at an IT company in India. Diagnose and generate a plan to automate this work, or a part of the work."

Target: the plan drifts into jargon Aarav cannot use.
Steps done
0 / 5

Step 1 · Where you start

Step 4 · The shape of the change

Each blank is one of the four parts, with the values from the raw request. Write it yourself.

Your machine
export GROQ_API_KEY=gsk_your_key_here
$env:GROQ_API_KEY="gsk_your_key_here"

03The Raw Request, Live

Step 2's request, sent from this page to Groq. Pick your predicted status code to unlock Send; every send goes to the prediction log. Your screenshot still comes from httpie.io/app.

POST · Groq chat completionsFree tier: 30 requests a minute
Address
https://api.groq.com/openai/v1/chat/completions
Action
POST · a Create: each call creates a new reply
Key

Sent as Authorization: Bearer <key>. Held in this tab's memory only: never saved, gone when you reload. Get a key.

Package

Break one part on purpose for this send:

What status code do you expect?

Pick a prediction first.
—
The full reply package
What each code means here
200Groq understood you and sent a reply. It does not mean the reply helps anyone: that is section 05.
400The package is wrong: broken JSON or a missing field.
401The key is missing, mistyped, or sent without Bearer.
404The model named in the package does not exist, or the address is wrong. Read the message: it says which.
429Too many requests this minute on your account. Wait and send again.
5xxTheir machine, not yours. Try again later.

Status code says whose fault; the message says what. Try the fix the error points to before pasting anything into an LLM. More in Troubleshooting.

Got an error? Search it in Troubleshooting: the part it points to and the fix.

04Prediction Log

Three requests minimum, two of them deliberate failures. Sends from section 03 land here; add the rest by hand.

Three requestsA wrong model nameA missing or wrong keyA prediction on every row
RequestPredictedActualError message, for failures

05Verify Against Your Golden Pair

Golden output beside the reply, a one-line verdict, one prompt change, run again.Load Aarav's golden pair below. The target is jargon.

Saves on this device as you type.

06Rules of the Build

Predict before you run.

Every request in the prediction log gets its expected status code written down first. Include at least two deliberate failures: a wrong model name and a missing or wrong key. Record what each actually returned.

Read the error before you ask.

Status code says whose fault; the message says what. Try the fix the error points to before pasting anything into an LLM.

Minimum path.

No extra parameters, no chat history handling, no changed interface, no renamed functions. The diff from the echo app should be the process and nothing else.

Keys never in code or screenshots.

Set it in the terminal, never in the file. Blur the key in every image you share. If a key leaks, revoke it and create a new one: Keys.

Stay inside the free tier.

Groq allows 30 requests per minute. You will not need more.

LLM help: hints and debugging yes; generating the solution no.

Think for the first minute on your own. Pasting this brief in and copying the code out defeats the exercise; the code is short enough that writing it is the learning.

07Your Deliverables

Deliverables ready
0 / 6

The 201 question

08Stretch: Any Machine, Four Lines

  • Pick one free API from the public-apis list (MediaStack is a fine start). Answer the four questions for it in writing before writing any code.
  • Call it with requests and print one field from the JSON response.
  • Optional swap test: point your chat app at another OpenAI-compatible endpoint by changing only the URL, key and model name. Note what else, if anything, had to change.
API Address Action Key Package Swap test

09How to Get Unblocked

Search the exact error in Troubleshooting first. Then compare your file, line by line, with the shape in section 02 and the package on the wire in section 03. Keep your deliverables together: they are your proof that the system works and helps.

Next: building your own API, and how much protection it actually needs.

Hold this

A 200 means the machine understood you. It does not mean you helped anyone. Four lines get you to any machine on the internet; your golden pair tells you whether the trip was worth it for a human.

Four lines to any machine.Companion pages: Overview · The second interface · Groq step · troubleshooting · back to the roadmap