本页用于给 openclaw 或其他 AI 工具接入本网站的自动发布能力。调用前请先在后台的 AI 发布 面板创建分配式 API Key,并按实际需要勾选权限范围。
鉴权请求头可使用 Authorization: Bearer <API_KEY> 或 X-API-Key: <API_KEY>。
新手入口不会填写表单的用户可直接打开:/openclaw-publish.html
模板标准 JSON 发布模板:/ai-json-template.html
权限不同 Key 可以只拥有分类查询、图片上传、维修发布、配件发布、批量发布中的部分权限。旧版单 Key 已建议停用。
/api/ai/health/api/ai/categories/api/ai/upload-image/api/ai/publish/service/api/ai/publish/part/api/ai/publish/batch/api/ai/health 检查接口状态。/api/ai/categories 获取分类树。/api/ai/upload-image 上传并拿到图片 URL。source_ref,用于防止重复发布。GET /api/ai/categories
Authorization: Bearer YOUR_API_KEY
{
"dataUrl": "data:image/jpeg;base64,..."
}
返回示例:
{
"ok": true,
"url": "/uploads/ai/ai-1740000000000-abcd1234.jpg"
}
{
"source_ref": "service-001",
"name": "张工",
"title": "液相色谱整机维修",
"skills": ["进样器", "检测器", "电路板"],
"price": 1800,
"description": "原厂从业 8 年,可跨省出差。",
"phone": "13800138000",
"email": "service@example.com",
"category_main": "工业检测仪器",
"category_sub": "色谱仪器",
"brand": "Agilent"
}
{
"source_ref": "part-001",
"part_name": "进样针",
"part_code": "A-12345",
"condition_text": "全新",
"price": 320,
"description": "适配多型号液相色谱。",
"phone": "13800138000",
"email": "parts@example.com",
"category_main": "工业检测仪器",
"category_sub": "色谱仪器",
"brand": "Agilent",
"photos": [
{ "url": "/uploads/ai/ai-1740000000000-abcd1234.jpg" }
]
}
{
"items": [
{
"type": "service",
"source_ref": "svc-1001",
"name": "李工",
"title": "质谱维修",
"skills": ["真空系统", "离子源"],
"price": 2600,
"description": "长期服务 Thermo / Agilent 设备。",
"category_main": "工业检测仪器",
"category_sub": "质谱仪器",
"brand": "Thermo",
"phone": "13900001111"
},
{
"type": "part",
"source_ref": "prt-1001",
"part_name": "离子源组件",
"part_code": "MS-7788",
"condition_text": "使用1年",
"price": 4500,
"description": "测试正常。",
"category_main": "工业检测仪器",
"category_sub": "质谱仪器",
"brand": "Thermo",
"photos": []
}
]
}
返回包含 total、successCount、failureCount 和逐条 results。
category_main 必填,category_sub 如填写则必须是合法二级分类。brand,只有当该 API Key 被授予“允许自动创建新品牌”时,系统才会自动新增品牌;否则必须使用已有品牌。source_ref 建议全局唯一,重复提交时系统会直接返回已存在记录,避免重复发布。dataUrl 或先上传后引用站内 /uploads/... URL。