← 返回
未分类 Key 中文

OpenClaw API Control

Control a hosted OpenClaw instance through the OpenClaw as a Service API. Use when the user asks to talk to OpenClaw over API, send a folder or file to OpenC...
通过OpenClaw即服务API控制托管的OpenClaw实例。当用户请求通过API与OpenClaw对话、发送文件夹或文件给OpenClaw时使用。
fstandhartinger fstandhartinger 来源
未分类 clawhub v0.1.1 1 版本 100000 Key: 需要
★ 0
Stars
📥 504
下载
💾 0
安装
1
版本
#latest

概述

OpenClaw API Control

Overview

Use the hosted OpenClaw API instead of the browser UI when an agent should operate an existing OpenClaw instance directly.

Required environment variables:

  • OPENCLAW_API_KEY
  • OPENCLAW_API_BASE_URL

Optional environment variables:

  • OPENCLAW_INSTANCE_ID

Defaults:

  • If OPENCLAW_API_BASE_URL is missing, use https://openclaw-as-a-service.com/api
  • If OPENCLAW_INSTANCE_ID is missing, discover a ready instance automatically

When To Use

  • “Send this folder to my OpenClaw”
  • “Upload these files into the OpenClaw workspace”
  • “Ask my OpenClaw to continue this task”
  • “Run this command on my hosted OpenClaw”
  • “Read /workspace/... from OpenClaw”
  • “Create an OpenClaw instance through the API”

Workflow

  1. Verify OPENCLAW_API_KEY is present.
  2. Use scripts/openclaw_api_client.mjs root or instances list to confirm connectivity.
  3. Resolve the target instance:
    • Prefer OPENCLAW_INSTANCE_ID
    • Otherwise pick the first ready instance from instances list
  4. Choose the right action:
    • Chat: chat send
    • Recent history: chat tail
    • Files or folders: files read, files write, files upload-tree
    • Commands: terminal exec
  5. Report the exact API action and result back to the user.

Commands

Discover API root

node scripts/openclaw_api_client.mjs root

List instances

node scripts/openclaw_api_client.mjs instances list

Create an instance

node scripts/openclaw_api_client.mjs instances create --invite-code YOUR_CODE

Send a chat message

node scripts/openclaw_api_client.mjs chat send --message "Continue the task in /workspace"

Stream a chat message

node scripts/openclaw_api_client.mjs chat send --stream --message "Narrate each step while you work"

Upload a folder into /workspace

node scripts/openclaw_api_client.mjs files upload-tree --src ./my-project --dest /workspace/my-project

Read a file

node scripts/openclaw_api_client.mjs files read --path /workspace/README.md

Run a command

node scripts/openclaw_api_client.mjs terminal exec --command "pwd && ls -la /workspace"

Notes

  • files upload-tree only uploads text-like files and skips likely binary files.
  • chat tail automatically reuses the latest chat session when no session id is supplied.
  • The helper prints JSON for machine-friendly reuse.

Resources

  • scripts/openclaw_api_client.mjs - Minimal Node client for OpenClaw API operations

版本历史

共 1 个版本

  • v0.1.1 当前
    2026-05-03 06:41 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 679 📥 327,876
dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 41,654
dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 195 📥 67,711