Tools & Usage Beginner

API

The fixed format two programs use to trade requests and answers

Key points
  • An API is the fixed-format interface a program uses to ask another program to do something. It's short for Application Programming Interface.
  • You don't need to know what's happening inside. Match the format, and the request goes in and an answer comes back.
  • What to send and what comes back are written down in advance, in documentation. That agreement is the shared language between two programs.
  • The path a person clicks through on screen and the path a program calls are two different doors.
  • There's a limit to how much an interface takes in, and when the format changes, everything calling it has to change too.
Contents

1The analogy

A wall outlet has just two holes. And yet a fan, a rice cooker, and a phone charger all plug in fine — even though each was made by a different company.

It works because the shape of the plug, the spacing, and the voltage are all fixed in advance. Anything built to that standard can draw power. A plug from a country with a different standard, on the other hand, won't go in no matter how hard you push.

Whoever's plugging in doesn't need to know how the power plant runs or which wall the wiring comes through. They don't need to. Plug the right shape into the right spot and that's the whole job.

An API is that outlet, for the world of programs.

2In detail

You can use it without knowing what's inside

Every service has something complicated going on inside — how data gets stored, in what order things get calculated. An API hides that complicated inside and leaves only an interface open for the outside to use.

Hiding it this way suits both sides. The side using it doesn't have to learn the internals, and the side building it can rework the internals freely as long as it keeps the interface's format the same — the same way keeping an outlet's standard fixed means a household appliance doesn't have to change even if how power gets generated changes.

It's different from the screen a person clicks through, too. A screen is built for a person to look at; an API is built for a program to call. That's why an API has no buttons and no pictures — only a format.

What goes in and what comes back are fixed

An interface has an address. Where to send the request is fixed, and different addresses do different things — one address for "write me some text," a separate one for "turn this audio into text."

What you send is fixed too. What has to be included and what can be left out is written down in documentation. What comes back is the same — where the result sits and where any extra information sits is knowable ahead of time.

That agreement is what lets you connect to a service you've never used before just by reading the documentation. The agreed format is the shared language between the two programs.

Using AI through an API

Using AI on screen and using it through an API are different in feel. On screen, a person asks one question at a time; through an API, a program can ask thousands automatically. That's how a pile of inquiries gets sorted all at once, or a fresh batch of material gets summarized every morning.

Because the format for exchanging things is fixed, switching to a different service is relatively easy too — often it's just a matter of changing the address and a few names. That same property is what lets you run several AIs side by side and compare them, or call a different one depending on the situation.

The safety net, though, is on whoever's calling it. A program can make, very quickly and at very large scale, mistakes that would be hard to make by hand on screen.

There's a limit, and the format changes

Plug too much into one outlet and the breaker trips. An API has the same kind of limit — how many calls fit in a given stretch of time is fixed, and going over it means getting turned away for a while. If one caller hogs it, everyone else loses access.

The format changes sometimes, too. When the interface side revises its format, a program still sending the old format can suddenly stop working one day. That's why an API usually carries a version number, and the old version stays open alongside the new one for a while. It's best to build with the assumption that it will change eventually.

3More precisely

An API isn't a single object — it's a bundle of agreements: where to send something, what to ask for, what shape to put it in, and what comes back. Crossing the internet is the common case, but a program calling another program on the very same computer counts as an API too. Even two pieces of the same application, built by the same team, often talk to each other this way once the project grows large enough.

The outlet comparison breaks down in one place. An outlet is open to anyone, but an API usually checks who's calling. Usage needs to be counted, and letting just anyone call it causes real problems in a lot of cases. That's what an API key is for — it's the piece that answers "who is asking."

Unlike electricity, which flows one direction, an API is two-way — a request goes out and an answer comes back. Answers arrive late sometimes, or fail and need retrying. That's why whoever's using an API usually decides ahead of time what to do if an answer doesn't come back.

4Try it yourself

5Common misconceptions

  • It's easy to think you need an API to use AI at all, but actually there's a separate path for using it on screen, and the API is the path a program uses to call it automatically.

  • It's easy to think opening up an API exposes everything inside, but actually it's closer to a device for opening one fixed interface while keeping everything else hidden.

  • It's easy to think that once you connect to something, it just keeps working the same way forever, but actually when the interface's format changes, whatever is calling it has to change too.

7One-line summary

In shortAn API is the interface a program can use to ask another program for something without knowing what's inside, as long as it matches the fixed format.

Spotted an error or have a better analogy? Suggest an edit · Last updated2026-09-02