33% OFFLimited Time —OpenClaw AI Bot Hosting

Get Deal

Clawra APISetup Guide

Complete guide to configuring all required API keys for Clawra — Anthropic, xAI, fal.ai, and messaging platforms

Keep Your AI Companion Online 24/7

Don’t Let Clawra Go Offline

Host your OpenClaw AI assistant on Clawra — one-click deployment, auto security updates, and always-available hosting. Starting at $9.99/mo

⚡ 5-Min Setup🔒 Auto Security💬 All Platforms🌙 24/7 Online
Deploy Now

Your AI, always there for you 💕

01 — Overview

API Keys
at a Glance

Clawra requires several API keys to function properly. Some are required for basic functionality, while others enable specific features like selfie generation and video calls.

All API keys should be stored in your .env file or referenced in config.yaml using environment variables for security.

RequiredEssential for core AI functionality — Anthropic Claude and xAI Grok API keys
OptionalEnables additional features — selfie generation and video calls
Free Tier AvailableAnthropic and Daily.co offer free tiers for testing and development

02 — Required API Keys

Core
Intelligence Keys

These APIs are required for Clawra to function

Anthropic API (Claude)

Required

Anthropic's Claude models power Clawra's intelligence and conversation capabilities.

Required forAI conversations, personality responses
ModelsClaude 3.5 Sonnet, Claude 3 Opus
CostPay-per-use, free tier available

How to Get Your API Key

1Visit console.anthropic.com
2Sign up or log in to your account
3Navigate to API Keys section
4Create a new API key
5Copy the key (format: sk-ant-...)

Configuration

# .env file
ANTHROPIC_API_KEY=sk-ant-your-key-here
Get Anthropic API Key →

xAI API (Grok)

Required

xAI's Grok models provide an alternative AI backend for Clawra conversations.

Required forAlternative AI conversations
ModelsGrok Beta
CostPay-per-use

How to Get Your API Key

1Visit x.ai/api
2Sign up for xAI API access
3Create an API key in the dashboard
4Copy your API key

Configuration

# .env file
XAI_API_KEY=your-xai-key-here
Get xAI API Key →

03 — Optional API Keys

Enhanced
Feature Keys

Enhance Clawra with additional features using these optional APIs

fal.ai API (Selfie Generation)

Optional

fal.ai provides access to xAI Grok Imagine for generating consistent Clawra selfies.

Required forSelfie generation feature
ModelFlux Realism via xAI Grok Imagine
CostPay-per-use

How to Get Your API Key

1Visit fal.ai
2Sign up for a fal.ai account
3Navigate to API Keys in dashboard
4Generate a new API key

Configuration

# .env file
FAL_AI_KEY=your-fal-ai-key-here
Learn About Selfie Generation →

Video Provider API (Video Calls)

Optional

Third-party video call providers enable real-time video conversations with Clawra.

Required forVideo call feature
ProvidersDaily (daily.co), Agora (agora.io), TokBox (tokbox.com)
CostVaries by provider

How to Get Your API Key

1Choose a video provider: Daily, Agora, or TokBox
2Create an account at your chosen provider
3Generate an API key from the provider dashboard
4Set VIDEO_PROVIDER to your chosen provider name (e.g. daily)

Configuration

# .env file
VIDEO_PROVIDER_KEY=your-video-key-here
VIDEO_PROVIDER=daily
Learn About Video Calls →

04 — Messaging Platforms

Connect Your
Platforms

Configure Clawra to work on your preferred messaging platforms

Discord Bot Token

Discord is the most popular platform for Clawra. Setup requires creating a bot application.

Setup Steps

1Go to Discord Developer Portal
2Create a new application
3Go to "Bot" section and click "Add Bot"
4Copy the bot token
5Enable Message Content intent

Configuration

# .env file
DISCORD_BOT_TOKEN=your-discord-token
Discord Developer Portal →

Telegram Bot Token

Telegram offers the simplest setup process through BotFather.

Setup Steps

1Open Telegram and search for @BotFather
2Send /newbot command
3Follow prompts to name your bot
4Copy the API token provided

Configuration

# .env file
TELEGRAM_BOT_TOKEN=your-telegram-token
@BotFather →

WhatsApp Business API

WhatsApp requires Business API access and more complex setup.

Setup Steps

1Apply for WhatsApp Business API access
2Create a Meta app with WhatsApp product
3Add your phone number
4Generate access token

Configuration

# .env file
WHATSAPP_TOKEN=your-whatsapp-token
PHONE_NUMBER_ID=your-phone-id

05 — Environment Setup

Setting Up Your
.env File

Securely store all API keys in environment variables

Create a .env file in your Clawra project root directory. Add all your API keys to this file. The .env file should never be committed to version control.

Example .env File

.env
# AI Provider API Keys
ANTHROPIC_API_KEY=sk-ant-your-anthropic-key
XAI_API_KEY=your-xai-api-key

# External Services
FAL_AI_KEY=your-fal-ai-key
VIDEO_PROVIDER_KEY=your-video-provider-key
VIDEO_PROVIDER=daily

# Messaging Platforms
DISCORD_BOT_TOKEN=your-discord-bot-token
TELEGRAM_BOT_TOKEN=your-telegram-bot-token
WHATSAPP_TOKEN=your-whatsapp-token
PHONE_NUMBER_ID=your-phone-number-id

# Security
SECRET_KEY=your-secret-key
WEBHOOK_SECRET=your-webhook-secret

Security Best Practices

  • ◆Never commit .env file to version control
  • ◆Add .env to your .gitignore file
  • ◆Use different API keys for development and production
  • ◆Rotate API keys regularly
  • ◆Never share API keys publicly

.gitignore Configuration

Ensure your .gitignore file includes:

.gitignore
# Environment variables
.env
.env.local
.env.*.local

# Configuration with secrets
config.yaml

06 — Config YAML

Configuring
config.yaml

Reference environment variables in your configuration file

Instead of hardcoding API keys in config.yaml, reference environment variables. This keeps your configuration file safe to commit to version control.

Example config.yaml

config.yaml
# AI Provider Configuration
ai:
  provider: "anthropic"
  anthropic:
    api_key: "${ANTHROPIC_API_KEY}"
    model: "claude-3-5-sonnet-20241022"
  xai:
    api_key: "${XAI_API_KEY}"
    fallback:
      enabled: true

# Platform Configuration
platforms:
  discord:
    enabled: true
    token: "${DISCORD_BOT_TOKEN}"
  telegram:
    enabled: true
    token: "${TELEGRAM_BOT_TOKEN}"

# Skills Configuration
skills:
  clawra-selfie:
    enabled: true
    api_key: "${FAL_AI_KEY}"
  clawra-video:
    enabled: false
    provider: "${VIDEO_PROVIDER}"
    api_key: "${VIDEO_PROVIDER_KEY}"

07 — Testing & Troubleshooting

Verify Your
Configuration

Verify that all API keys are correctly configured

Test Checklist

.env file exists in project root
All required API keys are present
config.yaml references environment variables
.env is in .gitignore
Start Clawra without errors
AI model responds to messages
Selfie generation works (if enabled)
Platform connections successful

Common API Issues

Invalid API Key

Verify the API key is copied correctly without extra spaces or characters. Check the key format matches the provider's specification.

API Key Not Loading

Ensure the .env file is in the project root directory and environment variables are properly named in config.yaml.

Quota Exceeded

Check your API usage dashboard. Some providers have rate limits or quotas on free tiers.

08 — Cost Management

API Usage
& Costs

Understanding and controlling API usage costs

Cost Monitoring

Monitor your API usage to control costs:

◆Check provider dashboards regularly
◆Set up usage alerts and budgets
◆Review token usage in logs
◆Optimize response length limits

Cost Optimization Tips

Reduce API costs with these strategies:

◆Use efficient models (Sonnet vs Opus)
◆Limit response max_tokens
◆Enable caching where available
◆Use free tiers for development

09 — Next Steps

Continue Your
Setup Journey

Continue your Clawra setup journey

Platform Integration

Learn how to integrate Clawra with Discord, Telegram, WhatsApp, and other messaging platforms.

Learn More →

Usage Guide

Master interacting with Clawra once your APIs are configured and running.

Learn More →