用途:Onyx 是 AI 知识库服务,连接 Slack、Notion、Google Drive、Confluence 等 40 多个内部工具,提供搜索、聊天与内容写入的 API 能力。当用户提到 Onyx、Danswer,或需要查询企业内部知识库、基于内部文档问答、向 Onyx 写入新内容、开启或继续基于内部数据的 AI 聊天会话时使用。官方文档:https://docs.onyx.app/developers/overview
主要能力与用法:
- 搜索内部文档:POST /api/search/handle-search-request,请求体含 query、search_type(如 semantic)、filters、offset、limit,返回 top_documents(含 semantic_identifier、score、link)。
- 创建聊天会话:POST /api/chat/create-chat-session,请求体含 persona_id、description,返回 chat_session_id。
- 发送聊天消息:POST /api/chat/send-chat-message,请求体含 message、chat_session_id、parent_message_id、search_filters、stream、include_citations,返回 answer。
- 列出聊天会话:GET /api/chat/get-user-chat-sessions,返回 sessions(id、description)。
- 写入文档:POST /api/onyx-api/ingestion,请求体含 document(id、sections、source、semantic_identifier、metadata、doc_updated_at)与 cc_pair_id。
认证与前置:需要先在 app.vm0.ai/connectors 连接 Onyx 连接器。PAT token(onyx_pat_...)可用于所有非管理员端点;以 /admin/ 开头的端点需要 Admin API Key。排查连接问题可运行:zero doctor check-connector --env-name ONYX_TOKEN 或 zero doctor check-connector --url https://cloud.onyx.app/api/chat/get-user-chat-sessions --method GET
限制与注意:多轮对话需始终传递 chat_session_id 与 parent_message_id 以保持上下文;原始文档检索使用 search/handle-search-request,合成式 AI 回答使用 chat/send-chat-message。资料未提供免费额度、价格、速率限制与数据保留策略等信息。