Bambuddy Skill
You have full access to the Bambuddy REST API. Use curl to make all requests.
Never invent endpoint paths — use exactly the routes documented below.
Authentication & Base URL
Every request must include the API key header. The base URL comes from the
BAMBUDDY_URL environment variable (no trailing slash).
CODEBLOCK0
Always pipe JSON responses through jq . for readability unless you need raw output.
For binary responses (camera snapshots, thumbnails), omit jq and save to a file.
API Categories & Endpoints
1. System
CODEBLOCK1
2. Auth / Users / Groups
CODEBLOCK2
3. API Keys
CODEBLOCK3
4. Printers
CODEBLOCK4
5. Archives
CODEBLOCK5
6. Print Queue
CODEBLOCK6
7. Projects
CODEBLOCK7
8. Filaments / AMS
CODEBLOCK8
9. K-Profiles (Pressure Advance)
CODEBLOCK9
10. Camera
CODEBLOCK10
11. Settings
CODEBLOCK11
12. Notifications
CODEBLOCK12
13. Smart Plugs
CODEBLOCK13
14. Spoolman Integration
CODEBLOCK14
15. Firmware
CODEBLOCK15
16. Discovery
CODEBLOCK16
17. External Links
CODEBLOCK17
18. Maintenance
CODEBLOCK18
19. Pending Uploads
CODEBLOCK19
20. Updates
CODEBLOCK20
21. Cloud (Bambu Cloud)
CODEBLOCK21
22. Support Bundle
CODEBLOCK22
23. Statistics
CODEBLOCK23
Common Workflows
Check what's printing right now
CODEBLOCK24
Queue a reprint of the most recent archive
CODEBLOCK25
Get filament usage stats for this week
BB_URL="${BAMBUDDY_URL}/api/v1"
BB_AUTH="X-API-Key: ${BAMBUDDY_API_KEY}"
SINCE=$(date -u -d '7 days ago' +%Y-%m-%dT%H:%M:%S 2>/dev/null || \
date -u -v-7d +%Y-%m-%dT%H:%M:%S)
curl -s -H "$BB_AUTH" "$BB_URL/archives/?since=$SINCE" | \
jq '{
total_prints: length,
total_filament_g: [.[].filament_used_g // 0] | add,
total_cost: [.[].cost // 0] | add
}'
Error Handling
Always check for non-2xx responses:
CODEBLOCK27
Common errors:
- - 401 Unauthorized — API key missing or invalid. Check
BAMBUDDY_API_KEY. - 403 Forbidden — Key exists but lacks permission for this action (check key permissions:
can_queue, can_control_printer, can_read_status). - 404 Not Found — Resource doesn't exist. Verify IDs.
- 422 Unprocessable Entity — Invalid request body. Check JSON field names/types.
- 503 Service Unavailable — Bambuddy or the printer is unreachable.
Setup Instructions for User
To use this skill:
- 1. Generate an API key in Bambuddy: go to
Settings → API Keys → Create Key.
Grant the permissions you need (
can_read_status,
can_queue,
can_control_printer).
The key will look like
bb_xxxxxxxxxxxxxxxx.
- 2. Add to your OpenClaw config (
~/.openclaw/openclaw.json):
CODEBLOCK28
- 3. Start a new OpenClaw session — the skill will be active.
Tip: If Bambuddy is on a remote server, use its external URL or
set up a Tailscale/WireGuard VPN. Ensure curl and jq are installed
(brew install curl jq on macOS, apt install curl jq on Debian/Ubuntu).
Bambuddy 技能
您拥有 Bambuddy REST API 的完全访问权限。使用 curl 发起所有请求。
切勿自行发明端点路径——请严格使用下方记录的路径。
认证与基础 URL
每个请求都必须包含 API 密钥标头。基础 URL 来自
BAMBUDDY_URL 环境变量(末尾无斜杠)。
bash
便捷别名 — 每次调用均复用此模式
BB
URL=${BAMBUDDYURL}/api/v1
BB
AUTH=X-API-Key: ${BAMBUDDYAPI_KEY}
GET 示例
curl -s -H $BB
AUTH $BBURL/system/info | jq .
POST 示例
curl -s -X POST -H $BB_AUTH -H Content-Type: application/json \
-d {key:value} $BB_URL/some/endpoint | jq .
PATCH 示例
curl -s -X PATCH -H $BB_AUTH -H Content-Type: application/json \
-d {key:value} $BB_URL/some/endpoint | jq .
DELETE 示例
curl -s -X DELETE -H $BB
AUTH $BBURL/some/endpoint
除非需要原始输出,否则始终通过 jq . 管道处理 JSON 响应以增强可读性。
对于二进制响应(摄像头快照、缩略图),请省略 jq 并保存到文件。
API 分类与端点
1. 系统
bash
系统信息(版本、路径、数据库统计)
curl -s -H $BB
AUTH $BBURL/system/info | jq .
2. 认证 / 用户 / 组
bash
当前用户信息
curl -s -H $BB
AUTH $BBURL/auth/me | jq .
认证状态(是否启用认证)
curl -s -H $BB
AUTH $BBURL/auth/status | jq .
列出用户
curl -s -H $BB
AUTH $BBURL/users | jq .
获取特定用户
curl -s -H $BB
AUTH $BBURL/users/{user_id} | jq .
用户项目计数
curl -s -H $BB
AUTH $BBURL/users/{user_id}/items-count | jq .
列出组
curl -s -H $BB
AUTH $BBURL/groups | jq .
可用权限
curl -s -H $BB
AUTH $BBURL/groups/permissions | jq .
获取特定组
curl -s -H $BB
AUTH $BBURL/groups/{group_id} | jq .
3. API 密钥
bash
列出所有 API 密钥
curl -s -H $BB
AUTH $BBURL/api-keys/ | jq .
创建新 API 密钥
curl -s -X POST -H $BB_AUTH -H Content-Type: application/json \
-d {
name: my-key,
can_queue: true,
can
controlprinter: true,
can
readstatus: true,
printer_ids: null,
expires_at: null
} $BB_URL/api-keys/ | jq .
获取特定 API 密钥
curl -s -H $BB
AUTH $BBURL/api-keys/{key_id} | jq .
更新 API 密钥
curl -s -X PATCH -H $BB_AUTH -H Content-Type: application/json \
-d {name: updated-name, enabled: false} \
$BB
URL/api-keys/{keyid} | jq .
删除 API 密钥
curl -s -X DELETE -H $BB
AUTH $BBURL/api-keys/{key_id}
4. 打印机
bash
列出所有打印机
curl -s -H $BB
AUTH $BBURL/printers/ | jq .
获取特定打印机
curl -s -H $BB
AUTH $BBURL/printers/{printer_id} | jq .
实时状态(温度、进度、阶段、AMS、速度等)
curl -s -H $BB
AUTH $BBURL/printers/{printer_id}/status | jq .
当前打印用户
curl -s -H $BB
AUTH $BBURL/printers/{printer_id}/current-print-user | jq .
打印机封面图片(二进制 PNG — 保存到文件)
curl -s -H $BB
AUTH $BBURL/printers/{printer_id}/cover -o cover.png
打印机 SD/存储中的文件
curl -s -H $BB
AUTH $BBURL/printers/{printer_id}/files | jq .
打印机存储信息
curl -s -H $BB
AUTH $BBURL/printers/{printer_id}/storage | jq .
MQTT 调试日志
curl -s -H $BB
AUTH $BBURL/printers/{printer_id}/logging | jq .
AMS 插槽预设
curl -s -H $BB
AUTH $BBURL/printers/{printer_id}/slot-presets | jq .
特定插槽预设
curl -s -H $BB_AUTH \
$BB
URL/printers/{printerid}/slot-presets/{ams
id}/{slotid} | jq .
打印对象(当前作业平台对象)
curl -s -H $BB
AUTH $BBURL/printers/{printer_id}/print/objects | jq .
运行时调试信息
curl -s -H $BB
AUTH $BBURL/printers/{printer_id}/runtime-debug | jq .
摄像头状态
curl -s -H $BB
AUTH $BBURL/printers/{printer_id}/camera/status | jq .
USB 摄像头
curl -s -H $BB
AUTH $BBURL/printers/usb-cameras | jq .
更新打印机(名称、IP、访问码等)
curl -s -X PATCH -H $BB_AUTH -H Content-Type: application/json \
-d {name: New Name} $BB
URL/printers/{printerid} | jq .
添加打印机
curl -s -X POST -H $BB_AUTH -H Content-Type: application/json \
-d {
name: My X1C,
ip: 192.168.1.100,
access_code: 12345678,
serial: 01S00A000000000
} $BB_URL/printers/ | jq .
删除打印机
curl -s -X DELETE -H $BB
AUTH $BBURL/printers/{printer_id}
打印机控制(暂停、恢复、停止)
curl -s -X POST -H $BB_AUTH -H Content-Type: application/json \
-d {command: pause} $BB
URL/printers/{printerid}/control
命令选项:pause | resume | stop
5. 存档
bash
列出存档(支持筛选/分页)
curl -s -H $BB
AUTH $BBURL/archives/ | jq .
带筛选条件
curl -s -H $BB_AUTH \
$BB
URL/archives/?page=1&pagesize=20&search=benchy&printer_id=1 | jq .
获取特定存档
curl -s -H $BB
AUTH $BBURL/archives/{archive_id} | jq .
存档统计摘要
curl -s -H $BB
AUTH $BBURL/archives/stats | jq .
更新存档元数据
curl -s -X PATCH -H $BB_AUTH -H Content-Type: application/json \
-d {name: Updated Name, rating: 5, notes: Great print} \
$BB
URL/archives/{archiveid} | jq .
删除存档
curl -s -X DELETE -H $BB
AUTH $BBURL/archives/{archive_id}
重新打印存档
curl -s -X POST -H $BB_AUTH -H Content-Type: application/json \
-d {printer
id: 1, amsmapping: []} \
$BB
URL/archives/{archiveid}/reprint | jq .
下载存档 3MF 文件
curl