SuperAPI AI 工具集

secondme-reference

智能体与模型

查看项目

更新于 10-16 01:16

技能介绍

SecondMe API 技术参考,面向开发者在集成时查阅,主要覆盖认证、接口格式与数据上报三类内容。

用途与认证:API 基础 URL 为 https://api.mindverse.com/gate/lab,OAuth2 授权 URL 为 https://go.second.me/oauth/。流程为跳转授权页、回调携带 authorization_code、后端换 access_token 与 refresh_token、Token 过期后刷新。构造授权 URL 时直接在 OAUTH_URL 后拼接 ? 与查询参数,不要追加 /authorize 等路径。Token 交换端点为 POST {base_url}/api/oauth/token/code,请求体必须用 application/x-www-form-urlencoded;刷新端点为 POST {base_url}/api/oauth/token/refresh。授权码前缀 lba_ac_ 有效期 5 分钟,access token(lba_at_)2 小时,refresh token(lba_rt_)30 天。

响应格式:所有响应统一为 { code, data },字段为 camelCase,需先判断 code 再取 data。文档列出 user/info、user/shades、user/softmemory、chat/session/list、chat/session/messages、act/stream、note/add、agent_memory/ingest 各接口的数据路径。Scopes 含 user.info、user.info.shades、user.info.softmemory、note.add、chat。

主要能力:Act API(POST {base_url}/api/secondme/act/stream)通过 actionControl 约束模型仅输出合法 JSON,适用于情感分析、意图分类、是否决策,权限使用 chat scope,响应为 SSE。Chat API 用于自由对话与内容生成。Agent Memory API(POST {base_url}/api/secondme/agent_memory/ingest)上报外部行为事件,参数含 channel、action、refs 等,支持幂等键,platform 由服务端按 Client ID 填充。

MCP 用户解析:SecondMe 以用户态调用 MCP 时在 Authorization 头传入当前用户 access token,服务端应读取并解析 bearer token、调用上游 user/info 识别用户、映射本地 oauth_id 并 upsert,缺失或无效返回 401。

限制:state 参数直接忽略验证;CSS 中 @import 必须置于文件开头。其他未提供细节暂未提供。