An API (Application Programming Interface) is a defined set of rules that lets one piece of software ask another to do something – fetch data, send a message, run a calculation – without needing to know how that other software works internally. "Application" is the program making the request, "Interface" is the point of contact between two systems, and "Programming" just means this contact happens in code rather than through a screen a human clicks on.
A Quick Analogy
A restaurant menu doesn't show you the kitchen – you pick an item, the kitchen does the work, a waiter brings back a plate in a predictable form. The API is the menu plus the waiter; the kitchen (the actual code, database, or server behind it) stays hidden and can change without you needing to learn anything new.
How an API Actually Works
Every API call follows the same basic cycle, no matter what it's for:
- The client sends a request. This is the app or script asking for something – it specifies what it wants and, often, what data it's sending along.
- The request hits an endpoint. An endpoint is a specific URL that represents one action or one piece of data – /users/42 might fetch one user, /orders might list all orders. Each endpoint typically supports one or more HTTP methods: GET to read data, POST to create something, PUT/PATCH to update it, DELETE to remove it.
- The server processes it. Behind the endpoint, the server runs whatever logic the request triggers – querying a database, running a calculation, checking a payment.
- The server sends a response. This usually comes back as JSON (occasionally XML), along with a status code that summarizes what happened – 200 for success, 404 for "not found," 401 for "you're not authenticated," 500 for a server-side error.
A request to fetch a single order might look like this:
No mention anywhere of what database this came from or what server it ran on – that's the entire point.
Types of APIs
Not every API works the same way under the hood. The style matters for what kind of app it fits best:
Most APIs you'll encounter day to day – payment processors, mapping services, weather data – are REST APIs, which is why "REST API" and "API" get used almost interchangeably in casual conversation.
Public, Private, and Partner APIs
APIs also differ by who's allowed to use them:
- Public (open) APIs are available to any developer, often with a free tier and published documentation – Google Maps and OpenWeatherMap are examples.
- Private (internal) APIs are built for a company's own teams to connect their own services together, and are never exposed outside the organization.
- Partner APIs sit in between: shared with specific outside companies under a business agreement, with access controlled more tightly than a public API but more broadly than an internal one.
Authentication: API Keys and Tokens
Most APIs need to know who's calling before they'll do anything. The two most common mechanisms:
- API keys are a single, long string a developer includes in each request (often in a header, as in the curl example above). Simple to implement, but a leaked key is fully compromised until it's rotated.
- Tokens (commonly OAuth 2.0 access tokens or JWTs) are usually short-lived and scoped to specific permissions – a token might allow reading data but not deleting it, and it expires on its own even if it leaks.
As a rule of thumb: an API key is fine for a personal project or a low-stakes integration; a token-based flow is the standard for anything handling user data or requiring fine-grained permissions.
Where APIs Show Up
The same request-response pattern powers very different products:
- Maps and geocoding. Google Maps' API turns "123 Main St" into coordinates and turn-by-turn directions – the calling app never has to know how the routing engine or the satellite data works.
- Payments. Stripe's API processes a card charge without the calling app touching a bank directly or storing card numbers itself – the regulated, hard part stays entirely on Stripe's side.
- Weather. A forecast API returns a prediction for a location; the app has no idea whether that came from a satellite model or a ground-station network.
- Streaming and social apps. Spotify and Twitter/X both expose public APIs so third-party apps can pull playlists, post updates, or read public data without scraping a website.
How to Start Using an API
Getting from zero to a working call usually takes four steps:
- Read the documentation. Every API worth using publishes docs describing its endpoints, required parameters, and response format.
- Get credentials. Sign up for an API key or register an app to get OAuth credentials – most providers have a free or trial tier for this.
- Make a test call. Use a tool like curl, Postman, or a simple script to hit one endpoint and confirm you get the response you expect.
- Handle errors and rate limits. Real usage means planning for a 429 (too many requests) or a 500 (server error) response, not just the happy path.
APIs and AI Agents
An AI agent doesn't click buttons or open apps – every action it takes happens through an API call. This is what "tool use" actually is under the hood: the model decides what to do, and an API executes it. A weather agent calls a weather API; a scheduling agent calls a calendar API; a support agent that reads and replies to email calls an email API built to handle inbound as well as outbound mail, since a plain transactional send-only API isn't built for a two-way conversation.
Atomic Mail Agentic is one such API, purpose-built to give an AI agent its own inbox rather than just an outbound send endpoint.
FAQ
What's the difference between an API and an SDK? An API is the interface itself (the rules for requests and responses); an SDK is a code library that wraps those requests in functions for a specific programming language, so you don't write raw HTTP calls by hand.
Do all APIs use JSON? Most modern web APIs do, though some (especially older or enterprise systems using SOAP) use XML, and a few specialized protocols use their own binary formats.
What does "REST API" mean? REST is a common architectural style for designing APIs around standard HTTP methods (GET, POST, PUT, DELETE) and predictable URLs – most APIs you'll encounter are REST APIs.
What is an API, with an example? An API is a set of rules letting two programs talk to each other – for example, a weather app calling a weather service's API, sending a city name and getting back a JSON response with the temperature and forecast.
Is ChatGPT an API? ChatGPT itself is a consumer product, but OpenAI also offers a separate API (the same underlying models) that developers can call directly from their own applications – so "ChatGPT" the chat app and "the OpenAI API" are related but distinct things.
Is Netflix an API? No, Netflix is a streaming service, not an API – though Netflix does use APIs internally to connect its own apps and devices to its servers, and historically offered a limited public API for affiliates before shutting it down to the general public.
Is API a coding language? No – an API isn't a programming language at all. It's an interface: a set of rules for how two pieces of software communicate, and it can be built using any programming language on either end.



