Articles on: VPS Hosting

How to Configure AI Providers in OpenClaw

This guide explains how to configure an AI provider in OpenClaw. Once configured, your agent will be powered by the latest language models to handle conversations, tasks, and integrations.


Available AI Providers


OpenClaw supports multiple leading AI providers. For each provider, except Ollama Cloud, you will need to obtain an API key from the provider's website. You can choose the one that best fits your needs:


No.

Provider

Description

1

Anthropic (Claude)

Advanced reasoning and safety-focused models, ideal for complex tasks.

2

OpenAI

GPT-4 and GPT-3.5 models, versatile for general-purpose AI interactions.

3

OpenRouter

A unified API giving access to multiple models (Claude, GPT, Llama, and more).

4

Google (Gemini)

Google's multimodal models, excellent for understanding text, images, and more.

5

Kimi (Moonshot AI)

A powerful model optimized for long-context understanding.

6

MiniMax

Known for strong performance in conversational AI and text generation.

7

Mistral

Efficient, open-weight models with great performance-to-cost ratio.

8

Ollama Cloud [free]

Run open-source models (like Llama, Mistral) in the cloud. Completely free API keys are available, perfect as a fallback option.


πŸ’‘ If you would like to configure Ollama as your AI provider, you may refer to the guideline How to Setup Ollama in OpenClaw (Free AI Model).


How to Set Up an AI Provider


Follow these steps to configure your chosen AI provider via SSH.


Prerequisites


  • An active OpenClaw VPS
  • SSH access to your VPS (see the Essential Command Guide)
  • Your API key ready (if using a paid provider)


  1. Run setup command: setup-ai.


  1. When prompted, choose your AI provider by entering the corresponding number from the displayed list of options (1–8). You can select number 4 for Google (Gemini).


πŸ’‘ This guideline uses Google (Gemini) as an example. The same steps apply to other providers like Anthropic (Claude), OpenAi, or OpenRouter. Just select the corresponding number when prompted.


  1. Paste your Google (Gemini) API key when prompted. It will be stored securely in /opt/openclaw/.env.


  1. You will be prompted to decide whether to set selected model as primary or to designate it as a fallback.
  • Primary: The main model your agent will use by default.
  • Fallback: The model your agent will use if the primary is unavailable.


  1. Once the configuration is complete, the OpenClaw service will automatically restart.


Verifying Your Configuration


After the restart, you can verify the setup:


  1. Test your agent by sending a message to your agent; if you set the model as primary, you will see the agent using that model.


  1. Check the configuration file to view your configured provider and models.


cat /opt/openclaw/data/.openclaw/openclaw.json



Important Notes


  • API Keys - Your API keys (for paid providers) are stored securely in /opt/openclaw/.env. You can edit this file manually if needed, but using setup-ai is recommended to avoid errors. If you do edit manually, you must restart the service for changes to take effect: openclaw-restart.
  • Provider not listed? - Run openclaw-update first to get the latest provider list.
  • Rate limits - Depends on your OpenAI tier. Free trial keys have lower limits.


Need Further Assistance?


If you face any issues or need assistance, don’t hesitate to reach out β€” our support team is always ready to help!


πŸ”§ Need help? Submit a Support Ticket

πŸ’¬ Chat with us on Live Chat via our website

Updated on: 20/04/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!