
# TokenFactory
**AI gateway you self-host:** route many model providers through one API surface, with users, keys, quotas, and an admin UI.
---
### Upstream (required reading)
**TokenFactory is derived from the [QuantumNous/new-api](https://github.com/QuantumNous/new-api) project (“New API”).** That repository is the authoritative upstream for design, protocol coverage, and community history. This fork may diverge; for behavior and APIs, treat upstream docs as the baseline and verify against your build.
| | |
| --- | --- |
| **Upstream repository** | **[github.com/QuantumNous/new-api](https://github.com/QuantumNous/new-api)** |
| **License** | [GNU AGPL v3.0](./LICENSE) — same for modifications here; see [`NOTICE`](./NOTICE) |
| **Network use** | If you offer a modified version over a network to others, **AGPL-3.0 section 13** requires you to provide the corresponding full source under the same license. |
---
简体中文 |
繁體中文 |
English |
Français |
日本語
Quick Start •
Documentation •
Languages •
Deployment •
License •
Help
## About this repository
TokenFactory is a **self-hosted control plane** for aggregating upstream AI vendors: one place to configure channels, map models, enforce access, and observe usage. You run the binary (or container), point clients at it, and manage everything from the web console.
This README describes **this fork’s** packaging and pointers. It does not replace the upstream feature list or legal notices—those remain tied to [QuantumNous/new-api](https://github.com/QuantumNous/new-api) and the license files in this tree.
## Compliance & disclaimer
- Use only in line with provider terms (e.g. OpenAI [Terms of Use](https://openai.com/policies/terms-of-use)) and **applicable law**. No illegal or abusive use.
- In China, follow registration and compliance rules for generative AI services (e.g. [《生成式人工智能服务管理暂行办法》](http://www.cac.gov.cn/2023-07/13/c_1690898327029107.htm)); do not offer unregistered public generative AI services where prohibited.
- No warranty: treat this as **self-supported** infrastructure unless you arrange your own support.
---
## Quick Start
### Using Docker Compose (Recommended)
```bash
# Clone the project
git clone https://github.com/QuantumNous/token-factory.git
cd token-factory
# Edit docker-compose.yml configuration
nano docker-compose.yml
# Start the service
docker-compose up -d
```
**TokenFactory** — self-hosted AI gateway (this fork).
**Upstream:** **[QuantumNous/new-api](https://github.com/QuantumNous/new-api)** · **Docs:** [docs.newapi.pro](https://docs.newapi.pro/en/docs) · **This repo:** [issues](https://github.com/QuantumNous/token-factory/issues)
The New API project is developed by **QuantumNous** and contributors. JetBrains supports open-source development through free IDE licenses.