APIs and web services
When extending the capabilities of an AI agent or tool, APIs and web services play a vital role in connecting language models to the outside world.
Definition
An Application Programming Interface (API) is a way for software applications to talk to each other. It defines a set of rules for how one program can request data or services from another—usually over the internet. APIs are everywhere: when your app gets the weather, loads your email, or books an Uber, it’s using an API.
APIs commonly follow the HTTP protocol and use methods such as the following:
GET
: To retrieve data (e.g., getting the current weather for your city)POST
: To send new data (e.g., submitting a new user registration form)PUT
: To update existing data (e.g., editing your profile information)DELETE
: To remove data (e.g., deleting a saved address from your account)
These operations are part of what’s known...