Skip to content

Instantly share code, notes, and snippets.

@Pyr0zen
Last active March 3, 2026 21:56
Show Gist options
  • Select an option

  • Save Pyr0zen/1afdfc49cbcf8e133c32f517931d0ea2 to your computer and use it in GitHub Desktop.

Select an option

Save Pyr0zen/1afdfc49cbcf8e133c32f517931d0ea2 to your computer and use it in GitHub Desktop.

How to Change Your ZeroClaw LLM Provider & API Key

The default config uses OpenRouter with anthropic/claude-sonnet-4.5. Here's how to change it.


Before You Start

If you're running ZeroClaw on your main PC, I'd strongly suggest moving it to a VPS. Anything ZeroClaw can do on your PC, it will do on your PC, which is extremely risky if you have personal info on it.

A VPS is essentially just a fresh virtual PC. That way you're not risking any of your personal data and the VPS runs 24/7 so you'll have access to the bot whenever you want. It's also much cheaper than spending hundreds of dollars on a dedicated device like a Mac Mini.

The VPS provider that I use is Hostinger because it's the simplest one to set up and also one of the cheapest. If you use the link below you will get an extra 20% off.

๐Ÿ‘‰ https://www.hostinger.com/self-hosted-n8n?REFERRALCODE=HOWTO20

Coupon code: HOWTO20


Step 1: Stop ZeroClaw

If the daemon is running, press Ctrl+C to stop it.


Step 2: Change the Provider

Replace gemini below with the provider you want to use.

sed -i 's|^default_provider = .*|default_provider = "gemini"|' ~/.zeroclaw/config.toml

This finds the default_provider line in your config file and replaces it. No output means it worked.

Supported providers:

Provider Config name Get API key at
OpenRouter openrouter openrouter.ai
Anthropic anthropic console.anthropic.com
OpenAI openai platform.openai.com
Google Gemini gemini aistudio.google.com
Ollama (local) ollama No key needed
Groq groq console.groq.com
Mistral mistral console.mistral.ai
DeepSeek deepseek platform.deepseek.com
xAI xai console.x.ai
Venice venice venice.ai

Step 3: Change the Model

Replace gemini-2.0-flash-exp below with the model you want to use.

sed -i 's|^default_model = .*|default_model = "gemini-2.0-flash-exp"|' ~/.zeroclaw/config.toml

The model name format depends on your provider:

Provider Example model
OpenRouter anthropic/claude-sonnet-4.5
Anthropic claude-sonnet-4-20250514
OpenAI gpt-4o
Gemini gemini-2.0-flash-exp
Ollama glm4:9b (whatever shows in ollama list)
Groq llama-3.3-70b-versatile
DeepSeek deepseek-chat

Step 4: Set the API Key

Replace YOUR_API_KEY below with your actual API key from the provider you chose in Step 2.

sed -i '/^api_key/d' ~/.zeroclaw/config.toml
sed -i '1i api_key = "YOUR_API_KEY"' ~/.zeroclaw/config.toml

First command deletes any existing api_key line. Second command adds your new one at the top of the file.

If using Ollama (local), skip this step. No API key needed.


Step 5: Verify the Changes

head -3 ~/.zeroclaw/config.toml

You should see your new api_key, default_provider, and default_model values.


Step 6: Restart the Daemon

zeroclaw daemon

Need a VPS?

If you don't have one yet, I use Hostinger for all my setups. Takes under a minute to get a clean Ubuntu server running. Use the link below for an extra 20% off.

๐Ÿ‘‰ https://www.hostinger.com/self-hosted-n8n?REFERRALCODE=HOWTO20

Coupon code: HOWTO20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment