
API Function
An API function is a single, clearly defined service that one program offers to another program — for example, "translate this text." You call it over the internet or within a computer, send along data, and get back a result.
Programs need to be able to ask each other for things. A weather app on your phone doesn’t know anything about the weather itself. It asks a remote computer that has the measurement data. For this to work, that computer publishes a list of services that can be ordered from it. A single such service is called an API function. API stands for “Application Programming Interface” — the point where two programs talk to each other. An API function is like a dish on a menu — it has a fixed name, requires certain information, and delivers a predictable result.
Why nobody builds everything themselves
Without such interfaces, every company would have to develop every capability from scratch. A small online shop would then have to program its own card payment system, its own maps, and its own speech recognition. That’s unaffordable. Instead, it integrates ready-made API functions from other providers. A few lines of code are enough, and the payment works.
For providers, this is a business model. Companies like OpenAI, Google, or Stripe don’t sell their capabilities as a tangible product but as a call. Billing is per use, often in tiny amounts. For language models, you typically pay fractions of a cent per thousand processed text chunks. With millions of requests, this still adds up to substantial revenue.
But this also creates a dependency. Whoever bases their product on someone else’s API functions is at the mercy of that provider’s prices and decisions. If the provider changes the terms or shuts down a function, entire companies grind to a halt. In the tech industry, this is a recurring topic in the news.
What happens during a call
Every API function has three fixed components. First, a name or address under which it can be reached. Second, the inputs, also called parameters: these are the pieces of information it needs to work. Third, the return value, i.e., the result. A translation function needs the text and the target language and returns the translated text.
Technically, this usually runs over the same network protocol as a normal website. Your own program sends a request to an internet address. The remote server responds with a structured data package, often in JSON format. This is a simple text format that humans can read and machines can reliably parse. Usually, you also have to send along a personal key so the provider knows whom to bill for the usage.
An important distinction: an API function is not a program that runs on your device. The actual code stays with the provider — you never see it. You only know the agreed-upon form of input and output. This is exactly what makes it stable — the provider can completely rebuild its internal workings as long as the interface stays the same.
API functions in AI products
Most AI applications you use are not AI themselves. A writing assistant in a text program sends your paragraph to a language model and displays the answer. The actual computational work happens in a data center, often thousands of kilometers away. Without an API function, this division of labor would not be possible.
For a few years now, this has also worked in the other direction. Modern language models can call API functions themselves — this is called function calling or tool use. If you ask for the current exchange rate, the model doesn’t make up a number. It calls a financial interface and passes along its real value. Models that operate tools independently like this are behind the buzzword “AI agents.”
In business news, you usually encounter the term indirectly. When a company announces it is opening its model “via the API,” this means: developers can now, for a fee, integrate it into their own products. This is often a bigger economic step than the unveiling of the model itself.