Repository navigation
Home
N Sources, One API. N2API is a personal, self-hosted AI API gateway that brings API-key upstreams behind an OpenAI-compatible endpoint.
Manage accounts, model availability, routing pools, fallback chains, client
keys, limits, and request logs from a compact web dashboard. The Go backend
serves a static SvelteKit + Tailwind CSS UI and stores configuration and
encrypted credentials in PostgreSQL. Docker Compose is the primary deployment
path, supporting linux/amd64 and linux/arm64.
| Goal | Guide |
|---|---|
| Start locally and connect a client | Getting started |
| Deploy or upgrade a VPS instance | Production operations |
| Configure networking, secrets, metrics, or alerts | Complete manual |
| Configure accounts, pools, and client keys | Provider accounts and routing |
| Connect Codex CLI | Downstream Codex CLI |
| Diagnose gateway errors and limits | Gateway runtime limits |
| Develop, test, or clean up a local session | Development lifecycle |
| Prepare a release | Release checklist |
| Record a real-backup restore drill | Restore drill record |
| Review intended repository checks | Repository protections |
N2API is independently implemented and inspired by sub2api's workflow. It targets personal self-hosting, without public registration, payments, recharge balances, or platform billing. PostgreSQL is required; Redis and SQLite are not used.
Upstream accounts use API keys. OAuth authorization, token refresh, and fingerprint simulation are retired. Existing OAuth rows remain archived for backup compatibility and cannot serve requests; replace their routing-pool memberships with API-key accounts. Downstream Codex clients still connect through a client API key. See the upgrade scope.
This Wiki describes the current main branch. A published image may predate
these changes; match its release notes and source revision before upgrading.