You are at a cafe with a club friend, and the tidy page is open on the laptop that has run the site since the train ride. You paste a messy group-chat message and press the button. The spinner that usually clears in a few seconds is past twenty, and the friend asks whether it is broken. You cannot answer. The cafe Wi-Fi may have dropped, your site may have failed, or the AI company may be slow; nothing on the screen says which. Twenty-three seconds after the press, the clean post appears. The way to tell was in your browser the whole time: once you open a panel there, it lists every press as a row, and reading the row for a press tells you which of the three it was.
What happens between the press and the answer
A request is what your device sends when you press a button: your text, and which page it came from. When you pressed tidy, your browser put the pasted message into a request and sent it to your server, the site running on your laptop. A response is what the server sends back, and the browser puts it on the screen as soon as it arrives. Here is one press at the cafe:
You sent: sat run?? 7am from the boathouse, 8k,
coffee after, bring lights its dark
Came back: Weekend run: 7:00 am from the boathouse,
8 km, lights needed, coffee after.
A round trip means your device sends a request, a server does some work, and a response comes back. Every press on a connected app is one. Pressing like on a post is the simplest: the request asks the server to add one to a count.
Every tap on a connected app is a round trip: your device sends a request, a server does some work, and a response comes back.
In the drawing, the answer comes back in pieces. Why an AI chat shows the words one at a time is a screen behavior, and Frontend, what users see explains it.
Open the Network tab and read the row for your own press
DevTools is a panel built into every browser for inspecting the page you are on; it stays hidden until you right-click the page and choose Inspect. The Network tab is the part of DevTools that lists every request the page sent, one row each. It records only while open, so at the cafe you open it, press tidy again, and watch. For 23 seconds the new row shows a pending mark and a clock counting, and then it fills in: 200 in one column, 23.4 s in the next.
The row's name says where the request went. An endpoint is one specific address on the server that requests are sent to, like one door into a building; builders also call it a route. An API is the way a company lets programs, rather than people, send it requests. The tidy page's code sends its requests to /api/tidy, and the RSVP page sends its requests to another endpoint.
The next column holds the status code, which the drawing labels the verdict. A status code is a number the server sends back to say how the request went. A 200 means it worked, a code starting with 4 means the server refused the request, and a code starting with 5 means the server itself failed. The pending mark you stared at for 23 seconds means the server has not sent back a status code yet, which the drawing labels no verdict yet, and a row the browser could not send at all shows failed, in red.
A status code is a number the server sends back to say how a request went: 200 means it worked, a code starting with 4 means the server refused it, and a code starting with 5 means the server failed.
The wait is the time from sending the request until the whole response has arrived. Builders call it latency, and the Time column shows it: 23.4 s at the cafe.
Why a trip that worked still took 23 seconds
Distance versus work means the wait has two parts: the travel time to the server and back, plus the time the server spends working before it answers. The distance part stays small: a request can cross an ocean and its response can come back in around a tenth of a second. The tidy button asks for a whole message, and the model spends seconds producing the words, so nearly all of that wait is work.
In the drawing, a press of a like button is the short bar, and the cafe row is the long one. The trip across the cafe Wi-Fi took a fraction of a second, and the rest of the 23 seconds was the model producing the message at the far end. The provider is the AI company whose model you rent, and the far end is the provider's computers, not your server.
The obvious objection: the user sees the same spinner either way
Why does it matter which side failed? Each possible cause needs a different fix from you and a different message to the user.
- If the row shows failed or never appears, the user's connection is the problem: tell the user so, and change nothing on your side.
- If the status code starts with 4 or 5, your server refused or failed: the fix is yours, and the user should hear that you are on it.
- If the row stays pending for a long time and then shows a 200, the provider was slow. Wait it out, or set a limit on the wait and tell the user to try again.
The second trip, and the API key that travels only on it
Your server did not write that message. It sent a request of its own to the provider's API, the same way your browser sent one to /api/tidy. Builders count this as two trips: the first trip runs from your user's browser to your server, and the second from your server to the AI company.
The second request carries one thing the first never does. An API key is a long secret string of letters and numbers, sent with the request, that tells the provider whose account to bill. It is the pass from the plan's secrets line, and it works like a membership card. The key is stored on your server, and only your server sends it to the provider. Anything sent to a browser can be read by the person using that browser, so if the key traveled on the first trip, someone could copy it and run up charges on your account.
In the drawing, the key is the only label that differs between the two trips.
Every AI answer you ship is two round trips: your user's browser to your server, then your server to the AI company. Your API key travels only on the second one, because anything sent to a browser can be read by the person using that browser.
Try it now
This drill takes about ten minutes. The no-setup path costs nothing, and the tooled path costs a few cents of usage: a fraction of a cent per short request, charged to the account the API key names. You arrive with the idea file and the verdict list from Where software lives; pick an app you marked remote, ideally an AI chat.
No setup: Open that AI chat in a desktop browser, right-click the page, choose Inspect, and click Network in the panel that opens. Expect a long list of rows, one for each image and font the page loaded. Press the clear control so the list empties. Then type one message into the chat: "Give me a two-line summary of the water cycle." Read the new row at the top: its name, then the status staying pending while the words arrive, then the 200 and the time. Last, find the slowest row and decide whether its wait was mostly distance or mostly work.
With your tools: With the Network tab open on the running-club site, paste a messy message into tidy and read the /api/tidy row. Then ask Claude Code, the AI coding tool we use in this course: "Which file sends the request to the AI provider, and where does the API key come from? Do not print the key." It names app/api/tidy/route.js, the file behind the /api/tidy endpoint, and the secrets file from the plan. The page your browser receives, app/tidy/page.js, never holds the key. In Codex or Cursor, ask the same question in the app's chat box and keep the do-not-print line. The Setup Clinic walks you through installing one.
Either way, you leave with the idea file one line longer and one row read. The line to add: "My AI feature is two trips; the key stays on my server; the slowest request I read was [what], [how long], mostly [distance or work]."
Chapter Summary
- Every press on a connected app is a round trip: your device sends a request, a server does some work, and a response comes back.
- The Network tab in your browser's DevTools lists every request the page sent, one row each, and it records only while it is open.
- A row tells you three things: where the request went (the endpoint, one door on the server), how it went (the status code, which the drawing labels the verdict), and how long it took (the wait).
- 200 means it worked, a code starting with 4 means the server refused the request, a code starting with 5 means the server failed, and a pending mark means the server has not sent back a status code yet.
- Every wait is distance plus work: the travel time to the server and back is small, and for an AI answer nearly all of the wait is the model producing the words at the far end.
- A slow or failed request has three possible causes, each with its own fix. A row marked failed means the user's connection dropped, a code starting with 4 or 5 means your server is at fault, and a long pending mark followed by a 200 means the AI provider was slow.
- Every AI answer you ship is two trips, browser to your server and your server to the AI company, and the API key travels only on the second one, because anything sent to a browser can be read by the person using that browser.
- A 200 means the trip worked, not that the answer is right; checking the answer is still your job.
- Your artifacts from this chapter are the idea file, now carrying the two-trips line, and one row read from your own browser.
- Next, in Languages and frameworks: approve the pick, you find out what both ends of that trip are written in and how to approve the agent's pick.
Sources
- Chrome DevTools documentation, Network panel reference: recording while the panel is open, the Status and Time columns, and the Clear control (last verified September 2026).
- Firefox Source Docs, Network Monitor section (last verified July 2026).
- MDN Web Docs, HTTP overview and status code reference (last verified September 2026).