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 | User Guide |
| Team Leader | Manage project spaces, project members, project keys, team reports, and project cost attribution | Team Leader Guide |
| Administrator | Configure providers, model catalog, routing policies, identity sources, RBAC, audit, and cost controls | Administrator Guide |
- OpenAI-compatible model APIs:
/v1/chat/completions,/v1/responses,/v1/embeddings; Anthropic Messages APIs:/v1/messages,/v1/messages/count_tokens. - 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.
- PostgreSQL supports multi-instance deployments: share state through remote PostgreSQL, scale frontend and backend replicas horizontally, and configure connection pools. See the deployment guide.
- Console language switching for English, Chinese, and Japanese.
- TokenHub can also connect OpenAI Codex subscription resources and route selected local Codex CLI or desktop sessions through an isolated, recoverable Codex profile. See the Codex integration guides.
cp deploy/.env.example deploy/.env
# Replace every change-me value in deploy/.env with a strong secret.
./deploy/install.shOpen:
- Admin console:
http://localhost:3000 - Backend API:
http://localhost:8080 - Health check:
http://localhost:8080/healthz
Initial admin login:
- Username:
admin - Password: the value of
TOKENHUB_BOOTSTRAP_ADMIN_PASSWORD
The deployment script validates production credentials, pulls published images, and starts the containers without building locally. Until the images are publicly available, a failed pull of the default latest tag automatically falls back to a local source build; an explicitly selected tag never does. The script reports each unsafe variable without printing secret values. If Compose fails because a backend container created or restarted by that attempt is unhealthy, it automatically shows only that attempt's recent backend logs. Use ./deploy/install.sh --build to request a local build explicitly.
- Documentation home
- Architecture
- User Guide
- Team Leader Guide
- Administrator Guide
- Contributing Guide
- 简体中文文档
- 日本語ドキュメント
TokenHub grows through product feedback, gateway integrations, documentation, tests, and the steady care of people who run it in real enterprise environments.
View all contributors · Start contributing
Track TokenHub's growth on the live Star History chart.
TokenHub is licensed under the Apache License 2.0.