Cybersecurity

What is API Key?

Quick answer

A unique code that identifies an application or user when it calls an API, used to control access, track usage, and apply billing.

API Key, explained

Many web services require an API key with each request. The service checks the key to confirm the caller is allowed, applies rate limits, and records usage for billing. Keys are simpler than full user authentication methods such as OAuth, but they work like passwords: anyone holding the key can use it.

A common mistake is publishing keys in public code repositories or embedding them in mobile apps and website code, where they can be copied. For example, a leaked key for a mapping or AI service can lead to large unexpected bills as others use it. Good practice is to store keys in secret management tools or environment variables, restrict each key to specific services and addresses, rotate keys regularly, and revoke any key that may have been exposed.

Related terms

Guides that mention API Key