What Is an API Key? A Plain-English Guide
October 5, 2026

You found an AI app you wanted to try, opened its settings, and hit a box that says "paste your API key." So, what is an API key?
An API key is a long secret string that lets a piece of software use an AI service on your account. The tool you're setting up sends the key along with each request, the service sees it, and the usage is charged to whoever owns the key. The same goes for any AI API key, whether it's an Anthropic API key, an OpenAI API key, or a Google one.
The short version, as of October 2026:
- A key is a bearer secret. Whoever holds it can use it. Nothing else has to match.
- It's tied to your billing. Anthropic's help center compares it to a credit card number: if someone uses your key, they incur charges on your behalf.
- You create it, you protect it. Keep it out of chats, screenshots, and public code. Keep it in an environment variable. Give each app its own key.
- A leak is fixable. Revoke the key at the vendor and make a new one. Deleting the post or the file doesn't undo it.
API key vs password: what's different
People call a key "a password for software." That's close enough to start, but the differences are what make keys easy to lose.
| Password | API key | |
|---|---|---|
| Who uses it | You, typing it into a login screen | A program, sending it with every request |
| What it proves | That you're the account owner, usually with extra checks | That the request carries the key. Nothing more |
| If someone copies it | Many services ask for a second factor | Anyone holding it can make requests |
| Where it tends to leak | Phishing, reused passwords | Code, config files, chat messages, screenshots |
| How you fix a leak | Change it, sign out other sessions | Revoke it with the vendor and issue a new one |
Anthropic's authentication documentation describes its keys as static secrets sent as a bearer token in the Authorization header on every request. "Bearer" is the important word. Whoever bears the token gets in.
What a key identifies varies by vendor. An Anthropic personal key acts as you, with your roles and permissions. A Google Cloud standard API key is different: Google's docs say it associates a request with a project for billing and quota, and doesn't identify a person. Either way, the key can spend money, so protect it as if it can.
Why AI tools ask you to paste one
An AI app usually doesn't run its own model. When you ask it a question, it calls a model hosted by Anthropic, OpenAI, Google, or another vendor, through that vendor's API. Someone has to be billed for the call. If the tool asks for your key, that someone is you.
A made-up scenario: you install a notes-summarizer app from a developer's GitHub page. Its setup says "add your Anthropic key." You paste it in. Every summary the app generates is now a call on your account, and the app holds a credential that can spend your money.
That last point is the one people miss. Anthropic's API key best practices says that when you give a key to a third-party tool, you're giving that tool's developer access to your Console account, and that if you don't trust their reputation, you shouldn't trust them with it. So the question to ask isn't just "does this app work." It's "do I trust this app with a credential that can spend my money."
Where to get an API key
Each vendor has its own page, and none of them needs a terminal.
| Vendor | Where you create a key | What its docs say |
|---|---|---|
| Anthropic | Claude Console, Settings → API keys → Create key | You name the key, choose an expiration, and pick a linked account. You can also scope it to one workspace |
| OpenAI | The API keys page in the OpenAI platform dashboard | OpenAI's quickstart starts with creating a key in the dashboard |
| Google Cloud | The Credentials page in the Google Cloud console | Google calls unrestricted keys insecure and lets you limit a key to specific APIs |
One Anthropic detail trips people up. A paid Claude chat plan and the API are separate products. Anthropic's help article on the difference says a paid Claude subscription doesn't include access to the Claude API or Console. If a tool asks for a Claude API key, your chat login won't work. Our guide to getting Claude API access covers that split in more depth.
How an API key is billed
The billing model is "pay for what the calls use," charged to the account that owns the key. The key is only the credential. The charges come from the work done with it.
How that works in practice differs a little by vendor, in general terms:
- Anthropic has you buy usage credits for the Console. Its help article describes an auto-reload setting that charges the card on file to top up credits when your balance drops below a threshold you choose.
- OpenAI says that after you enter billing information, it sets an approved usage limit for your organization.
- Google Cloud ties a key to a project and uses the key for billing and quota on that project.
Rates change, so read them on each vendor's own pricing page. What matters here is the structure: your account pays for whatever the key does, so a key in the wrong hands is a bill in the wrong hands.
How to keep an API key safe: the rules that matter
These rules come from the vendors' own guidance, linked in each section below.
Don't paste it anywhere public or shared. Anthropic's guidance says not to put a key in public discussions, emails, or support tickets, even when the support ticket is to Anthropic. A screenshot carries the key just as plainly as the text does. The same reasoning applies to pasting a key into a chat with a person or an AI assistant. You're putting the secret in a place whose history you don't control.
Keep it out of public code. Anthropic's article calls accidental exposure in public code repositories one of the most frequent causes of key leaks. If you're not a developer, this one still matters: some AI app setups ask you to put a key in a settings file, and that file can end up in a repository when you share your work.
Use an environment variable. An environment variable is a named value your computer holds in memory, outside any file you'd share. Both vendors' docs use them. Anthropic's SDKs read ANTHROPIC_API_KEY automatically, and OpenAI's SDKs read the key from the system environment. Connecting an assistant to other services, as our MCP explainer covers, can involve the same kind of credential.
# macOS or Linux, current terminal session only
export ANTHROPIC_API_KEY="paste-your-key-here"
# Windows PowerShell, per OpenAI's quickstart
setx OPENAI_API_KEY "paste-your-key-here"
If you keep keys in a .env file instead, Anthropic's guidance is to list that file in your source-control ignore file, such as .gitignore, so it never gets published.
Keep it out of browsers and apps you distribute. OpenAI's API reference says not to expose a key in any client-side code such as browsers or apps, and to load it from an environment variable or key management service on the server.
Use one key per app. Anthropic recommends separate keys for development, testing, and production, so a compromised key can be disabled without breaking everything else. OpenAI suggests separate projects for staging and production. If you try three AI tools, make three keys and name each one after the tool. When one misbehaves, you revoke that key and nothing else changes.
Let keys expire, and rotate them. Anthropic lets you choose an expiration when you create a key, from short presets up to "Never," and says that expiration can't be changed afterward. OpenAI strongly recommends setting an expiration date and rotating on a regular process: create a replacement, update your apps, confirm it works, then revoke the old key. The reasoning is simple: a key that's replaced on a schedule stops working for anyone who stole an old copy.
Set spending limits where the vendor offers them. Anthropic's workspaces documentation says you can cap monthly spending per workspace, and that you can't set limits on the Default Workspace. So create a separate workspace for a new tool, then limit it. OpenAI's production best practices say you can set custom rate and spend limits per project. A limit won't prevent a leak, but it caps what one costs.
What to do if your API key leaks
Pasted a key somewhere you shouldn't have? Work through these in order.
- Revoke the key at the vendor. Anthropic's guidance for a suspected leak is to revoke it immediately: open the API keys page in the Console and delete the key. The Console also offers Disable, which is reversible, while Delete is permanent. For a leaked key, delete.
- Don't stop at deleting the message or the file. GitHub's remediation guide says to treat any leaked secret as compromised, and that removing it from the codebase, pushing a new commit, or deleting the repository doesn't prevent it from being exploited. Revoking with the provider is the step that counts.
- Create a new key and update the app. If you're worried about downtime, GitHub suggests creating the replacement and switching the application over first, then revoking the old one. Where the exposure was public, revoke first and fix the app after.
- Check your usage. Anthropic recommends regularly reviewing logs and usage in the Console. After a leak, look for calls you don't recognize.
- Clean up history only if you need to. GitHub's secret scanning documentation says that when you get an alert, rotate the credential immediately, and that scrubbing Git history is time-intensive and often unnecessary once the credential is revoked.
There's also a safety net for one kind of leak. According to Anthropic, it partners with GitHub's secret scanning program. If an Anthropic key shows up in a public GitHub repository, GitHub notifies Anthropic, which automatically deactivates the key and emails the owner. Treat that as a backstop: it covers public GitHub repositories, not a screenshot or a chat message.
Where Taku fits
Most "paste your API key" moments come from wiring things together yourself: a model here, a tool there, a settings file in between. If your goal is to use an AI setup, not assemble one, that's the part you'd rather skip.
Taku is an AI-native desktop workspace. You mirror an AI setup (an app, a skill, a workflow) that someone already got working, run it, remix it, and keep it. The free app library is a place to look for one. Taku isn't a replacement for a vendor's API. If you're building your own product on Claude or GPT, you'll create keys and handle them as above. And whenever any app, in Taku or elsewhere, asks for a key, the rules in this post apply. Taku is in Beta, and the Mac app is available now.
FAQ
What is an API key in simple terms?
A secret string that lets software use a service on your account. The software sends it with each request, and the service charges the usage to the account that owns the key.
Is an API key the same as a password?
Not quite. A password is typed by a person to log in. An API key is sent by a program on every request, and anyone who holds it can use it. That's why it needs different handling: environment variables, one key per app, and revocation instead of "forgot password."
Is it safe to paste my API key into a chat?
No. Anthropic's guidance says not to put keys in public discussions, emails, or support tickets, even when writing to Anthropic. If a tool needs a key, enter it in the tool's own settings field, not in a message. If you've pasted one already, revoke it and create a new one.
Does an API key cost money?
The key is the credential. The charges come from the calls made with it, billed to the account that owns it. Check the vendor's own pricing page for current rates, and set a spending limit where one is offered.
Where do I find my Anthropic API key?
In the Claude Console under Settings → API keys, per Anthropic's authentication docs. A Claude chat subscription alone doesn't include Console or API access.
How many API keys should I have?
One per app or purpose. If a tool leaks its key or you stop using it, you revoke that one key and nothing else breaks.