# A private enterprise AI gateway

> Source: <https://github.com/astaxie/TokenHub>
> Published: 2026-07-21 17:03:07+00:00

TokenHub is a private enterprise AI gateway with role-based workspaces for users, team leaders, and administrators.

| Login Console | Gateway Overview |
|---|---|
| API Documentation | Provider Channels |
| Model Catalog | Routing Policies |
| Usage Analytics | System Settings |

TokenHub separates everyday model usage, team governance, and platform administration so enterprise users see the workflows that match their responsibility.

| Role | Workspace Focus | Guide |
|---|---|---|
| User | Find available models, create project-scoped API keys, call the model API, and review personal usage |
|

[Team Leader Guide](/astaxie/TokenHub/blob/main/docs/team-leader-guide.md)[Administrator Guide](/astaxie/TokenHub/blob/main/docs/administrator-guide.md)- OpenAI-compatible model APIs:
`/v1/chat/completions`

,`/v1/responses`

,`/v1/embeddings`

. - Provider channels for OpenAI-compatible, Azure OpenAI, Anthropic, Gemini, DeepSeek, Qwen, local vLLM/Ollama, and custom upstreams.
- Model catalog and routing policies with priority, weight, failover order, and route health diagnostics.
- Project-scoped key management with team ownership, member permissions, quotas, and concurrency controls.
- Usage analytics and request logs attributed to user, project, team, model, and cost center.
- Identity source configuration for OAuth/OIDC enterprise sign-in, plus RBAC and audit trails.
- Clean console with compact role-aware navigation, global search, light/dark mode, and split-view API documentation.
- SQLite-first private deployment with Docker Compose support.
- Console language switching for English, Chinese, and Japanese.

```
cp deploy/.env.example deploy/.env
docker compose --env-file deploy/.env -f deploy/docker-compose.yml up -d --build
```

Open:

- Admin console:
`http://localhost:3000`

- Backend API:
`http://localhost:8080`

- Health check:
`http://localhost:8080/healthz`

Default admin login:

- Username:
`admin`

- Password:
`admin123456`

Change the default password and secrets in `deploy/.env`

before exposing TokenHub beyond a local machine.

Backend:

```
cd backend
go run ./cmd/tokenhub
```

Frontend:

```
cd frontend
npm install
npm run dev
```

Smoke-test the model API with the included SDK example:

```
cd sdk
npm install
npm run test:deepseek
```

TokenHub is licensed under the [Apache License 2.0](/astaxie/TokenHub/blob/main/LICENSE).
