What is an API? A Beginner's Technical Guide with Real-World Examples
An API (Application Programming Interface) is a standardized set of protocols, routines, and definitions that allows two separate software applications to communicate and exchange data securely over a network without knowing each other's internal source code.
Overview #
An API (Application Programming Interface) is a standardized set of protocols, routines, and definitions that allows two separate software applications to communicate and exchange data securely over a network without knowing each other's internal source code.
How an API Works: The Restaurant Waiter Analogy #
Consider dining in a restaurant: you (the client application) sit at the table with a menu of options. The kitchen (the server/database) prepares the food. However, you do not walk into the kitchen to cook the food yourself. Instead, the waiter (the API) takes your order (the API request), delivers it to the kitchen, and brings back the prepared dish (the API response). In software, when a mobile travel app displays flight prices, it calls the airline's API to fetch real-time seating and pricing without accessing the airline's private database directly.
The Core Anatomy of a Modern Web API #
Modern web APIs operate over HTTP/HTTPS and consist of four primary components:
- Endpoint URL: The network address where the resource lives (e.g.
https://api.apihundred.com/v1/chat/completions). - HTTP Method: The intended verb (GET to read, POST to create/process, PUT/PATCH to update, DELETE to remove).
- Headers: Metadata specifying authentication tokens, content formats (
application/json), and caching directives. - Body/Payload: The structured JSON data containing the instructions or content to be processed.
Types of APIs: Web APIs, Library APIs, and Hardware APIs #
While web APIs (REST, GraphQL, gRPC) dominate cloud software, APIs also exist at every level of computing: operating system APIs (Windows Win32, POSIX), GPU compute APIs (CUDA, Metal), and language standard libraries (Python os, JavaScript fs). In modern AI development, web APIs allow developers to harness thousands of remote GPUs with simple HTTP network requests.
Code Example: Making Your First API Call in JavaScript with Fetch #
// Fetching data from a modern REST API endpoint
async function queryAPI() {
const response = await fetch("https://api.apihundred.com/v1/models", {
method: "GET",
headers: {
"Authorization": "Bearer your_api_key_here",
"Content-Type": "application/json"
}
});
const data = await response.json();
console.log("Available AI Models:", data);
}
queryAPI();
Frequently Asked Questions #
Q: What does API stand for?
API stands for Application Programming Interface. It provides a defined contract through which software programs interact.
Q: Is an API the same as a database?
No. A database stores data persistently. An API is an interface layer that controls, validates, and secures access to the database or compute services.
Q: Why do companies provide APIs?
APIs allow companies to expose their services (e.g. Stripe for payments, API100 for AI models, Twilio for SMS) programmatically so other developers can build on top of their platform.
Build with API100
Access 100+ AI models through one lightning-fast OpenAI-compatible API with sub-50ms routing overhead and zero markup on cached tokens.

