What an API key is
Programs talk to other programs all the time. A website asks a payment service to charge a card. A chatbot asks an AI model to write an answer. The agreed way for programs to make such requests is called an API, short for application programming interface. You can think of it as a service counter built for software instead of people.
An API key is the code a program shows at that counter to say who it is. It is usually a long string of letters and numbers. The service checks the key, connects the request to an account and decides what the caller may do. Without a valid key, the request is turned away.
Why services use keys
A key solves three problems at once. First, it tells the service who is calling, so it can bill the right account. AI models, map services and email services often charge per request, and the key is how they know whom to charge.
Second, it controls access. A key can be allowed to do some things and not others, for example only read data, or only use one model.
Third, it makes use traceable. The service can show how much each key has been used, so you can spot unusual activity and see which project is using what. This is also why one key per project or system is better than one shared key for everything: when something goes wrong, you can see where and switch off only that key.
How a key is used in practice
A developer creates the key in the service's dashboard, the web page where you manage your account. The service shows the key once, and the developer stores it somewhere safe.
When the program runs, it attaches the key to each request, usually in a hidden part of the message called a header. The service reads it, checks it against its records and answers.
The important detail is where the program runs. If it runs on a server you control, the key can stay there, out of sight. If the code runs in a visitor's browser or in an app on someone's phone, anyone curious can read it. That is why requests to paid services such as AI models should go through your own server, which adds the key on the way, instead of being sent straight from the browser.
How keys leak, and what happens then
Keys rarely leak through clever hacking. They leak through ordinary habits. A key is pasted into an email or a chat to help a colleague. It is written into a shared document. It is left in website code that anyone can view. It is pushed to a code repository that turns out to be public. Automated tools scan public code for keys constantly, so a key that ends up there is often found quickly.
Whoever has the key can act as you. For an AI service, that usually means they can run requests on your account until the bill or the usage limit is reached. For other services, it may mean reading or changing data.
If you suspect a leak, do not wait to find out. Revoke the key in the service's dashboard, which makes it stop working at once, create a new one, and update the systems that used the old one.
Good habits for handling keys
Store keys in a secrets store, a place built to hold passwords and codes for programs. Hosting services such as Cloudflare, Vercel and the big cloud providers all have one. Password managers work for keys that people need to handle by hand.
Give each project its own key, with only the rights it needs. Set spending limits or alerts with the provider where possible, so a leak shows up as a warning instead of a surprise bill. Change important keys from time to time and always when someone with access leaves.
Finally, keep a simple list of which keys exist, what they are for and who owns them. Many problems come from old keys nobody remembers, still working years after the project ended.
What it means for a small business
As soon as a small business starts connecting AI to its own systems, API keys appear. A chatbot on the website, an automation that summarizes emails, a tool that reads invoices: each one needs a key to reach the AI model or the other services involved.
The keys are worth treating like the keys to the office. Decide who creates them, where they are stored and who can see them. If an outside developer or agency builds something for you, ask that the accounts and keys are set up in the company's name, so you keep control and can switch them off if the cooperation ends.
None of this requires deep technical knowledge. It requires the same care you already take with bank logins: do not share them by email, keep them in one safe place, and act at once if one may have been exposed.