A8gent
GlossaryAutomation mechanics

What is API key?

Also called: API token, secret key

An API key is a secret string that identifies and authorises an application when it calls a service - simple to use, and dangerous because it usually carries broad access and does not expire on its own.

Written by A8gent
Contents
  1. At a glance
  2. What an API key is
  3. Storing and scoping keys
  4. Rotation, leaks and cost
  5. What you should know
  6. FAQ
  7. Related terms

At a glance

Category
Automation mechanics
How it travels
Usually an Authorization header, often as a bearer token
Versus OAuth
Simpler to set up, but broader access and no automatic expiry
Storage
Platform credential store or a secret manager - never in a workflow field or repo
Scope where possible
Read-only, per-project or IP-restricted keys limit the blast radius
Rotation trick
Most services allow two live keys, so rotation needs no downtime

What an API key is

An API key is a long secret string you include with each request to prove which application is calling. It usually travels in a header - Authorization: Bearer sk-... or a vendor-specific header - and the service looks it up to decide who you are and what you may do. Compared with OAuth it is far simpler: no redirect, no consent screen, no refresh cycle. Paste it in and it works.

That simplicity is also the risk. A key typically represents the whole account rather than one user's scoped consent, and it generally does not expire. Anyone holding it can do whatever it permits, from anywhere, until someone notices and revokes it.

Storing and scoping keys

Three rules cover most of the risk. Never put a key in code, a workflow field, a spreadsheet or a shared document. Use your platform's credential store, which encrypts it and hides it from the workflow view, or a dedicated secret manager. Keys pasted into a workflow node get exported with the workflow and shared with whoever receives it.

Scope it down where the vendor allows. Many services now issue restricted keys - read-only, limited to specific resources, limited to specific IPs. Use them: an AI provider key restricted to one project cannot drain the whole account, and a read-only key cannot delete your records. Use separate keys per system, so you can revoke one integration without breaking the other five and can tell from usage logs which one is responsible for a spike.

Rotation, leaks and cost

Rotate on a schedule and immediately whenever someone with access leaves. The operational trick is that most services let you have two active keys at once: create the new one, update everything, verify, then delete the old one - so rotation causes no downtime.

Leaked keys are a live problem, not a theoretical one. The common routes are a key committed to a public repository, pasted into a support ticket or a chat, or left in a screenshot in documentation. AI provider keys are specifically targeted because a stolen key is directly monetisable - someone else's token spend on your bill. Set a hard spend cap on every AI provider account, because that cap is the only control that limits the damage rather than merely reporting it.

What you should know

Keep an inventory: which keys exist, which system each belongs to, who created it, what it can do, and when it was last rotated. It takes an hour to build and it is the document you will need during an incident, an offboarding or a client security review.

Alert on 401 responses in your error handling, since a revoked or rotated key shows up that way, and monitor spend on any metered service. An unexpected cost spike is often the first visible sign of a leaked key - long before anyone finds the commit.

API key FAQ

What is an API key?

A secret string sent with each request to identify and authorise the calling application. It is the simplest form of API authentication - no consent screen, no refresh cycle - and usually carries broad account access with no expiry, which is what makes it risky.

Where should I store API keys?

In your automation platform's credential store, or a dedicated secret manager. Never in a workflow field, a code file, a spreadsheet or a shared document. Keys pasted into workflow nodes travel with the workflow when it is exported or shared.

How often should I rotate API keys?

On a schedule you can actually keep - quarterly is common - and immediately whenever someone with access leaves or a key may have been exposed. Most services allow two active keys, so you can create the new one, migrate, verify and delete the old one with no downtime.

What happens if my API key leaks?

Anyone holding it can use your account until it is revoked. For AI provider keys that means someone else's token spend on your bill, which is why they are actively targeted. Revoke immediately, rotate everything that used it, and check usage logs for the period it was exposed.

How do I limit the damage of a leaked AI key?

Set a hard spend cap on the provider account and use project-scoped keys where offered. A cap is the only control that stops the bill rather than reporting it afterwards. Alerting on spend gives you notice; the cap gives you a ceiling.

Should I use one key for everything?

No. Separate keys per integration mean you can revoke one without breaking the others, and usage logs tell you which system caused a spike or a rate limit. It costs nothing to create extra keys and saves a great deal during any incident.

Primary source

OpenAI - API data controls and key handling

Checked August 2026. Anything priced or rate-limited moves, so verify against the source before you budget.

Want this built rather than explained?

Knowing what api key means is one thing; having it running in your business is another. We scope one workflow at a time, quote a fixed price in writing after a free consult, build it, and hand it over with documentation you own.