← Back to blog

Understanding how software talks, through ordering at a restaurant

· TRAIL Labs
APIMade SimpleTrail Studio

What's an API?

You've probably heard the phrase "API integration." But the moment someone asks "so what is an API?", the explanation gets slippery. It doesn't have to be. An API is just an agreed-upon way for pieces of software to talk to each other. If you've ever ordered food at a restaurant, you already understand the idea.

Picture a restaurant

When you walk into a restaurant, you don't march into the kitchen and start cooking. Instead, here's what happens.

The restaurant metaphor for an API — a guest orders from the menu through the server, who relays it to the kitchen and brings the food back

  • The kitchen is where the food is actually made. You don't need to know how it works inside. This is the inside of a service.
  • The menu is the list of "here's what you can order." You don't just shout anything — you order in the format the menu allows. This is the defined request format.
  • The server takes your order to the kitchen and brings the finished dish back to you. That server is the API.

You (the app you're using) don't need to know the kitchen (the service's internals). As long as you order from the server (the API) using the menu (the defined format), you get what you asked for. An API is exactly that — the server who hides the internals and lets you exchange things only through an agreed-upon counter.

We're already using APIs every day

It sounds like heavy-duty tech, but you're using it dozens of times a day.

  • Open a weather app, and it orders "tell me today's weather in Seoul" from a weather service's API, then brings back the result.
  • Tap directions in a map app, and it asks the map service's API for the route.
  • Enter your card details at checkout, and the app requests "charge this amount, please" from the payment provider's API.

It's not just weather, maps, and payments. Sending a message, playing music, checking your delivery status — behind nearly every button you tap, there's a server standing by.

The APIs we use in a day — weather, map directions, payments, messaging, music, and delivery apps all talk to services through a server (an API)

Behind every single button on your screen, servers (APIs) are busily passing orders back and forth. Behind every click, an API is doing the work.

When you make cardnews in Trail Studio

The same thing happens inside our own service. When you hit "Create cardnews" in Trail Studio, this conversation runs out of sight.

The four steps when you make cardnews in Trail Studio — request, start generating, check progress, receive the finished result

  1. Request — "Make six cardnews slides on this topic."
  2. Start generating — Trail Studio accepts the order and immediately hands back a ticket (a job number). Cardnews takes a little time to make, so instead of waiting at the counter for the dish, you get a number first.
  3. Check progress — Every so often you ask, "how far along is that job?" And it tells you, "still cooking" or "all done."
  4. Receive the result — When it's finished, you collect it.

The heart of this flow is the ticket in step 2. Here's the picture.

The asynchronous way of getting a ticket first and the result later — you place an order and get a job number (ticket) first, then a moment later use that number to fetch the finished result

It's just like getting a buzzer at a busy restaurant — you wait at your table, and when it buzzes, you go grab your food.

This way of getting a ticket and fetching the result later, instead of having everything finish on the spot, is called asynchronous (running on the side). It's a common way to handle heavy work smoothly.

Coming up next

So far, this has been about a person pressing the button, checking progress, and collecting the result. But what if an AI did the ordering for you, instead of a person?

You'd just say "make cardnews on this topic," and an AI assistant would place the order, check the progress, and bring back a link to the finished result — all on its own. The agreement that makes this possible is MCP. We'll pick that up in the next post.

> You can try Trail Studio right now. Content generation runs on credits.

More posts