100x·FDE Roadmap
On this page

Block 1 · Week 2 · The second interface: APIs · Practice lab

Request Builder

Ten short steps, all in this browser tab. Each one ends with a checkpoint. Do them in order, then do the practice set.

About 90 minutes in totalNothing to installKeys stay in this tab

Where you are

In the Round Three exercise in the notes, the machine taught you that every request carries four things, address action key package, and every reply carries two, code and package. Now you send real requests with those parts, to real machines, and finally to a model.

0/10
CheckpointsSaved on this device

01The parts: your Round Three message, translated

This is the winning message from Round Three. Below it is the same request written the way HTTP writes it. Tap a coloured part to find its twin.

CREATE this-site/aarav/diagnoses key: key-●●●● {"workflow": "I open Jira, read the week's tickets, write a status report and post it on Slack. About 90 minutes."}
POST /aarav/diagnoses HTTP/1.1 Host: this-site Authorization: Bearer aarav_●●●●●●●●_●●●●●● Content-Type: application/json {"workflow": "I open Jira, read the week's tickets, write a status report and post it on Slack. About 90 minutes."}
In the gameOn the wireIts name
CREATEPOSTMethod. The CRUD action is what you want; the method is how HTTP spells it.
…/aarav/diagnoseshttps:// + host + /aarav/diagnosesURL, or endpoint. The host names the machine, the path names the door.
key:Authorization: Bearer …A header. Written on the envelope, read without opening the letter.
{"workflow": …}Content-Type + bodyThe body, in JSON. The header says which format it is in.
201HTTP/1.1 201 CreatedStatus code, plus a reply package.

02Read: your first request

A Read fetches something that already exists. httpbin.org is a public echo machine: it sends back whatever it receives, so you can see exactly what you sent.

  1. Look at the four bands. Address is filled in for you. Action is Read · GET. Key: none needed. Package: none, because a Read sends no package.
  2. Press Send. You should see a large 200, and under The part you want, your text.
  3. Type a sentence with a space in the text box, like hello world, and watch the address. The space turns into %20 before anything is sent. An address cannot hold a space, so it is translated. Your code and your tools will not always do this for you; a raw space in an address is a classic 400.
  4. Click Show the raw request. This is the request as text: the action, the address, and nothing else.
The same request in Python

Use the folder and terminal you set up in Block 1 · Week 1 · The first interface: building UI. Install the library once with pip install requests (Mac: pip3), save this as step2.py, and run python step2.py.

params builds the address for you, %20 included.

03Create: send a package

Same echo machine, a different door, a different action. This time you send something: Aarav's Friday workflow, as JSON.

  1. Check the package band. It holds {"text": "…"} and says ✓ valid JSON. Try deleting a quote: it turns red. Put it back.
  2. Press Send. Look for 200, then find your text at json.text in the reply.
  3. Click Show the raw request. A package needs one more header, Content-Type: application/json, so the machine knows which format to read. Machines do not guess.
The same request in Python

json= turns the dictionary into JSON and adds the Content-Type header for you.

04Round Three, for real

The machine from Round Three is real. It lives at __SITE__/aarav and checks the parts in the order you learned them: address, action, key, package. It needs a key, and it issues its own.

Part A · Create a key

  1. Replace your name in the package with your name.
  2. Press Send. Expect 201: something new was created, your key. It is copied into Part B's key box for you.

Part B · Create a diagnosis

  1. Check the key band holds your aarav_… key. Press Show to check it pasted fully.
  2. Press Send. Expect 201 and a diagnosis of Aarav's Friday report.
  3. Press Send the same request again. The two replies sit side by side. They are identical: this machine follows rules. Remember that for step 8.
  4. For the practice set: take a screenshot of the reply. The reply shows only the start of your key.
Both requests in Python

05Break it on purpose

Every failed request comes back with a code, and the code points at one part. Learn the codes by causing them, one part at a time.

  1. Pick a button below. It changes one part of the Part B request above.
  2. Before you press Send, write down the code you expect.
  3. Press Send in Part B. The red box names the part and what to change.
  4. Press Put it right, then try the next button. Fill in the practice set table as you go: what you changed, the code you got, the part it points to.
CodeMeansWhose fault
400Package unreadable, or a part is missingYours
401Key missing or wrongYours
404Nothing at that addressYours
405That door does not take that actionYours

Then: Read what you created

In Part B, switch the action to Read · GET and press Send. You created diagnoses a few minutes ago. The reply is 200 and an empty list. Where did they go? This machine has no database, so nothing it creates is kept. Where data should live is Block 1 · Week 3 · Databases and domain modelling.

Break it in Python

Change one thing at a time in your step 4 script (the address, the method, the key, the field name) and print what comes back:

06Whose fault? Every code

Each card sends one real request. Before you press Send, pick whose fault the reply will be. 2xx worked. 4xx you sent something wrong. 5xx their machine broke.

07Read real traffic

Every request you sent here is visible in your browser's own tools. Real products work the same way. Reading this is how you check what an app actually sends.

  1. Open DevTools. Mac: Cmd Option I. Windows: F12 or Ctrl Shift I. Or right click anywhere, Inspect.
  2. Click the Network tab, then the Fetch/XHR filter. Click the clear button (a circle with a line).
  3. Scroll up to step 4, Part B, and press Send. A row named diagnoses appears.
  4. Click it and find each part:
    AddressHeaders → Request URL
    ActionHeaders → Request Method
    KeyRequest Headers → authorization
    PackagePayload (what you sent) and Response (what came back)
    CodeHeaders → Status Code
  5. Optional, a real product: do the same on ChatGPT. Reading the Network tab walks through it, including the one header you must never expand or paste.

08Put a model behind it

Aarav's UI has a face. It needs a brain: a model that reads his workflow and writes a plan. Groq runs open-weight models on its own chips, and you reach them with the same four parts. That is Groq with a q, not Grok.

Part A · Get a free Groq key (one time, about 3 minutes)

  1. Open console.groq.com/keys in a new tab. It is a website, not a download.
  2. Sign in with Google. No card needed.
  3. Click Create API Key, name it fde-apis, and click Submit.
  4. Copy the key now. Groq shows it once. Do not paste it anywhere except the box below.

Part B · Send your first request to a model

  1. Paste the key into the key band. Wait a second: the model list loads from Groq itself. That load was a Read with your key, your first keyed request. If it says 401, the key was not copied fully.
  2. Keep the model openai/gpt-oss-120b and the message as it is.
  3. Press Send. Expect 200. The answer is at choices[0].message.content. The reply also carries a reasoning field, the model's scratchpad. Ignore it.
  4. Press Send the same request again. Same address, action, key and package. Different words. Compare that with Aarav's service in step 4.

Your key stays in this tab's memory. It is not saved and is gone when you reload. Free tier: 30 requests a minute, counted per Groq account, so use your own account, not a friend's key.

The door is deterministic. What comes through it is probabilistic.

Two answers to the same request. Which one is right, and who decides? Write one line on which you would trust, and why. That line is the start of a verifier.

The same request in Python

Put the key in an environment variable, never in the file. In the same terminal:

Your OS
export GROQ_API_KEY="paste-your-key-here"
$env:GROQ_API_KEY="paste-your-key-here"

Then save and run:

This file becomes the body of your FastAPI route in the next lesson, Building APIs and the backend.

09Find your key, and where it should live

  1. With DevTools open on Network, press Send in step 8.
  2. Click the completions row, then Request Headers. Your Groq key is there in plain text.
  3. Think it through. This page is your private tool, so that is fine here. If Aarav's product worked like this, every visitor could open DevTools, read his key, and spend his money. So where should the key live?

Box 1

UIwhat the user sees · no keys

Box 2

Backendholds the key · keeps the data

Box 3

Groqthe model

The UI calls your backend. Only the backend calls Groq, with the key kept on the server. The backend is also where data can be kept, which step 5 showed the page and Aarav's machine cannot do. Building that backend is the next lesson, Building APIs and the backend. More in Keys.

When you are done practising, you can delete the key at console.groq.com/keys and create a new one for the next lesson.

10Design your API

You have sent every kind of request. Now design the ones your own app needs. Here is Aarav's, as the example:

CRUDMethodAddressPackage inReply
CreatePOST/workflows{"description": "..."}201 + workflow id
ReadGET/workflows/{id}none200 + the workflow
CreatePOST/workflows/{id}/diagnosesnone; the backend sends the workflow to Groq201 + diagnosis
ReadGET/workflows/{id}/diagnosesnone200 + past diagnoses

Your version, with a blank template and what to produce, is in the practice set.

Next: the practice set.Stuck? Troubleshooting · Curious why each part exists? The Wire, optional