Tutorials OpenClaw

API Key Setup: Configuring AI Models for OpenClaw

How to get an API key from Anthropic, OpenAI, Google or DeepSeek and configure it in OpenClaw.

E
Eric Founder, Roamer Tech · · 7 min read

Want to start now? Deploy your OpenClaw in 60 seconds

AI Agent — your virtual digital employee. From NT$599/mo.

Subscribe to OpenClaw

The 30-second version

ItemDetail
Who needs their own keyPro users (the monthly fee does not include model usage); Advanced uses Roamer AI by default — add a key only if you want your own model
Where to sign upProviders such as OpenAI and Anthropic
How billing worksBy usage, paid directly to the provider
Where it is storedYour isolated container, encrypted with AES-256
Most common sticking pointWhitespace picked up while copying

Introduction

OpenClaw is an AI agent framework; it does not include an AI model of its own. On Pro, you need your own LLM provider API key for the agent to work. Advanced comes with Roamer AI connected by default, so it works without a key (usage counts toward your Roamer AI daily allowance); follow this guide when you want to switch to your own model. This article walks through getting a key from each provider and setting it up.

Supported AI models

ProviderRecommended modelsGet an API key
AnthropicClaude Opus 4 / Sonnet 4console.anthropic.com
OpenAIGPT-4o / o3platform.openai.com
GoogleGemini 2.5 Proaistudio.google.com
DeepSeekDeepSeek V3platform.deepseek.com

How to set the API key

  1. In the RoamerHost dashboard, click “My Instances” → pick the instance → click “Open Dashboard”
  2. Once you are in the OpenClaw dashboard, click the ⚙️ gear icon (Settings) in the top right
  3. On the settings page, find the “API Keys” or “Provider” section
  4. Pick the AI provider you want to use (Anthropic, for example)
  5. Paste in your API key
  6. Click Save

Another way: you can also reach the settings page through “Settings” in the left-hand menu and configure the API key there.

Common error messages

“No API key found for provider anthropic”

This means you have not set an API key yet. Follow the steps above and try again. If you have just done a format and rebuild, every API key setting is wiped and has to be entered again.

Recommended setup

  • Beginners — start with a single Anthropic Claude key; it is the most reliable for agent tasks
  • Advanced users — configure several API keys at once, and OpenClaw will pick the model best suited to each kind of task
  • On a budget — DeepSeek is the cheapest, and works well for high-volume text processing

A note on security

🔒 Privacy: API keys are stored only inside your own OpenClaw container. The RoamerHost platform cannot view or access them. Every instance is fully isolated.

Related guides

How to handle spending limits in practice

Most providers let you set a usage cap. Set a low one from day one — not to save money, but to contain accidents.

The most common accident is a flow getting stuck in a loop: a tool returns something unexpected, so it retries, then retries again. Every round is another call, and one night can burn through far more than you expected.

With a cap in place, the worst case is the service stopping, which is much easier to deal with than a surprise invoice.

When you switch models

After switching providers or models, the prompts you tuned usually need tuning again. The same wording behaves more differently across models than most people expect.

Keep a copy of the original configuration before you switch, so you have something to compare against if quality drops.

Two bills, kept straight

Hosting feeModel usage
Paid toYour hostThe model provider
How it changesFixedProportional to usage
What drives it upUpgrading your planHow often you use it, how long conversations get

Model costs are tiny while you are testing, but with sustained use they can exceed the monthly fee itself. Check the provider’s usage console once a day for the first two weeks to establish what normal looks like — after that you will recognize abnormal.

Troubleshooting order when setup fails

  1. First confirm the key itself works — test it on the provider’s own platform. Works there but not here means the problem is in the configuration; broken in both places means the problem is the key.
  2. Check for stray whitespace — the most common copy-paste problem; one extra space at either end breaks it
  3. Check your credit — running out is the second most common cause
  4. Check permissions — some providers scope keys, and being able to call model A does not mean you can call model B

FAQ

Q: Do I really have to bring my own?

It depends on the plan. On Pro, yes: the monthly fee covers the hosting environment; the model is another company’s service. It also means you are free to pick whichever provider’s model you want.

On Advanced, no: your lobster answers with Roamer AI by default, and usage counts toward your daily allowance. You can still add your own API key if you want to use your own model.

Q: Is it safe to store my key with you?

It is stored in your own isolated container, encrypted with AES-256. Either way, do not keep your only copy here — put it in your password manager so you are not stuck when you switch instances or rebuild.

Q: Can I configure several providers at once?

Yes. In practice some people set up two, one primary and one as a fallback, so they can switch when a provider has problems or the credit runs out.

Q: Roughly what does it cost?

There is no universal answer; it depends on which model you use, how much content you send each time and how often you use it. Set a low cap and test for a week — that is far more accurate than estimating up front.

Q: What if my key leaks?

Generate a new one in the provider’s console, which invalidates the old one immediately, then come back and update the setting. Regenerating is the only effective fix.

How often to check usage

StageFrequencyWhat to look at
The first two weeksDailyEstablishing what normal looks like
Once things are stableWeeklyAny unusual spikes
After changing settingsThe next dayWhether the new settings blew up the cost

That third row is the easiest to skip: editing prompts, swapping models and adding skills can all change the cost of a single call, and you will not notice until the bill arrives at month end.

Three things to check when picking a provider

  • Whether it has the model you want — model capabilities vary a lot between providers
  • How it prices — most bill by the volume of content processed, so long conversations cost more than short questions
  • Whether there is a free tier — handy for testing, but do not treat it as a long-term plan

We suggest sticking with one provider until you know it well. Wiring up two or three at once looks flexible, but in practice it makes it harder to tell which side a problem is on.

How to do fallbacks in practice

Configuring a second provider as a fallback sounds sensible, but be aware: behavior can differ after you switch.

The more realistic approach is to use one provider as your primary and let the other stand in only when credit runs out or the service goes down, accepting that quality may be uneven during that window.

Want someone to build it for you?

If you would rather not assemble these workflows yourself, or the project is large enough that you want someone planning it with you, Roamer Tech (RoamerHost’s parent company) takes on business process automation and AI agent development work:

Ready to get started with OpenClaw?

60 seconds after you subscribe, OpenClaw is installed for you — an isolated container with hard resource limits you never share, and HTTPS out of the box.

Subscribe to OpenClaw

Billed monthly · no contract · cancel anytime

Hi, I'm Roamer! Tap me anytime with a question and I'll help you out.

Roamer

Roamer - AI assistant

Online
Roamer

Ask me anything, anytime — I'll do my best to help!

Powered by RoamerHost AI