API Key Setup Guide

Learn how to run with direct provider keys, OpenRouter, or platform-managed keys

Overview

Clawonix supports three key modes for OpenClaw:

  • Platform key mode - no personal key required, usage is charged from your AI credits
  • Direct provider key mode - add your Anthropic / OpenAI / Google AI keys
  • OpenRouter mode - add your OpenRouter key and run supported models through OpenRouter

You can switch modes any time from Dashboard → API Keys.

Which Key Is Needed for Each Model?

  • Claude models → Anthropic direct key, OpenRouter key, or platform key mode
  • GPT models → OpenAI direct key, OpenRouter key, or platform key mode
  • Gemini 3 Flash → Google AI direct key, OpenRouter key, or platform key mode

Obtaining Anthropic API Keys

Step 1: Create an Anthropic Account

Visit console.anthropic.com and sign up for an account. You'll need to verify your email and add billing information (Anthropic charges per token usage).

Step 2: Generate an API Key

  1. From the Anthropic console, navigate to "API Keys" in the left sidebar
  2. Click "Create Key"
  3. Give your key a descriptive name (e.g., "Clawonix Production")
  4. Copy the key immediately - it will only be shown once

Warning: Store your API key securely. Never commit it to version control or share it publicly.

Step 3: Add to Clawonix Dashboard

  1. Go to your Clawonix dashboard
  2. Find the "API Keys" section or "Settings" area
  3. Paste your Anthropic API key in the "Anthropic API Key" field
  4. Click "Save" or "Update Keys"
  5. If you already have an instance running, restart it for the changes to take effect

Obtaining OpenAI API Keys

Step 1: Create an OpenAI Account

Visit platform.openai.com and sign up for an account. You'll need to add a payment method to use the API (OpenAI charges per token usage).

Step 2: Navigate to API Keys

From the OpenAI platform dashboard, click your profile icon in the top right, then select "View API Keys" or navigate directly to the API keys section.

Step 3: Generate and Copy Key

  1. Click "Create new secret key"
  2. Give your key a name (e.g., "Clawonix")
  3. Copy the key immediately - it will only be shown once
  4. Store it securely

Step 4: Add to Clawonix Dashboard

  1. Go to your Clawonix dashboard
  2. Find the "API Keys" section or "Settings" area
  3. Paste your OpenAI API key in the "OpenAI API Key" field
  4. Click "Save" or "Update Keys"
  5. If you already have an instance running, restart it for the changes to take effect

Obtaining Google AI (Gemini) API Key

Visit Google AI Studio and generate an API key for Gemini usage.

  1. Create/select your project in AI Studio
  2. Generate key and copy it immediately
  3. Add it in Dashboard → API Keys as your Google AI key
  4. Restart instance after updating keys

OpenRouter Key Setup

If you prefer a single key for multiple providers, use OpenRouter.

  1. Create an account at openrouter.ai
  2. Create an API key in the OpenRouter dashboard
  3. Paste key in Dashboard → API Keys under OpenRouter
  4. Select OpenRouter as key source when deploying or updating your instance

Platform Key Mode

Some workspaces allow deploy without personal keys. In this mode, requests run through platform-managed keys and usage is deducted from your AI credits.

If your credits reach zero, AI calls stop until your credits are refreshed (subscription cycle) or topped up.

Security Best Practices

  • Encryption at rest - Clawonix encrypts your API keys in our database using industry-standard encryption
  • Isolated access - Your API keys are only accessible to your instance container, never to other users or instances
  • Never share keys - Treat API keys like passwords. Don't share them via email, chat, or public channels
  • Rotate regularly - We recommend rotating your API keys every 90 days
  • Monitor usage - Check your provider dashboards (Anthropic/OpenAI/Google AI/OpenRouter) regularly
  • No version control - Never commit API keys to Git, GitHub, or any version control system

If you believe your API key has been compromised, revoke it immediately in your provider's console and generate a new one.

Model Selection

If model selection is enabled, you can choose which AI model your instance uses from the AI Models page in your dashboard. Your selected model is configured automatically in your instance.

Changing your model requires an active subscription. The model you select determines which key path is used (direct provider, OpenRouter, or platform key mode).

Updating API Keys

You can update your API keys anytime from your Clawonix dashboard:

  1. Go to your dashboard
  2. Navigate to the Settings or API Keys section
  3. Update the key field(s) with your new API key(s)
  4. Click "Save" or "Update Keys"
  5. Restart your instance for changes to take effect

You do not need to redeploy your instance to update API keys. Saving new keys will automatically restart your container with the updated configuration.

Troubleshooting

"Invalid API Key" Error

  • Check for extra spaces or characters when copying the key
  • Verify the key hasn't been revoked in your provider's console
  • Ensure your provider account has billing set up and sufficient credits
  • Try generating a new key and updating it in Clawonix
  • Restart your instance after updating keys

Models Not Appearing in OpenClaw

  • Confirm matching key path is configured (direct provider / OpenRouter / platform mode)
  • Restart your instance after adding new keys
  • Check that the API key has access to the models you expect

Need More Help?

Contact our support team if you're still experiencing issues with API key configuration.