What is an API, really?

Witjo

AI Basics · about 9 minutes · no jargon

What is an API, really?

You have seen the word API in every AI product announcement and every developer job listing. It sounds technical. It is not. An API is a menu, not a machine. It is a way for one program to ask another program to do something, without knowing how the other program works. In nine minutes you will see what an API is, why AI products talk about it, and why you can use one without understanding the code behind it.

Poster-scale Swiss editorial infographic illustrating how an API works using a restaurant metaphor: The Menu represents available endpoints, The Waiter acts as the API interface, and The Kitchen performs the backend computation.

Think of a restaurant. You sit at a table. You do not walk into the kitchen and cook the food yourself. You do not know where the pans are, how the oven works, or who is on shift. You look at the menu, you tell the waiter what you want, and the waiter brings back the dish. The waiter is the API. The kitchen is the program. The menu is the list of things you can ask for.

An API is a waiter between two programs. One program says “I want this”. The API carries the request to the other program, which does the work and sends back the result. The first program does not need to know how the second program works. It only needs to know the menu. That is why APIs are everywhere: they let programs work together without being built by the same team or even the same company.

In the box below, step through how one program sends a request through an API and gets a result back. Click the numbers, or press Next step.

The calling program checks what actions the API offers and what format the request expects.
One program sends a clear request, such as asking for a translation, without needing internal kitchen details.
The program behind the API performs the work—such as running a model or looking up data—and prepares a response.
The API hands back the result in an expected shape so the first program can display or use it.

This is a simplified picture. A real API would receive the request, run the work, and send back the result, without the caller knowing how the work was done.

What just happened

You followed four steps from checking the menu and sending a clear request to backend processing and receiving a structured result back.

Why it works this way

An API is a contract between two programs. One program says “I will send you a request in this format”. The other says “I will send back a result in this format”. The contract is the menu. The programs do not need to know how each other works. They only need to agree on the menu. That is why an API lets two programs work together without being built by the same team.

Worked example. A weather app wants to show the temperature. It does not measure the temperature itself. It calls a weather API with the city name. The API does the measurement, the calculation, and the formatting, and sends back a simple result: “18 degrees, cloudy”. The app does not know how the weather data was collected. It only knows the menu, and the result. That is what an API is for.
An API is a menu, not a machine. It lets one program ask another program to do something, without knowing how it works.
Go deeper: why AI products talk about APIs

An AI product is often a model with an API on top. The model does the work. The API lets other programs use the model without building it themselves. That is why so many AI products say “available through our API”. It means you can send a request to the model, get a result, and build your own product on top, without owning the model or the servers. The API is the doorway. The model is the room behind it.

Step 2 · The contract

An API is a promise about the shape of the request and the result

Same shape, every time.

An API is not just a way to send a message. It is a promise about the shape of the message. The request has a fixed format, and the result has a fixed format. That is what makes it reliable. A program can send the same request a million times and get back results in the same shape. The shape is the contract, and the contract is why APIs are used everywhere.

Think of a form at a doctor’s office. The form has boxes for your name, your age, and your symptoms. You fill in the boxes. The form is the same for every patient, and the office knows exactly where to find each piece of information. An API is that form. The shape is fixed, so the program on the other side knows exactly where to look.

Choose an API type below. Each one shows what kind of structured result its contract returns.

Given a location request, the contract returns structured weather details like temperature and sky conditions.
Given source text and a target language, the contract returns the translated phrasing in a predictable format.
Given a ticker or symbol request, the contract returns price fields formatted for the calling app to read.
If a provider alters response fields without warning, calling programs looking for the old shape can fail.

Each API has its own contract, and the contract decides the shape of the result. That is why a program can use an API without knowing how the work is done.

What just happened

You compared four API contract examples and saw how a fixed request-and-response shape lets calling programs reliably read the result—or break if that shape changes unexpectedly.

Why it works this way

An API is a promise. The program that calls the API knows what shape to expect, and the program behind the API knows what shape to send. That is what makes APIs reliable. The promise is written down in a document, called the API documentation, and both sides follow it. Without the promise, the two programs could not work together, because each would have a different idea of what the request and the result should look like.

Worked example. A weather app calls a weather API with a city name. The contract says the result will include a temperature in degrees, a condition like cloudy or sunny, and a humidity percentage. The app knows exactly where to find the temperature and how to display it. If the API changed its contract without telling anyone, the app would break. That is why the contract is the most important part of an API.
An API is a promise about the shape of the request and the result. The promise is why two programs can work together.
Go deeper: why the contract is written down

The contract is written down in the API documentation. The documentation tells developers what to send, in what format, and what they will get back. Without documentation, no one could use the API reliably. That is why every serious API has documentation, and why the documentation is as important as the API itself. The documentation is the menu. The API is the waiter.

Step 3 · Why AI uses APIs

Why AI products are often built on someone else’s API

The model is the kitchen. The API is the waiter.

Editorial infographic titled 'How AI Products Are Actually Built', showing the three-tier architecture: Foundation Model Labs as the Kitchen, APIs as the Waiter, and Consumer AI Apps as the Branded Restaurant.

Most AI products are not built by training their own model. Training a large model is expensive, slow, and requires a lot of hardware. Instead, most AI products call an API that someone else built, and build their product on top. The model is the kitchen. The API is the waiter. The product is the restaurant that serves the dish under its own name.

Think of a food truck that does not have its own kitchen. It buys the food from a restaurant, serves it under its own name, and adds its own sauce. The food truck is the AI product. The restaurant is the model provider. The API is the deal between them. The food truck does not need a kitchen. It needs the deal.

Slide the control below across 5 integration approaches—from 1 (full custom training) to 5 (direct API call)—to see how setup effort and speed shift.

At level 1, training a large model from scratch takes substantial time, hardware, and specialist teams. At level 2, building and maintaining custom model pipelines still demands heavy engineering and compute investment. At level 3, adapting an existing model requires moderate setup, targeted data, and some technical care. At level 4, calling an existing API and adding product workflow logic lets teams ship features much faster. At level 5, calling an existing AI API gets features running quickly without building or hosting the model yourself.

What just happened

You moved the slider from level 1 (training from scratch) up to level 5 (calling an existing API) and saw how calling an API speeds up building AI features without owning the model.

Why it works this way

Training a large model is expensive because it needs a huge amount of data, a huge amount of hardware, and a team of specialists. Most products cannot afford that. Calling an API is cheap because the model already exists, and the API lets the product use it without owning it. That is why most AI products are built on someone else’s API. The model is the kitchen. The API is the deal.

Worked example. A startup wants to add a translation feature to its app. It could train its own translation model, which would take months, cost millions, and need a team of specialists. Or it could call a translation API, which would take a day, cost a few dollars per thousand requests, and need no specialists. The second option is almost always the right one. That is why APIs are the backbone of most AI products.
Most AI products call an API instead of building their own model. The model is the kitchen. The API is the deal.
Go deeper: when it is worth building your own model

Building your own model is worth it when you need something no existing model can do, when you have data that no one else has, or when the cost of calling an API at scale becomes higher than the cost of building your own. For most products, none of those is true. That is why the default is to call an API, and why the companies that build their own models are a small minority.

Step 4 · Why APIs matter to you

Why you can use an API without writing code

The menu is for everyone, not just developers.

Three-panel educational infographic titled 'Two Ways to Order: Same AI API', showing that both developer code and no-code spreadsheets connect to the identical underlying API and AI model backend.

You might think APIs are only for developers. They are not. Many products let you use an API without writing a single line of code. You pick the model, fill in a few fields, and connect it to your app or your spreadsheet. The menu is the same. The waiter is the same. Only the way you order changes. A no code tool is just a friendly menu on top of the same API.

Think of a self service kiosk at a fast food restaurant. You do not need to talk to a person. You tap the picture of the meal you want, and the kitchen makes it. The kiosk is the no code tool. The kitchen is the model. The API is what connects them. You do not need to know how the kitchen works to order a meal.

Judge these four statements. Decide whether each one is true or false about APIs.

You can use an AI API without writing any code.
You need to understand how the model works to use its API.
An API is a contract about the shape of the request and the result.
An API replaces the model.

What just happened

You judged four statements and saw which ones are true. The true ones described APIs as contracts that anyone can use, with or without code. The false ones described APIs as machines you need to understand, or as replacements for the model.

Why it works this way

An API is a contract, not a machine. The contract says what to send and what will come back. Anyone who can follow the contract can use the API, whether they write code or use a tool that writes it for them. That is why APIs are the backbone of most AI products, and why you can use them without knowing how the model works.

Worked example. A marketer wants to summarise customer reviews. They do not write code. They use a no code tool that connects to a summarisation API. They pick the model, paste the reviews, and click run. The tool sends the request to the API, the API carries it to the model, and the result comes back. The marketer never sees the code. They only see the menu and the result. That is what an API makes possible.
An API is a contract, not a machine. Anyone who can follow the contract can use it, with or without code.
Go deeper: why no code tools exist

No code tools exist because most people do not want to write code to use an API. The tool writes the code for them, and presents a friendly menu instead. The API is the same. The tool is just a layer on top, like a waiter who speaks your language. That is why you can use an AI API without being a developer, and why the same API can be used by a developer writing code and a marketer clicking buttons.

Step 5 · The limits

What an API does not give you

The waiter carries the dish. The waiter does not cook it.

Educational infographic titled 'Access vs. Control: The Limit of an API', contrasting the convenience and lack of control in calling an AI API with the complete ownership and high cost of building a custom model.

An API gives you access to a model, but it does not give you control over the model. You cannot change the weights. You cannot see the training data. You cannot make the model do something it was not built to do. You can only order what is on the menu, the same way you can only order food that is listed in a restaurant menu. That is the limit, and it is why companies sometimes build their own model even when an API would be easier.

Think of a restaurant. You can order from the menu, but you cannot walk into the kitchen and change the recipe. The waiter will bring you what the kitchen makes, and nothing else. An API is the same. It gives you access to the model, but not control over it. That is the trade: convenience in exchange for control.

Answer the three questions below. After each answer you will see why every option is right or wrong.

Calling an existing model API Building a custom model from scratch Neither option can send a chat request
When unique data or needs require custom model control Whenever you want the slowest setup possible Whenever you want to avoid all software requests
Access to capabilities without full model control Full ownership of the provider’s training data A replacement for every model and server

What just happened

You answered three questions and saw the reasoning behind every option. An API provides convenient access for standard tasks, while custom models matter when unique data or deeper control is required.

Why it works this way

An API gives you access to a model, but not control over it. That is fine for most products, because the existing model already does what they need. It is not fine when you need something no existing model can do, or when you have data that no one else has. That is when the control matters more than the convenience, and building your own model becomes the right choice.

Worked example. A company wants a chatbot to answer questions about its own products. The existing models are good enough, and the API is cheap. The company uses the API and adds its own product information in the prompt. A different company has a unique dataset of medical records and needs a model trained on it. No existing model can do that, so the company builds its own. The same technology, two different choices, and the choice depends on whether the existing model is enough.
An API gives you access, not control. That is enough for most products, and not enough when you need something no existing model can do.
Go deeper: why the API is often the right first choice

An API is usually the right first choice, even for a company that might later build its own model. It is faster, cheaper, and lets the company learn what it actually needs before spending millions on training. Many companies start with an API and only build their own model when the API is no longer enough. Starting with the API is not a compromise. It is the sensible first step.

Step 6 · Prove it

Three questions. Let’s see what stuck.

You have seen what an API is, why the contract matters, why AI products call APIs, why you can use one without code, and what an API does not give you. Now check what you can explain in your own words. These questions are about the ideas, not the numbers.

Answer each one, read the explanation, and then see your result. If you miss one, the explanation tells you where to look back.

What is an API, really?

  • A standalone hardware chip
  • A bridge carrying requests and results
  • A raw training dataset
  • A physical server rack

Why does an API contract matter?

  • It hides all documentation
  • It fixes request and response shapes
  • It replaces the backend logic
  • It prevents any data transfer

What is a key limit of an API?

  • It cannot return results
  • It gives access, not full control
  • It blocks all no-code apps
  • It never takes requests
0/3

Your result

What you now know

  • An API is a waiter between two programs, carrying requests and results.
  • The contract is the shape of the request and the result. It is why two programs can work together.
  • Most AI products call an API instead of building their own model. The model is the kitchen. The API is the deal.
  • You can use an API without writing code, because the contract is the same for everyone.
  • An API gives you access, not control. That is enough for most products, and not enough when you need something no existing model can do.

Get the monthly summary

One short email a month with the best new topics on the site.

No daily mail, no spam. Just a short note when something worth reading is added.

One short email a month. Unsubscribe any time.

Words you met

  • API: a waiter between two programs. It carries a request to the other program and brings back the result.
  • Contract: the fixed shape of the request and the result. It is what makes an API reliable.
  • Documentation: the written description of the contract. It tells developers what to send and what to expect.
  • Request: the message a program sends to an API, asking for something.
  • Result: the message the API sends back, after the work is done.
  • No code tool: a friendly menu on top of an API, so you can use it without writing code.
  • Access versus control: an API gives you access to a model, but not control over it. Most products only need access.
  • Model provider: the company that runs the model behind the API. The food truck buys from the restaurant.

All examples and numbers in these exercises are simplified teaching examples. Real APIs are more complex, but the ideas shown are the real ones.

Understand AI without the jargon

Get our newest AI lessons by email: how models work, what agents can really do, and how to use AI well.

Witjo Newsletter Signup – AI

One short email a month. Unsubscribe any time.

Save to list

Scroll to Top