What Is an API?
Also called application programming interface, LLM API, web API
Short Answer
An API (application programming interface) is a defined way for one program to ask another program for data or an action. AI products call model APIs, from OpenAI, Anthropic, Google or Mistral, by sending a request with a prompt over the internet and receiving the model's answer back, usually as JSON.
- Taught in lesson 30
- In 1 real job ad
Why It Matters
APIs are how almost every AI product is built: applications send requests to model APIs and to company systems. Being able to read API documentation, send requests, handle errors and keep keys safe is a basic skill for AI engineers and very useful for anyone automating work.
How It Works
A web API has addresses called endpoints, accepts requests over HTTP and answers with a status code and data. Access is controlled with an API key, a secret that must never be shared or committed to code repositories.
Calling an LLM API is the starting point of AI engineering. Production code adds error handling, retries with backoff when the provider is busy, timeouts, cost tracking and a fallback to another model.
A typical API call has an endpoint (the address), a method such as GET or POST, headers that carry the API key, and a body with the request data, usually in JSON. The response carries a status code, such as 200 for success, 401 for a bad key or 429 for too many requests, and the result. Robust code handles errors, retries with waiting time when limits are hit and never exposes keys in code or browsers.
API in Practice
Everyday Example
A weather app does not measure the weather itself: it calls a weather service's API and displays the answer it gets back.
Industry Example: Pharma
A pipeline calls a model API to summarize each new safety report, and calls the company's database API to store the summary next to the original record.
Where You Meet It
- Calls to language model providers.
- Connections between business systems.
- Tools that agents call.
- Documentation pages of every software service.
Key Ideas Around It
- Endpoint
- The address of a specific API function.
- API key
- A secret that identifies and authorises your program.
- JSON
- The common text format for API data.
- Rate limit
- How many requests you may send in a period.
A Common Mix-Up
An API is not a website for people. It is an interface for programs; the same service may have both, but they serve different users.
Check YourselfYour API call returns status 429. What does it usually mean and what do you do?
Too many requests: wait and retry with increasing delays, and reduce your request rate.
Seen in Real Job Ads
Lines quoted word for word from live job postings.
Pixid
Artificial Intelligence Product Lead, Courbevoie
Ability to build POCs autonomously (Python, API integrations, no-code/low-code tools).
Translated from French.
Learn It on ai2hired
S2 · #30Calling Web APIs in Python
Coming in Season 2, Python. Every ai2hired lesson is free on YouTube.
Questions People Ask
What is an API key?
A secret string that identifies your account when you call an API. Keep it in an environment file, never in your code or in a public repository.
Do I need to know APIs for an AI job?
Yes. Calling and building APIs appears in almost every AI engineer job ad.
Related Terms
Learn AI From Zero to Hired
Free lessons on YouTube, each one built from what real AI job ads ask for.