API & 開発者ガイド
カスタムスキル、REST API インテグレーション、ウェブフックで ClawBox を拡張しましょう。強力な自動化を構築し、外部サービスと接続できます。
クイックスタート
Terminal
# Connect to your ClawBox via SSH
# Default credentials: user "clawbox", password "clawbox"
ssh clawbox@clawbox.local
# Check API status
curl http://clawbox.local:8080/api/status
# Send a message
curl -X POST http://clawbox.local:8080/api/chat \
-H "Content-Type: application/json" \
-d '{"message": "Hello, ClawBox!"}'REST API
ClawBox はプログラムによる制御のためのローカル REST API を公開しています。
GET
/api/statusClawBox の現在のステータスを確認します。
例:
curl http://clawbox.local:8080/api/statusPOST
/api/chatメッセージを送信してAI応答を受け取ります。
例:
curl -X POST -H "Content-Type: application/json" -d {"message": "Hello"} http://clawbox.local:8080/api/chatGET
/api/skillsインストール済みのすべてのスキルとそのステータスを一覧表示します。
例:
curl http://clawbox.local:8080/api/skillsPUT
/api/configClawBox の設定を更新します。
例:
curl -X PUT -H "Content-Type: application/json" -d {"voice": true} http://clawbox.local:8080/api/configカスタムスキルの構築
スキルは ClawBox の機能を拡張する Python モジュールです。トリガーへの応答、API の呼び出し、外部サービスとの連携が可能です。
スキルの構造
my-skill/
├── manifest.json # Skill metadata
├── handler.py # Main skill logic
├── requirements.txt # Python dependencies
└── README.md # Documentationmanifest.json
{
"name": "weather-skill",
"version": "1.0.0",
"description": "Get weather information",
"triggers": ["weather", "forecast", "temperature"],
"author": "Your Name",
"permissions": ["network"]
}handler.py
from openclaw import Skill, Response
class WeatherSkill(Skill):
def handle(self, message: str, context: dict) -> Response:
# Parse location from message
location = self.extract_location(message)
# Fetch weather data
weather = self.get_weather(location)
return Response(
text=f"Weather in {location}: {weather['temp']}°C",
data=weather
)スキルのインストール
Terminal
# Install a skill from GitHub
openclaw skill install github.com/user/weather-skill
# Install from local directory
openclaw skill install ./my-skill
# List installed skills
openclaw skill list
# Remove a skill
openclaw skill remove weather-skillウェブフック
ClawBox でイベントが発生したときにリアルタイム通知を受け取ります。
利用可能なイベント
🔔
message.received🔔
message.sent🔔
skill.triggered🔔
system.status認証
API リクエストにはベアラートークンによる認証が必要です。CLI を使用してトークンを生成してください。
# Generate API token
openclaw token generate --name "my-app"
# Use token in requests
curl -H "Authorization: Bearer YOUR_TOKEN" \
http://clawbox.local:8080/api/chat