Openclaw Api Reference
OpenClaw API 参考 - 完整的 API 文档和示例。适合:开发者、集成场景。
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 0 · 23 · 0 current installs · 0 all-time installs
MIT-0
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
Name and description claim an API reference and the SKILL.md contains only API documentation and examples. There are no required binaries, env vars, or install steps, so requested capabilities align with a docs-only skill.
Instruction Scope
The instructions are purely documentation with curl/HTTP examples against http://localhost:3000. They do include example endpoints that perform state changes (create/delete users, skills, messages, webhooks), so if an agent were to execute those examples against a running server it could mutate data. The doc does not instruct reading system files or environment variables beyond the demonstrated Authorization header examples.
Install Mechanism
No install spec and no code files — lowest-risk instruction-only skill. Nothing is downloaded or written to disk by the skill itself.
Credentials
The skill declares no required environment variables or credentials. Example auth headers (API Key, JWT) are shown only as usage examples and are proportional to an API reference.
Persistence & Privilege
always is false and the skill does not request persistent system presence or to modify other skills' configuration. Normal agent invocation applies.
Assessment
This appears to be a straight API reference for an OpenClaw server running at http://localhost:3000 and is internally consistent. Before installing/use: (1) be aware that the examples include mutating API calls (create/delete) — only allow the agent to invoke these if you intend it to act on a local OpenClaw instance; (2) verify the server URL is correct and not pointed at an external/production server you don't control; (3) never paste real API keys or JWTs into public or untrusted contexts; (4) the skill includes contact details (WeChat/Telegram) — avoid sending sensitive info to those external contacts; (5) if you need provenance, ask the publisher for a homepage or repository to confirm the origin.Like a lobster shell, security has layers — review code before you run it.
Current versionv1.0.0
Download ziplatest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
Runtime requirements
📚 Clawdis
SKILL.md
OpenClaw API 参考
完整的 API 文档和示例。
基础 URL
http://localhost:3000/api/v1
认证
API Key
curl -H "Authorization: Bearer YOUR_API_KEY" \
http://localhost:3000/api/v1/chat
JWT
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" \
http://localhost:3000/api/v1/chat
聊天 API
发送消息
POST /api/v1/chat
{
"message": "你好",
"session_id": "optional-session-id",
"model": "deepseek-chat"
}
响应:
{
"response": "你好!有什么可以帮你的?",
"session_id": "abc123",
"tokens": {
"input": 5,
"output": 10
}
}
流式响应
POST /api/v1/chat/stream
{
"message": "写一首诗"
}
响应(SSE):
data: {"text": "春"}
data: {"text": "眠"}
data: {"text": "不"}
data: {"text": "觉"}
data: {"text": "晓"}
data: [DONE]
会话 API
创建会话
POST /api/v1/sessions
{
"name": "我的会话",
"model": "deepseek-chat"
}
获取会话
GET /api/v1/sessions/:id
列出会话
GET /api/v1/sessions
删除会话
DELETE /api/v1/sessions/:id
消息 API
获取消息历史
GET /api/v1/sessions/:id/messages
# 参数
?limit=50
&offset=0
&order=desc
删除消息
DELETE /api/v1/messages/:id
Skills API
列出 Skills
GET /api/v1/skills
执行 Skill
POST /api/v1/skills/:name/run
{
"params": {
"key": "value"
}
}
创建 Skill
POST /api/v1/skills
{
"name": "my-skill",
"description": "描述",
"script": "echo 'hello'"
}
配置 API
获取配置
GET /api/v1/config
更新配置
PATCH /api/v1/config
{
"model": "gpt-4o",
"temperature": 0.7
}
用户 API
创建用户
POST /api/v1/users
{
"email": "user@example.com",
"password": "secure-password"
}
获取用户
GET /api/v1/users/:id
更新用户
PATCH /api/v1/users/:id
{
"name": "新名字"
}
Webhook API
创建 Webhook
POST /api/v1/webhooks
{
"url": "https://your-server.com/webhook",
"events": ["message.created", "session.created"]
}
测试 Webhook
POST /api/v1/webhooks/:id/test
错误处理
错误格式
{
"error": {
"code": "INVALID_API_KEY",
"message": "API key is invalid",
"details": {}
}
}
常见错误码
| 错误码 | 说明 |
|---|---|
| INVALID_API_KEY | API Key 无效 |
| RATE_LIMIT | 请求频率超限 |
| MODEL_NOT_FOUND | 模型不存在 |
| SESSION_NOT_FOUND | 会话不存在 |
| INTERNAL_ERROR | 服务器错误 |
SDK
JavaScript/TypeScript
npm install openclaw-sdk
import { OpenClaw } from 'openclaw-sdk';
const client = new OpenClaw({
apiKey: 'your-api-key'
});
const response = await client.chat({
message: '你好'
});
Python
pip install openclaw
from openclaw import OpenClaw
client = OpenClaw(api_key='your-api-key')
response = client.chat(message='你好')
需要帮助?
- API 集成:¥99
- SDK 开发:¥299
- 企业支持:¥999
联系:微信 yang1002378395 或 Telegram @yangster151
创建:2026-03-14
Files
1 totalSelect a file
Select a file to preview.
Comments
Loading comments…
