Skip to content

Repository files navigation

🧩 Notion-Sub2API - Run Notion API Bridge with Docker

Docker

Credits: This project is a fork of Notion2API, originally created and authored by GALIAIS (© 2026). All credit for the original work goes to the original author. This fork is maintained by hugevo.

🖥️ What Notion-Sub2API Does

Notion-Sub2API is a local service that helps you connect to Notion AI through a simple API. It gives you:

  • OpenAI-style API endpoints
  • A web admin page for setup and account control
  • Support for multiple accounts
  • Local SQLite storage for data and session state
  • Support for streaming replies
  • Support for attachments like images, PDFs, and CSV files

Use it when you want one local place to manage access, test requests, or connect other tools to Notion AI.

🚀 Quick Start (Docker Only)

Notion-Sub2API is designed to run in Docker. There is no standalone Windows build — all you need is Docker.

1) Edit the config

Open config.docker.json and update the key values before starting (see 🔧 Configuration below).

2) Build and start the service

docker compose up -d --build

For a production-style setup:

docker compose -f docker-compose.prod.yml up -d --build

3) Open the WebUI

In your browser, go to:

http://127.0.0.1:8787/admin

Use this page to sign in, manage accounts, and check service status.

4) Check the service is running

curl http://127.0.0.1:8787/healthz

If the page returns a healthy status, the service is running.

5) (Optional) View logs

docker compose logs -f

To stop the service:

docker compose down

🔧 Configuration

Before you start the container, edit config.docker.json and set these values:

  • api_key This is the key used for the OpenAI-style API.

  • admin.password This is the password for the WebUI login.

  • upstream_base_url This is the address of the upstream site.

  • upstream_origin This is the origin header used for upstream requests.

  • Account pool settings Use these to add more than one account and switch between them.

🌐 Main Addresses

After the container starts, use these local addresses:

  • API: http://127.0.0.1:8787/v1/*
  • Health check: http://127.0.0.1:8787/healthz
  • WebUI: http://127.0.0.1:8787/admin

📌 Endpoints at a Glance

  • /v1/models
  • /v1/chat/completions
  • /v1/responses
  • /admin
  • /healthz

✨ What You Can Do

  • Send chat requests through OpenAI-style endpoints
  • Use streaming responses
  • Manage several accounts in one place
  • Refresh login state
  • Send file-based requests with images, PDFs, and CSV files
  • Store data locally in SQLite
  • Use the built-in admin page instead of editing files by hand

📁 Data Storage

Notion-Sub2API stores local data in SQLite. This helps keep:

  • Account records
  • Session state
  • Service status
  • Local runtime data

The data lives inside the container's data/ volume. Back up that volume if you want your settings and sessions to persist across updates.

🛠️ Troubleshooting

If the browser cannot reach the page

  • Confirm the container is still running (docker compose ps)
  • Check that no other service on the host uses port 8787
  • Refresh the page after a few seconds
  • Try http://127.0.0.1:8787/healthz first

If the login does not work

  • Confirm the admin.password value in config.docker.json
  • Make sure you are using the right account
  • Clear saved browser data for 127.0.0.1

If requests fail

  • Check api_key
  • Check upstream_base_url
  • Check upstream_origin
  • Make sure your account is still signed in (check the admin page)
  • Inspect the logs with docker compose logs -f

🔒 Basic Use Tips

  • Use a strong WebUI password
  • Do not share your local API key with other people
  • Stop the container when you do not need it (docker compose down)
  • Back up the data/ volume before you change settings

🧪 Example Use Flow

  1. Edit config.docker.json
  2. Run docker compose up -d --build
  3. Open http://127.0.0.1:8787/admin
  4. Sign in
  5. Check the health page
  6. Send your first API request

🧱 Project History

This repository is a maintained fork of the original Notion2API project by GALIAIS.

The original project is licensed under the MIT License, which permits modification and redistribution. This fork continues under the same MIT License while preserving credit to the original author.

🙏 Credits & License

This project is a fork of Notion2API, originally authored by GALIAIS (© 2026).

All original work remains the intellectual property of its respective author. This fork is distributed under the same MIT License as the original project. See LICENSE for details.

About

Notion-Sub2API - Local Notion AI API bridge with OpenAI-compatible endpoints. Fork of Notion2API by GALIAIS, maintained by hugevo.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages