API Key Setup Guide (Google · OpenAI · Anthropic)

Author: AIB Team·Friday, March 6, 2026
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:


Overall steps

① Create an account → ② Add a payment method (optional if you only use Google's free tier) → ③ Create an API key → ④ Set a spending limit → ⑤ Make a test call

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

  1. Go to aistudio.google.com.

  2. Sign in with your Google account.

  3. On your first visit, review the terms and region settings.

Step 3. Create an API key

  1. Click Get API key.

  2. Click Create API key.

  3. Choose an existing project or create a new one.

  4. Your key is created immediately.

  5. 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.

  1. In AI Studio, open Usage & Billing.

  2. Click Set up billing.

  3. Create a Google Cloud billing account.

  4. Add a credit card and confirm.

  5. Link the billing account to your project.

Step 5. Quick test

  1. In AI Studio, open New Chat or Create new prompt.

  2. Ask any question.

  3. 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

  1. Go to platform.openai.com.

  2. Click Sign up.

  3. Sign up with email and password, or use Google/Microsoft/Apple.

  4. Verify your email.

Step 2. Add a payment method (required)

  1. Go to Settings → Billing.

  2. Click Add payment details.

  3. Choose Individual or Company.

  4. Add your credit card.

  5. Select an initial credit amount (minimum $5).

  6. 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

  1. Go to platform.openai.com/api-keys.

  2. Click Create new secret key.

  3. Name the key (for example, my-first-key).

  4. Select a project.

  5. 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.

  1. Go to Settings → Limits.

  2. Set budget alerts and project limits.

Step 5. Quick test

  1. Go to platform.openai.com/playground.

  2. Select a model (for example, gpt-4.1).

  3. Enter a prompt.

  4. 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

  1. Go to console.anthropic.com.

  2. Sign up with email, or log in with Google/SSO.

  3. Verify your email.

  4. 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)

  1. Go to Settings → Plans & Billing.

  2. Choose Pay-as-you-go.

  3. Click Add Payment Method.

  4. Add your credit card and confirm.

  5. Set a spending limit if available.

Step 3. Create an API key

  1. Open API Keys.

  2. Click Create Key.

  3. Name the key (for example, my-claude-key).

  4. 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.

  1. Go to Settings → Plans & Billing.

  2. Enable usage notifications.

  3. Set a monthly spending limit.

Step 5. Quick test

  1. Go to console.anthropic.com/workbench.

  2. Select a model.

  3. Enter a prompt.

  4. Click Run.


🔐 API key safety rules

RuleWhat it means
Never share your keyDo not paste it into GitHub, blog posts, social media, or screenshots.
Set usage limitsAlways configure monthly limits or alerts to prevent unexpected charges.
Rotate keysDelete old keys and create new ones regularly.
Revoke immediately if leakedIf a key is exposed, delete it right away and issue a new one.

💰 Quick comparison

PlatformGoogle (Gemini)OpenAI (ChatGPT)Anthropic (Claude)
Websiteaistudio.google.complatform.openai.comconsole.anthropic.com
Start freeYes (free tier)No (prepaid credits)No (prepaid credits)
BillingPaid usage is usage-based via Cloud Billing (typically postpaid)Prepaid creditsPrepaid credits
Minimum paymentCan 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.