一、确认服务可用
托管服务提供健康检查和任务查询接口。带有私有数据的接口使用服务端配置的访问令牌。
GET https://mt-api.kakacut.cn/health
GET https://mt-api.kakacut.cn/api/dashboard?workspace_id=cloud-wechat&user_id=server&token=YOUR_API_TOKEN
二、提交公众号文章任务
准备一篇服务端可读取的 Markdown 文章后,提交到已配置的发布流程。任务会生成公众号排版预览;草稿创建成功后,仍需要用户到微信公众号后台做最终确认和发布。
curl -X POST https://mt-api.kakacut.cn/platform-kernel/pipeline/run \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"workspace_id": "cloud-wechat",
"user_id": "server",
"pipeline_id": "wechat-markdown-default",
"article_path": "/opt/praxis-ai/data/articles/example.md",
"title": "公众号文章标题",
"run_id": "stable-run-id",
"metadata": {
"content_source_url": "https://example.com/source",
"reviewer": "ai-agent"
}
}'
三、让 AI 读取能力说明
AI 不需要猜接口边界。让它先读取这份能力说明,确认输入、输出、副作用和成功判断:
四、成功判断
AI 不应只凭任务创建成功就声称草稿已创建。必须轮询发布任务,确认草稿步骤完成,并且返回的回执以 wechat_draft: 开头。
GET https://mt-api.kakacut.cn/api/pipeline/run?id=stable-run-id&token=YOUR_API_TOKEN
五、发布边界
托管服务会在账号能力准备好后创建微信公众号后台草稿,可以写入标题、摘要、作者、正文、封面和原文链接。它不会替用户执行最终公开发布,也不会设置微信后台中仅能手动确认的发布选项。