How do I get an API key for Claude, OpenAI, Stripe or Cloudflare?
Sign in to the provider's dashboard, create a key named after your project on its API keys page, store it in a password manager, and cap the spend.
An API key is a password for programs: it lets your code use a service on your account, and anyone who has it can spend your money. The steps are similar everywhere:
- Claude: create a key in Anthropic's Claude Console. It's shown only once, so copy it straight into your vault.
- OpenAI: create a key in OpenAI's developer dashboard, ideally one per project.
- Stripe: you get a publishable key, which is safe in a web page, and a secret key, which must stay on your server. Use sandbox keys while you build; live keys move real money.
- Cloudflare: on your own computer, sign in with
npx wrangler login instead of copying a key. For automation, create an API token with only the permissions it needs.
Good habits for every key: one key per project and place it runs, a name that says where it's used, an expiry date where offered, and a spending limit for AI providers. Never paste keys into code, chats, screenshots or AI prompts.
Dashboards change often. If a button has moved, look for "API keys" in the settings or search the provider's docs.
Vumbli's Accounts, API Keys & Secrets track walks through each of these step by step, then teaches you to use keys from code without leaking them.
Start with these missions
- What an API key really is (Accounts, API Keys & Secrets)
- Build a secret scanner (Accounts, API Keys & Secrets)
- Get an AI model key the safe way (Accounts, API Keys & Secrets)
Tracks that teach it
More questions, answered by building