用途
Omi API Integration 技能为开发者提供与 Omi 平台集成的指导,涵盖 Developer API、MCP 服务器和 Webhook 三类集成方式。适用于构建 Omi 集成、使用 Developer API、设置 MCP 服务器、创建 Webhook 集成以及处理 OAuth 流程等场景。
主要能力
Developer API
- 基础 URL:https://api.omi.me/v1/dev
- 认证方式:Bearer Token,密钥以 omi_dev_ 为前缀
- 获取 API Key:打开 Omi 应用,进入 Settings → Developer → Create Key,立即复制密钥(之后不再显示)
- 请求示例:
import requests
headers = {
"Authorization": "Bearer omi_dev_your_key_here"
}
# Get memories
response = requests.get(
"https://api.omi.me/v1/dev/user/memories",
headers=headers,
params={"limit": 10}
)
memories = response.json()
可用端点:
- GET /v1/dev/user/memories - 获取记忆
- POST /v1/dev/user/memories - 创建记忆
- POST /v1/dev/user/memories/batch - 批量创建最多 25 条记忆
- GET /v1/dev/user/conversations - 获取对话
- POST /v1/dev/user/conversations - 创建对话
- GET /v1/dev/user/action-items - 获取行动项
- POST /v1/dev/user/action-items - 创建行动项
速率限制:每分钟 100 次,每天 10,000 次。
MCP 服务器
用途:让 AI 助手(如 Claude)与 Omi 数据交互。
托管 MCP 服务器(SSE):
- URL:https://api.omi.me/v1/mcp/sse
- 认证:Bearer Token,密钥以 omi_mcp_ 为前缀
可用工具:
- get_memories - 检索记忆
- create_memory - 创建记忆
- edit_memory - 编辑记忆
- delete_memory - 删除记忆
- get_conversations - 检索对话
配置示例:
{
"mcpServers": {
"omi": {
"url": "https://api.omi.me/v1/mcp/sse",
"apiKey": "omi_mcp_your_key_here"
}
}
}
Webhook 集成
记忆创建 Webhook:
- 触发时机:创建记忆时
- 端点:POST /webhook/memory-created
- 载荷:
{
"id": "memory_id",
"content": "Memory content",
"category": "personal",
"user_id": "user_uid",
"created_at": "2024-01-01T00:00:00Z"
}
实时转录 Webhook:
- 触发时机:转录片段到达时
- 端点:POST /webhook/transcript
- 载荷:
{
"text": "Transcript segment",
"timestamp": 1234567890,
"conversation_id": "conv_id",
"user_id": "user_uid"
}
OAuth 集成
Google OAuth:
- 在 Google Cloud Console 创建 OAuth 2.0 客户端
- 配置授权来源和重定向 URI
- 在应用中使用客户端 ID 和密钥
Apple OAuth:
- 创建带 Sign In with Apple 的 App ID
- 创建 Services ID
- 创建私钥(.p8 文件)
- 在 Firebase Console 中配置
使用方式
创建集成
- 设置 Webhook 端点
- 在应用配置中注册 Webhook URL
- 处理 Webhook 载荷
- 处理并响应事件
使用 Developer API
- 在 Omi 应用中生成 API Key
- 安全存储密钥(环境变量)
- 发起认证请求
- 处理速率限制(100/分钟,10,000/天)
设置 MCP
- 在 Omi 应用中生成 MCP API Key
- 配置 MCP 客户端(如 Claude Desktop)
- 使用工具与 Omi 数据交互
适用场景
- 构建与 Omi 的集成
- 使用 Developer API 访问记忆、对话、行动项
- 设置 MCP 服务器供 AI 助手使用
- 创建 Webhook 集成以响应事件
- 处理 OAuth 流程
限制
- Developer API 速率限制为每分钟 100 次、每天 10,000 次
- 批量创建记忆最多 25 条
- API Key 仅在创建时显示一次,需立即保存
- 其他限制暂未提供
相关文档
docs/ 文件夹是所有面向用户文档的唯一来源,部署于 docs.omi.me。
- API 概览:docs/doc/developer/api/overview.mdx
- API 端点:docs/api-reference/
- 记忆 API:docs/doc/developer/api/memories.mdx
- 对话 API:docs/doc/developer/api/conversations.mdx
- 行动项 API:docs/doc/developer/api/action-items.mdx
- MCP:docs/doc/developer/MCP.mdx
- 插件开发:docs/doc/developer/apps/Introduction.mdx
- OAuth:docs/doc/developer/apps/Oauth.mdx
相关 Cursor 资源:
规则:
- .cursor/rules/backend-api-patterns.mdc - 后端 API 模式
- .cursor/rules/backend-architecture.mdc - 后端架构
- .cursor/rules/plugin-development.mdc - 插件开发模式
- .cursor/rules/web-nextjs-patterns.mdc - Web API 集成
子代理:
- .cursor/agents/backend-api-developer/ - 使用此技能进行 API 开发
- .cursor/agents/plugin-developer/ - 使用此技能进行插件集成
- .cursor/agents/web-developer/ - 使用此技能进行 Web 集成
- .cursor/agents/sdk-developer/ - 使用此技能进行 SDK 开发
命令:
- /backend-setup - 使用此技能进行 API 设置
- /create-plugin - 使用此技能进行插件集成
- /update-api-docs - 使用此技能进行 API 文档