API Key Setup Guide (Google · OpenAI · Anthropic)
An API is simply a way to connect an AI model to your own app, workflow, or service.
It is what you use when you want to try a custom chatbot quickly and affordably, or when you are building your own tools, automations, or products.
In this guide, you will learn how to create API keys for Google (Gemini), OpenAI (ChatGPT), and Anthropic (Claude), and how to store and test them safely.
NOTE
Goal: Create a key → store it safely → run a quick test call.
If the idea of “API” still feels unfamiliar, this primer will help:
list목차expand_more
- Overall steps
- 1. Google Gemini API
- Step 1. Prepare a Google account
- Step 2. Open Google AI Studio
- Step 3. Create an API key
- Step 4. Billing setup (only if you need paid usage)
- Step 5. Quick test
- 2. OpenAI API (ChatGPT)
- Step 1. Create an OpenAI account
- Step 2. Add a payment method (required)
- Step 3. Create an API key
- Step 4. Set usage limits (recommended)
- Step 5. Quick test
- 3. Anthropic API (Claude)
- Step 1. Create an Anthropic Console account
- Step 2. Add a payment method (required)
- Step 3. Create an API key
- Step 4. Set usage limits (recommended)
- Step 5. Quick test
- 🔐 API key safety rules
- 💰 Quick comparison
Overall steps
The high-level flow is the same for all three platforms.
The main differences are the menu names and the screens you click through.
1. Google Gemini API
NOTE
💎 Free tier available
Google offers a free tier for the Gemini API, which makes it easy to test without much cost.
Step 1. Prepare a Google account
-
If you already use Gmail, you can use the same Google account.
-
Otherwise, create one at accounts.google.com.
Step 2. Open Google AI Studio
-
Go to aistudio.google.com.
-
Sign in with your Google account.
-
On your first visit, review the terms and region settings.
Step 3. Create an API key
-
Click Get API key.
-
Click Create API key.
-
Choose an existing project or create a new one.
-
Your key is created immediately.
-
Copy the key and store it somewhere safe.
Step 4. Billing setup (only if you need paid usage)
WARNING
If you plan to stay within the free tier, you can skip this.
Follow these steps only when upgrading to a paid tier.
-
In AI Studio, open Usage & Billing.
-
Click Set up billing.
-
Create a Google Cloud billing account.
-
Add a credit card and confirm.
-
Link the billing account to your project.
Step 5. Quick test
-
In AI Studio, open New Chat or Create new prompt.
-
Ask any question.
-
If you get a response, your key is working.
2. OpenAI API (ChatGPT)
NOTE
💸 Prepaid credits
You typically start by purchasing at least $5 in credits.
A credit card is required.
Step 1. Create an OpenAI account
-
Go to platform.openai.com.
-
Click Sign up.
-
Sign up with email and password, or use Google/Microsoft/Apple.
-
Verify your email.
Step 2. Add a payment method (required)
-
Go to Settings → Billing.
-
Click Add payment details.
-
Choose Individual or Company.
-
Add your credit card.
-
Select an initial credit amount (minimum $5).
-
Confirm purchase.
WARNING
Auto-recharge tip
If you enable auto-recharge, your balance will refill automatically when it drops below a threshold. Set a monthly recharge limit to avoid surprise charges.
Step 3. Create an API key
-
Go to platform.openai.com/api-keys.
-
Click Create new secret key.
-
Name the key (for example,
my-first-key). -
Select a project.
-
Copy the key immediately.
CAUTION
OpenAI keys are typically shown only once when created.
If you do not copy and store it right away, it can be hard to retrieve later, so save it somewhere safe.
Step 4. Set usage limits (recommended)
-
Go to Settings → Limits.
-
Set budget alerts and project limits.
Step 5. Quick test
-
Select a model (for example,
gpt-4.1). -
Enter a prompt.
-
Click Submit.
3. Anthropic API (Claude)
NOTE
💸 Prepaid credits
You typically start from $5. A credit card is required.
Step 1. Create an Anthropic Console account
-
Go to console.anthropic.com.
-
Sign up with email, or log in with Google/SSO.
-
Verify your email.
-
Click Start Building to open the dashboard.
WARNING
claude.ai (chat) and console.anthropic.com (API) are different.
API keys are created in the Console only.
Step 2. Add a payment method (required)
-
Go to Settings → Plans & Billing.
-
Choose Pay-as-you-go.
-
Click Add Payment Method.
-
Add your credit card and confirm.
-
Set a spending limit if available.
Step 3. Create an API key
-
Open API Keys.
-
Click Create Key.
-
Name the key (for example,
my-claude-key). -
Copy and store it safely.
CAUTION
Claude (Anthropic) keys can also be shown only once when created.
If you do not copy and store it right away, it can be hard to retrieve later, so save it somewhere safe.
Step 4. Set usage limits (recommended)
-
Go to Settings → Plans & Billing.
-
Enable usage notifications.
-
Set a monthly spending limit.
Step 5. Quick test
-
Select a model.
-
Enter a prompt.
-
Click Run.
🔐 API key safety rules
| Rule | What it means |
|---|---|
| Never share your key | Do not paste it into GitHub, blog posts, social media, or screenshots. |
| Set usage limits | Always configure monthly limits or alerts to prevent unexpected charges. |
| Rotate keys | Delete old keys and create new ones regularly. |
| Revoke immediately if leaked | If a key is exposed, delete it right away and issue a new one. |
💰 Quick comparison
| Platform | Google (Gemini) | OpenAI (ChatGPT) | Anthropic (Claude) |
|---|---|---|---|
| Website | aistudio.google.com | platform.openai.com | console.anthropic.com |
| Start free | Yes (free tier) | No (prepaid credits) | No (prepaid credits) |
| Billing | Paid usage is usage-based via Cloud Billing (typically postpaid) | Prepaid credits | Prepaid credits |
| Minimum payment | Can start free | $5 | $5 |
| Difficulty | ⭐⭐ Very Easy | ⭐ Easy | ⭐ Easy |
NOTE
💡 Start with Google AI Studio to get the hang of it, then expand to OpenAI or Anthropic when you need it.