L050 · Under the hood · 2 min

What is an API?

An API is a set of agreed rules that lets one program ask another program for something and get a reply, with no person clicking buttons in between.

01 · The idea

When you use a chatbot, you type into a website or app. Programs cannot do that easily, so services also offer an API: a fixed way for software to send a request and receive an answer.

The request is a small, structured message. For an AI model it says which model to use, the instructions, and the text to answer. The reply comes back in the same tidy format, ready for the program to use.

This is how AI ends up inside other apps. A shopping site's help bot, a writing tool in your email, or a translation feature might all send your text to a model's API behind the scenes.

APIs usually need a secret key that identifies the account and is used for billing. Treat it like a password: never post it online or paste it into a public file, because anyone with it can spend money on that account.

02 · Think of it like this

It is like ordering at a counter with a numbered menu. You don't walk into the kitchen. You say "number 12, no onions", and the kitchen sends back exactly that dish in a box.

03 · Do it now

04 · Quick check

Why should you keep an API key secret?