OpenClaw's power comes from connecting to the world's best AI models. But if you've never set up an API account before, the process might seem intimidating. It's actually quite straightforward. Here's exactly how it works.
What Is an API Key?
An API key is simply a unique code that identifies your account with an AI provider. Think of it like a password that lets OpenClaw access the AI service on your behalf.
When you send a message to your OpenClaw assistant, the software sends your prompt to the AI provider using your API key. The provider processes it, sends back a response, and charges your account based on usage.
Setting Up Anthropic (Claude)
Claude is our recommended primary model for business use. Here's how to set it up:
- Go to console.anthropic.com and create an account
- Add a payment method (credit card or debit card)
- Navigate to the API Keys section
- Click "Create Key" and give it a name (e.g., "OpenClaw")
- Copy the key (you'll only see it once)
- Paste it into your OpenClaw configuration
Pricing: Pay-per-use. Claude Haiku costs fractions of a cent per message. Claude Sonnet costs a few cents for complex responses. Most businesses spend $10-30/month.
Tip: Set a monthly spending limit in the Anthropic console to avoid surprises. $50-100 is a sensible starting limit.
Setting Up OpenAI (GPT-4)
GPT-4 is a great secondary model and excellent for creative tasks:
- Go to platform.openai.com and create an account
- Add a payment method
- Navigate to API Keys in your account settings
- Create a new secret key
- Copy and paste it into OpenClaw
Pricing: Similar to Claude. GPT-4o mini is very affordable for basic tasks. GPT-4o is moderately priced for high-quality output.
Setting Up Google (Gemini)
Gemini is excellent for research-heavy tasks and offers competitive pricing:
- Go to aistudio.google.com
- Sign in with your Google account
- Click "Get API Key" and create a new key
- Copy and paste it into OpenClaw
Pricing: Google offers a generous free tier, and paid usage is competitively priced. Good option for high-volume research tasks.
How OpenClaw Uses Multiple Providers
Once you've connected multiple providers, OpenClaw can use them intelligently:
- Primary model: Handles most conversations (typically Claude Sonnet)
- Fallback model: Takes over if the primary provider has an outage (typically GPT-4o)
- Specialist models: Specific agents can use specific models (e.g., research agent uses Gemini)
This means your assistant keeps working even if one provider goes down, because it automatically switches to another.
Security Considerations
Your API keys are sensitive, so treat them like passwords:
- Never share them publicly: don't post them in forums, emails, or documents
- Store them securely: OpenClaw stores them encrypted in its configuration
- Set spending limits: all providers allow you to cap monthly spending
- Rotate periodically: create new keys and delete old ones every few months
What If I Only Want One Provider?
That's perfectly fine. Many users start with just Anthropic Claude and add others later if needed. A single provider is simpler to manage, and Claude handles the vast majority of business tasks excellently.
The benefit of multiple providers becomes clear when you want specialised performance (e.g., Gemini for research) or want redundancy (backup model if your primary goes down).
Common Questions
Do the providers store my data? AI providers process your prompts to generate responses but have policies limiting data retention. Check each provider's current data policy for specifics.
Can I see what I'm spending? Yes. All providers have dashboards showing real-time usage and costs. You can check daily, weekly, or monthly spending at any time.
What if I exceed my spending limit? The provider will stop processing requests until the next billing cycle or until you increase your limit. Your OpenClaw assistant will use a fallback model if configured, or let you know it can't process the request.
Book a free discovery call and we'll set up all your API accounts as part of the engagement.