API
In short
An API (application programming interface) is a set of rules that lets one program ask another for data or actions. In AI, it is how apps send prompts to models such as Claude or GPT and get answers back as data.
- Also called
- Application programming interface, Application program interface, Web API, AI API
- Topic
- Using AI tools
- Level
- Beginner
The US standards body NIST defines an API as a system access point or library function with a well-defined syntax, which programs can call to carry out specified functions1. Put simply, it is a fixed menu of requests one program can make of another, plus the format the answers come back in.
Most AI APIs are web APIs: a program sends a request over the internet and gets a reply. Anthropic describes its Claude API as "a RESTful API" at api.anthropic.com, with requests sent as JSON2. REST is the architectural style Roy Fielding set out in his 2000 doctoral dissertation at the University of California, Irvine3.
To use a model API, a developer creates an API key, a secret string that identifies their account, and sends it with every request2. The provider then bills for usage and applies rate limits, caps on requests and tokens per minute2. Claude is also sold through the cloud platforms of Amazon, Google and Microsoft, each with its own billing and access controls2.
An API is not the same as the chat app. Anthropic says a paid Claude subscription covers the chat product and "the Claude API is billed separately", although its Max and Team plans include monthly API credits4. The API is the raw service that other companies build their own products on.
Example
A UK estate agent adds a chatbot to its website. When a visitor types a question, the agent's server sends it, along with a hidden API key, to a model provider's API and shows the reply on the page. The visitor never sees the API at all.
Why it matters
Almost every AI feature built into other apps runs through an API. It is how businesses rent a model like Claude or GPT and pay per use, rather than build their own.
Questions people ask
What does API stand for?
Application programming interface. NIST's glossary also records the older form, application program interface, and defines it as an access point with a well-defined syntax that programs can call1.
Is the Claude API included in a Claude Pro subscription?
No. Anthropic says a paid Claude subscription improves the chat product and the API is billed separately. The exception is that Max and Team plans include some monthly API credits4.
What is an API key?
A secret string that identifies your account to the provider. Claude API requests carry it in a request header, and usage is charged to the account it belongs to2. Anyone who gets hold of your key can run up your bill, so it should never be shared or published.
Related terms
Tools that use it
Sources
- NIST Computer Security Resource Center glossary, Application Programming Interface (API), citing NISTIR 5153 and NIST SP 1800-16C
- Anthropic, Claude API documentation, API overview
- Fielding (2000), Architectural Styles and the Design of Network-based Software Architectures, PhD dissertation, University of California, Irvine
- Claude Help Center, Why do I have to pay separately to use the Claude API and Console?
- Cotton and Greatorex (1968), Data structures and techniques for remote computer graphics, AFIPS Fall Joint Computer Conference
- Wikipedia, API (History section)