Notion2api — AI skill for Claude Code
将 Notion AI 接口转换为 OpenAI/Anthropic 兼容格式的代理服务.
How to install Notion2api
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open pdxjie/notion2api and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Notion2api does
将 Notion AI 接口转换为 OpenAI/Anthropic 兼容格式的代理服务。提供 Claude Code 支持。
Alternatives in AI
- WindsurfAPI — Turn Windsurf / Devin Desktop's 100+ AI models (Claude, GPT, Gemini, DeepSeek, Kimi, GLM, SWE) into OpenAI-, A 3k ★
- Vllm Mlx — High-performance OpenAI and Anthropic compatible LLM inference server for Apple Silicon 1.5k ★
- Claude To ChatGPT — This project converts the API of Anthropic's Claude model to the OpenAI Chat API format 1.3k ★
README
Notion2API
将 Notion AI 封装为 OpenAI 兼容 API 的本地代理服务
Notion2API 通过逆向 Notion 内置 AI 接口,将其包装为标准的 OpenAI 兼容 API,让你无需付费订阅任何 AI 服务,即可在 Cherry Studio、Zotero、Claude Code 等主流客户端中直接使用 Claude、GPT、Gemini 等顶级模型。
功能特性
- OpenAI 兼容 — 标准
/v1/chat/completions接口,无缝接入主流客户端 - Anthropic 兼容 — 额外支持
/v1/messages,可供 Claude Code 等原生 SDK 直接使用 - 流式响应(SSE) — 实时逐字输出,体验流畅
- Thinking 面板 — 支持所有模型展示推理过程
- 网络搜索 — 支持展示 AI 的 Web 搜索来源
- 多账号池 — 多账号轮询负载均衡,自动故障转移
- 三种运行模式 — Lite / Standard / Heavy,按需选择
三种模式对比
| 特性 | Lite | Standard | Heavy |
|---|---|---|---|
| 记忆管理 | ❌ 无 | ✅ 客户端管理 | ✅ 服务端 SQLite |
| 数据库 | ❌ 不需要 | ❌ 不需要 | ✅ SQLite |
| Thinking 面板 | ❌ | ✅ | ✅ |
| 搜索结果 | ❌ | ✅ | ✅ |
| 速率限制 | 30次/分 | 25次/分 | 20次/分 |
| 适用场景 | 简单问答 | 中短期对话 | 长期记忆对话 |
修改 `.env` 中的 `APP_MODE` 变量即可切换模式,**推荐日常使用 `standard`**。
快速开始
第一步:获取 Notion 凭据
你需要一个已订阅 Notion AI 的账号(或处于 AI 试用期的账号)。
- 打开浏览器,访问 https://www.notion.so/ai 并登录
- 按
F12打开开发者工具
**获取 `token_v2`:**
- 切换到 Application(应用程序)标签
- 左侧展开 Storage → Cookies → https://www.notion.so
- 找到名为
token_v2的条目,复制其 Value(值)
**获取其他字段(space_id、user_id 等):**
- 切换到 Console(控制台)标签
- 将
scripts/extract_notion_info.js文件中的代码完整粘贴进去,回车运行 - 脚本会自动输出一段 JSON,将其中的
YOUR_TOKEN_V2_HERE替换为上一步复制的token_v2值 - 复制完整输出,备用
第二步:配置 `.env` 文件
打开项目根目录的 `.env` 文件,填入你的凭据:
# 将上一步获取的 JSON 粘贴到这里(保留外侧的单引号)
NOTION_ACCOUNTS='[{"token_v2":"你的token","space_id":"你的space_id","user_id":"你的user_id","space_view_id":"你的space_view_id","user_name":"你的名字","user_email":"你的邮箱"}]'
# 运行模式,推荐 standard
APP_MODE=standard
**如果使用 Heavy 模式**,还需额外配置(用于对早期对话进行摘要压缩):
- 前往 https://siliconflow.cn 免费注册,获取 API Key
- 填入
.env:SILICONFLOW_API_KEY=你的SiliconFlow_API_Key APP_MODE=heavy
第三步:安装依赖并启动
# 1. 安装 Python 依赖(首次运行时执行)
pip install -r requirements.txt
# 2. 启动服务
uvicorn app.server:
Related Skills
Askimo
AI Client for chat, RAG, Skills, MCP tools, and agents. Support multiple LLMs (Anthropic, OpenAI, VertexAI, vL
Devo
Model-neutral agent desktop/runtime for private, enterprise, and OpenAI-compatible / Anthropic-compatible mode
TurboLLM
Run any local LLM engine, auto-tuned to your GPU — polished web UI + OpenAI/Anthropic-compatible API. Point Cl
Openclaw Guide
开源OpenClaw中文文档站,OpenClaw中文指南,支持小龙虾 AI 智能体安装部署、消息渠道接入、Agent 架构、Skills 技能配置、模型提供商、CLI 命令参考、网关运维、安全沙箱等全方位文档。覆盖 Wh
Llmix
Production LLM call layer for AI agents and tools: keep OpenAI/Anthropic/AI SDK/LiteLLM, hot-swap models with
Byokey
Turn AI subscriptions into standard API endpoints. OpenAI & Anthropic compatible gateway — for Amp Code, Curso
Related Agents
AI LLM Engineer
Use this agent when the user types /ai or asks for ai/llm engineer work — e.g., build a RAG pipeline over our
LLM Orchestrator
Use this agent for LLM integration work — prompt engineering, multi-provider abstraction (OpenRouter, Gemini,
AI ML
AI/ML 통합 전문가 + LLM API 최신 모델/SDK 코딩 가이드. RAG 시스템, 문서 분석, OpenAI/Anthropic/Gemini/Ollama 최신 API 보장. "AI integra