Smart API Connector v3.0
Install: INLINECODE0
REST API integration using built-in tools. No code, no curl, no dependencies.
Language
Detect from user's message language. Default: English.
Quick Start
User provides: API URL + what they want. Agent handles everything.
User: "Hent brukerinfo fra https://api.example.com/v1/users/123"
Agent runs: web_fetch https://api.example.com/v1/users/123 (with auth headers if provided)
Returns parsed response.
Authentication
API Key in Header
CODEBLOCK0
API Key via Environment Variable
CODEBLOCK1
Session-only Keys
API keys provided in conversation are used in-session only. Never persisted to files.
Error Handling
| HTTP Status | Action |
|---|
| 200-299 | Parse and return response |
| 429 |
Rate limited — wait and retry (max 3 retries) |
| 400 | Bad request — show error, suggest fix |
| 401/403 | Auth failed — check key, permissions |
| 404 | Not found — verify URL |
| 5xx | Server error — retry once, then report |
HTTP Methods
| Method | Use Case |
|---|
| GET | Fetch data |
| POST |
Create data / send JSON body |
| PUT | Update data |
| DELETE | Remove data |
For POST/PUT: prompt user for JSON body if not provided.
Response Parsing
Always extract and present the useful parts. For JSON APIs:
CODEBLOCK2
Security
- - Keys are session-only — never written to files
- Prefer environment variables over command-line args
- Scoped/test keys over production secrets
- Show user the exact request before executing (URL + method + headers, not the key value)
Quick Commands
| User says | Action |
|---|
| "query {url}" | GET request |
| "POST to {url}" |
POST with body |
| "test API {url}" | Request + show response |
| "API health check" | GET and report status |
Guidelines for Agent
- 1. Use webfetch first — built-in, no dependencies
- Fall back to exec/curl only if webfetch can't handle the request
- Never persist API keys — session only
- Show request before executing — confirm with user for POST/PUT/DELETE
- Parse responses — extract useful data, don't dump raw JSON
- Handle errors gracefully — retry on 429, explain 401/403
- Match user language in responses
What This Skill Does NOT Do
- - Does NOT persist API keys or credentials
- Does NOT require npm packages or external tools
- Does NOT modify any local files
- Does NOT make requests without user knowledge (for POST/PUT/DELETE)
More by TommoT2
- - workflow-builder-lite — Build and execute multi-step workflows
- context-brief — Persistent context survival across sessions
- setup-doctor — Diagnose and fix OpenClaw setup issues
Install the full suite:
CODEBLOCK3
Smart API Connector v3.0
安装: clawhub install smart-api-connector
使用内置工具进行REST API集成。无需代码,无需curl,无需依赖。
语言
根据用户消息语言自动检测。默认:英语。
快速开始
用户提供:API URL + 所需操作。代理处理一切。
用户:从 https://api.example.com/v1/users/123 获取用户信息
代理执行:web_fetch https://api.example.com/v1/users/123(如果提供了认证头信息则包含)
返回解析后的响应。
认证
API密钥放在请求头中
web_fetch url --headers {Authorization: Bearer KEY, X-API-Key: KEY}
通过环境变量设置API密钥
exec: APIKEY=yourkey curl -s -H Authorization: Bearer $API_KEY https://...
仅会话内有效的密钥
对话中提供的API密钥仅在当前会话中使用。从不持久化到文件。
错误处理
| HTTP状态码 | 操作 |
|---|
| 200-299 | 解析并返回响应 |
| 429 |
请求频率受限 — 等待后重试(最多重试3次) |
| 400 | 错误请求 — 显示错误,建议修复 |
| 401/403 | 认证失败 — 检查密钥和权限 |
| 404 | 未找到 — 验证URL |
| 5xx | 服务器错误 — 重试一次,然后报告 |
HTTP方法
创建数据 / 发送JSON请求体 |
| PUT | 更新数据 |
| DELETE | 删除数据 |
对于POST/PUT:如果未提供JSON请求体,则提示用户输入。
响应解析
始终提取并展示有用的部分。对于JSON API:
响应:
姓名:John
邮箱:john@example.com
创建时间:2026-03-28
原始数据:{如果用户需要详情,显示前200个字符}
安全
- - 密钥仅在会话内有效 — 从不写入文件
- 优先使用环境变量而非命令行参数
- 使用范围限定/测试密钥而非生产密钥
- 在执行前向用户展示确切的请求(URL + 方法 + 请求头,不显示密钥值)
快捷命令
| 用户输入 | 操作 |
|---|
| 查询 {url} | GET请求 |
| POST到 {url} |
带请求体的POST请求 |
| 测试API {url} | 发送请求并显示响应 |
| API健康检查 | 发送GET请求并报告状态 |
代理指南
- 1. 优先使用webfetch — 内置,无依赖
- 仅在webfetch无法处理请求时回退到exec/curl
- 绝不持久化API密钥 — 仅会话内有效
- 执行前展示请求 — 对于POST/PUT/DELETE需与用户确认
- 解析响应 — 提取有用数据,不直接输出原始JSON
- 优雅处理错误 — 429时重试,解释401/403
- 响应时匹配用户语言
此技能不做的事情
- - 不持久化API密钥或凭据
- 不需要npm包或外部工具
- 不修改任何本地文件
- 不在用户不知情的情况下发送请求(对于POST/PUT/DELETE)
TommoT2的更多作品
- - workflow-builder-lite — 构建和执行多步骤工作流
- context-brief — 跨会话持久化上下文
- setup-doctor — 诊断和修复OpenClaw设置问题
安装完整套件:
bash
clawhub install smart-api-connector workflow-builder-lite context-brief setup-doctor