×
🔌 API 接入指南 (API Docs)
本平台提供自动研报生成 API,支持第三方业务系统无缝接入。
1. 鉴权 (Authentication)
所有接口均需在 Header 中传递秘钥:
Authorization: Bearer sk-openclaw-report-gen-2026
2. 生成报告 (流式接口)
POST /api/generate-report
Content-Type: application/json
{
"topic": "自动驾驶产业链",
"sections": ["1. 发展现状", "2. 投资机会"],
"model": "pro" // 可选: 引擎级别
}
3. 前端集成示例 (SSE解析)
const response = await fetch('/api/generate-report', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer sk-openclaw-report-gen-2026'
},
body: JSON.stringify({topic: "主题", sections: []})
});
const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
console.log(decoder.decode(value)); // 打印进度流
}