Suppose you build a small app that summarizes meeting notes.
You do not necessarily need to download and run a large language model on your own computer. Your app can send the text to an AI provider over the internet and receive a summary back.
The connection is usually made through an Application Programming Interface (API).
An API is a defined way for software to ask another system for something
Think of a restaurant order window.
You do not walk into the kitchen and operate the stove yourself. You submit an order in a format the restaurant understands. The kitchen performs the work and returns the result.
An API plays a similar role between programs.
Your application sends a request. The remote service performs some operation. It returns a response.
What is inside an API request?
The exact format depends on the service, but an AI request often includes:
- which model you want to use,
- the input text or other data,
- generation settings,
- optional tool or output-format instructions,
- authentication information.
The destination you call is often referred to as an endpoint.
What is an API key?
Many services issue an API key, a secret credential that identifies and authorizes your account or project.
It is closer to a password than to a username.
Do not paste a private API key into public GitHub code, a screenshot or a browser-side script that every visitor can inspect.
Production applications usually store secrets on the server or in a secret-management system.
The response is often structured data
An API does not need to return a web page. It often returns data in a machine-readable format such as JSON.
That allows your program to extract fields, display text, save usage information or trigger the next step automatically.
This is one reason APIs are important for automation: the result is meant to be consumed by software, not only read by a person.
API versus using a chat website
When you use a chat product, the product handles the interface, memory, account controls and many hidden instructions for you.
When you use an API, you control more of the surrounding application logic. You decide when to send requests, what context to include, how to store results and what to do next.
That extra control also creates extra responsibility for security, cost and error handling.
A minimal mental model
Your app → API request → remote service/model → API response → your app
The model may run in a data center far away, but your program can use it as a capability through this interface.
APIs are not automatically free
Most commercial AI APIs charge based on usage. Text models often meter tokens; image, audio and video services may use different units.
Lesson 019 explains how text-model API pricing works, including input tokens, output tokens, cached tokens and why “one request” is not a useful cost unit.
One thing to remember
An API is a defined interface that lets one piece of software request data or capabilities from another system.
Comments
Questions, reactions and useful additions are welcome here.
No comments yet. Be the 1F.