Environment Setup ✅ Beginner

AI Model API Key Guide: OpenAI, Anthropic, Google, OpenRouter — All in One Place

Step-by-step guide to applying for AI model API Keys. No matter which provider you choose, follow along and get the key that powers OpenClaw.

📝 建立:2026年2月25日 ✅ 最後驗證:2026年2月25日
鴨編 卡住很正常——點段落旁的 😵 卡關 讓我們知道,或直接往下滾到問答區發問。 也可以用 👍 看懂 / 😢 看不懂 告訴我們哪裡寫得好、哪裡要改。

What’s This Article About?

This LaunchDock tutorial walks you through getting your API Key as quickly as possible so OpenClaw can connect to AI.

In the previous step, you chose your LLM plan. Now it’s time to get the key (API Key) that lets OpenClaw call AI models.

The entire process takes about 3–10 minutes, depending on which plan you chose.

Duck Editor You only need to pick one. You can always add other providers later.


🚨 Important Concept: An API Key Is Like a Password

An API Key is like the key to your home. Whoever has it can call AI using your account — and spend your money.

Three basic rules:

  1. Don’t screenshot and share your Key
  2. Don’t post it anywhere public (GitHub, forums, chat rooms)
  3. If it leaks, revoke it immediately and create a new one

Duck Editor In other words: An API Key is your front door key. You wouldn’t post a photo of your key on Instagram, right? Same logic — if a Key leaks, it’s like leaving your door wide open for anyone to come in and charge your credit card.


The simplest option — done in 3 minutes, no credit card needed.

Step 1: Go to Google AI Studio

  1. Open your browser and go to Google AI Studio (search “Google AI Studio”)
  2. Sign in with your Google account

Google AI Studio homepage

Step 2: Get Your API Key

  1. After signing in, find “Get API key” in the left sidebar
  2. Click “Create API key

Click Get API key

  1. Select a Google Cloud project (if you don’t have one, it will create one for you automatically)
  2. Click “Create API key in new project

Create API Key

  1. Your Key will appear on screen in this format:
AIzaSyxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  1. Copy this Key and store it somewhere safe (e.g., a password manager or a private note)

API Key created successfully

Step 3: Verify the Key Works

On the Google AI Studio page, you can test it directly:

  1. Go back to the main page
  2. Type “Hello” in the chat box
  3. If the AI responds, your account is working and the Key is valid

Testing in Google AI Studio

Done! You’ve got your Gemini API Key. Jump to Next step: Install OpenClaw.

🚨 Common Issues

Q: It says “Google AI Studio is not available in your region”?

Some regions may have restrictions. Solutions:

  • Check your Google account’s region settings
  • Try using a different Google account

Q: Is this the same as a Google Cloud Console API Key?

No! These are two completely different things:

Google AI StudioGoogle Cloud Console
PurposeCall Gemini AI modelsConnect Google Drive / Gmail
Key formatAIzaSy...OAuth Client ID + Secret
CostGenerous free tierRequires a billing account
TutorialThis articleGoogle API Key Guide

Option B: OpenRouter

One Key to access dozens of models.

Step 1: Create an Account

  1. Go to the OpenRouter website
  2. Click “Sign Up
  3. You can sign up directly with your Google account

OpenRouter signup page

Step 2: Get Your API Key

  1. After signing in, click your avatar in the top right → “Keys
  2. Click “Create Key
  3. Enter openclaw as the name (or whatever you like)
  4. Click “Create

Create OpenRouter API Key

  1. The Key will appear once, in this format:
sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  1. Copy it immediately! You won’t be able to see the full Key after closing this dialog

Copy API Key

Step 3: Add Credits (Optional)

  • The free credit can be used for testing first
  • Need more credit: Click “Credit” → Choose an amount → Pay

Done! Jump to Next step: Install OpenClaw.


Option C: OpenAI API

Step 1: Create an OpenAI Platform Account

  1. Go to OpenAI Platform (search “OpenAI API”)
  2. Click “Sign up” to create an account (or sign in with your existing ChatGPT account)

OpenAI Platform signup

⚠️ Note: The API and ChatGPT Plus are billed separately. Having ChatGPT Plus doesn’t mean you have API credits — you need to add funds separately.

Step 2: Add Funds

  1. After signing in, go to “Settings” → “Billing
  2. Click “Add payment method” to add a credit card
  3. Add at least $5 USD

OpenAI billing page

  1. Strongly recommended: Set a spending limit: In Billing → Usage limits → Set a Hard cap (e.g., $10/month)

Set spending limit

Step 3: Create an API Key

  1. Go to the “API keys” page
  2. Click “Create new secret key
  3. Enter openclaw as the name
  4. Click “Create secret key

Create OpenAI API Key

  1. The Key format looks like this:
sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  1. Copy it immediately! This Key is only shown once

Copy API Key

Done! Jump to Next step: Install OpenClaw.

🚨 Common Issues

Q: I forgot to copy the Key after creating it?

No worries — just create a new one. You can delete the old one.

Q: My credit card was declined?

OpenAI doesn’t accept some prepaid cards and virtual cards. Try a regular credit card or debit card.


Option D: Anthropic API

Step 1: Create an Account

  1. Go to Anthropic Console (search “Anthropic Console”)
  2. Click “Sign Up
  3. Register with email and complete verification

Anthropic Console signup

Step 2: Get Your Free Credit

  • New accounts receive $5 USD free credit
  • No credit card required to use it

Step 3: Create an API Key

  1. After signing in, go to the “API Keys” page
  2. Click “Create Key
  3. Enter openclaw as the name
  4. Click “Create Key

Create Anthropic API Key

  1. The Key format looks like this:
sk-ant-api03-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  1. Copy it immediately!

Copy API Key

Done! Jump to Next step: Install OpenClaw.


Got Your Key — What’s Next?

You now have an API Key in hand. Store it securely — you’ll need it during the OpenClaw setup wizard after installation.

Next step: Install OpenClaw → Choose your operating system

👉 Install OpenClaw


這篇文章對你有幫助嗎?

💬 問答區

卡關了?直接在這裡問,其他讀者和作者都能幫忙解答。

載入中...