OpenClaw
Konfiguration6 Min. Lesezeit

OpenClaw Konfigurationsvorlage: Eine 'sichere und nutzbare' Baseline

Minimale Konfigurationsbeispiele für Model/Gateway/Channel/Skills mit sicheren Standardwerten und kopierfertigen Snippets.

O

OpenClaw Guides

Tutorial Authors

Minimale Konfiguration

Hier ist eine verifizierte minimale Konfigurationsvorlage mit sicheren Standardwerten:

json
// ~/.openclaw/openclaw.json
{
  "model": {
    "provider": "anthropic",
    "default": "claude-3-5-sonnet",
    "apiKey": "${ANTHROPIC_API_KEY}"
  },
  "gateway": {
    "port": 18789,
    "host": "127.0.0.1"
  },
  "channels": [
    { "type": "whatsapp", "enabled": false },
    { "type": "telegram", "enabled": false },
    { "type": "discord", "enabled": false }
  ],
  "security": {
    "rateLimiting": {
      "enabled": true,
      "maxRequests": 100,
      "windowMs": 60000
    }
  }
}

Erklärung der Konfigurationsabschnitte

Modellkonfiguration

json
{
  "model": {
    "provider": "anthropic",
    "default": "claude-3-5-sonnet",
    "apiKey": "${ANTHROPIC_API_KEY}"
  }
}

Verfügbare Modelle:

  • claude-3-5-haiku - Schnell, kosteneffektiv ($0,25/1M Eingabe, $1,25/1M Ausgabe)
  • claude-3-5-sonnet - Ausgewogene Leistung ($3/1M Eingabe, $15/1M Ausgabe)
  • claude-sonnet-4 - Neueste Generation, beste Qualität ($3/1M Eingabe, $15/1M Ausgabe)

Gateway-Konfiguration

json
{
  "gateway": {
    "port": 18789,
    "host": "127.0.0.1",
    "timeout": 30000
  }
}

Sicherheitshinweis: Setzen Sie host niemals auf 0.0.0.0, es sei denn, Sie haben entsprechende Firewall-Regeln eingerichtet.

Kanalkonfiguration

Jeder Kanal kann unabhängig konfiguriert werden:

json
{
  "channels": [
    {
      "type": "whatsapp",
      "enabled": true,
      "sessionPath": "~/.openclaw/whatsapp-session"
    },
    {
      "type": "telegram",
      "enabled": true,
      "botToken": "${TELEGRAM_BOT_TOKEN}"
    },
    {
      "type": "discord",
      "enabled": true,
      "botToken": "${DISCORD_BOT_TOKEN}",
      "intents": ["GUILDS", "GUILD_MESSAGES", "MESSAGE_CONTENT"]
    }
  ]
}

Sicherheitskonfiguration

json
{
  "security": {
    "rateLimiting": {
      "enabled": true,
      "maxRequests": 100,
      "windowMs": 60000
    },
    "quotas": {
      "daily": {
        "enabled": true,
        "maxTokens": 100000
      }
    }
  }
}

Umgebungsvariablen

Erstellen Sie eine .env-Datei in Ihrem OpenClaw-Verzeichnis:

bash
# ~/.openclaw/.env
ANTHROPIC_API_KEY=sk-ant-xxxxx
TELEGRAM_BOT_TOKEN=123456:ABC-xxxxx
DISCORD_BOT_TOKEN=xxxxx.xxxxx.xxxxx

Validierung

Validieren Sie Ihre Konfiguration:

bash
openclaw config validate

Dies überprüft:

  • Erforderliche Felder
  • Gültige API-Keys
  • Korrekte Formatierung

Nächste Schritte