TokenHub is enterprise Token Governance infrastructure for AI: model routing, access control, token cost optimization, provider reconciliation, and governed access to every upstream model provider.
Thanks to AICoding for sponsoring this project! AICoding — Global AI Model API Relay Service at Unbeatable Prices! Claude Code at 19% of original price, GPT at just 1%! Trusted by hundreds of enterprises for cost-effective AI services. Supports Claude Code, GPT, Gemini and major domestic models, with enterprise-grade high concurrency, fast invoicing, and 24/7 dedicated technical support. TokenHub users who register via this link get 10% off their first top-up!
SubSub offers subscription upgrades and renewals across ChatGPT plans, with order status tracking. Register here to get started!
Enterprise Token Governance
TokenHub gives enterprises a governance layer for the AI model lifecycle, from provider access and project keys to routing policy, usage attribution, budget control, and bill reconciliation.
The core problem is what happens after every team, application, and workflow starts consuming more models and more tokens. TokenHub puts governance controls in front of every model call:
Model routing: choose the right model by scenario, cost, performance, health, and fallback policy.
Permission management: allocate and control token access across people, teams, projects, and applications.
Token savings: reduce AI spend through caching, model selection, quotas, and call strategy.
Provider reconciliation: compare internal usage with provider bills so finance, platform, and business teams can explain actual AI cost.
Why TokenHub
Many open source AI gateways focus on provider fan-out: one endpoint that can call many upstreams. That helps developers connect models, but it does not solve the enterprise operating problem by itself. TokenHub is built around the missing governance layer:
Token distribution is managed by project and team instead of by copying raw provider keys into every application.
Model access, routing, and fallback are policy decisions that administrators can change without rewriting client code.
Bills and request history can be compared against internal ownership so finance, platform, and business teams can explain AI spend.
User, team leader, and administrator workspaces keep daily usage, approval, cost attribution, and platform operations separated by responsibility.
Screenshots
Designed Around Three Roles
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
OpenAI-compatible image generation and reference-image editing through /v1/images/generations and /v1/images/edits, with asynchronous jobs and server-side image retention.
Clean console with compact role-aware navigation, global search, light/dark mode, and split-view API documentation.
SQLite-first private deployment with native systemd and Docker Compose options.
PostgreSQL supports multi-instance deployments: share state through remote PostgreSQL, scale frontend and backend replicas horizontally, and configure connection pools. See the deployment guide and PostgreSQL setup guide.
Console language switching for English, Chinese, and Japanese.
Provider Ecosystem
Provider support is TokenHub’s integration boundary. Hosted APIs, subscription channels, local models, and custom upstreams connect through the Provider abstraction so the same enterprise policies can govern every model path.
Once routing, permissions, token savings, attribution, audit, and reconciliation controls are in place, TokenHub can connect those governed workflows to OpenAI, Azure OpenAI, Anthropic, Gemini, DeepSeek, Qwen, Codex subscriptions, local models, and custom OpenAI-compatible upstreams.
TokenHub includes native Provider adapters for OpenAI, Azure OpenAI, Anthropic, Gemini, DeepSeek, Qwen, Codex subscriptions, and local models, plus a catalog of 150+ provider templates. Popular integrations include:
Provider templates use the matching native adapter when available; otherwise they connect through an OpenAI-compatible endpoint. Models and capabilities vary by upstream service and account, while enterprise policy stays centralized in TokenHub.
cp deploy/.env.example deploy/.env
# Replace every change-me value in deploy/.env with a strong secret.
./deploy/install.sh
Open:
Admin console: http://localhost:3000
Backend API: http://localhost:8080
Health check: http://localhost:8080/healthz
Initial admin login:
Username: admin
Native install password: printed once by the installer
Docker password: the value of TOKENHUB_BOOTSTRAP_ADMIN_PASSWORD
The native installer verifies Release checksums, installs a systemd service, and enables direct update, rollback, and restart controls in the version panel. The default Docker deployment runs the backend and console in one managed container and provides the same direct controls without mounting the Docker socket. Release bundles are stored in the tokenhub-releases volume so ordinary container restarts and recreations preserve a panel-applied update. Multi-instance Docker deployments keep operator-managed Compose updates so every replica changes version together. See the deployment guide for both modes.
TokenHub grows through product feedback, gateway integrations, documentation, tests, and the steady care of people who run it in real enterprise environments.
TokenHub
TokenHub is enterprise Token Governance infrastructure for AI: model routing, access control, token cost optimization, provider reconciliation, and governed access to every upstream model provider.
English | 简体中文 | 日本語
❤️ Sponsors
Enterprise Token Governance
TokenHub gives enterprises a governance layer for the AI model lifecycle, from provider access and project keys to routing policy, usage attribution, budget control, and bill reconciliation.
The core problem is what happens after every team, application, and workflow starts consuming more models and more tokens. TokenHub puts governance controls in front of every model call:
Why TokenHub
Many open source AI gateways focus on provider fan-out: one endpoint that can call many upstreams. That helps developers connect models, but it does not solve the enterprise operating problem by itself. TokenHub is built around the missing governance layer:
Screenshots
Designed Around Three Roles
TokenHub separates everyday model usage, team governance, and platform administration so enterprise users see the workflows that match their responsibility.
Platform Capabilities
/v1/chat/completions,/v1/responses,/v1/embeddings; Anthropic Messages APIs:/v1/messages,/v1/messages/count_tokens./v1/images/generationsand/v1/images/edits, with asynchronous jobs and server-side image retention.Provider Ecosystem
Provider support is TokenHub’s integration boundary. Hosted APIs, subscription channels, local models, and custom upstreams connect through the Provider abstraction so the same enterprise policies can govern every model path.
Once routing, permissions, token savings, attribution, audit, and reconciliation controls are in place, TokenHub can connect those governed workflows to OpenAI, Azure OpenAI, Anthropic, Gemini, DeepSeek, Qwen, Codex subscriptions, local models, and custom OpenAI-compatible upstreams.
TokenHub includes native Provider adapters for OpenAI, Azure OpenAI, Anthropic, Gemini, DeepSeek, Qwen, Codex subscriptions, and local models, plus a catalog of 150+ provider templates. Popular integrations include:
Provider templates use the matching native adapter when available; otherwise they connect through an OpenAI-compatible endpoint. Models and capabilities vary by upstream service and account, while enterprise policy stays centralized in TokenHub.
Quick Start
Native Release on a Linux systemd host:
Docker Compose from a repository checkout:
Open:
http://localhost:3000http://localhost:8080http://localhost:8080/healthzInitial admin login:
adminTOKENHUB_BOOTSTRAP_ADMIN_PASSWORDThe native installer verifies Release checksums, installs a systemd service, and enables direct update, rollback, and restart controls in the version panel. The default Docker deployment runs the backend and console in one managed container and provides the same direct controls without mounting the Docker socket. Release bundles are stored in the
tokenhub-releasesvolume so ordinary container restarts and recreations preserve a panel-applied update. Multi-instance Docker deployments keep operator-managed Compose updates so every replica changes version together. See the deployment guide for both modes.Documentation
Contributors
TokenHub grows through product feedback, gateway integrations, documentation, tests, and the steady care of people who run it in real enterprise environments.
astaxie
deepjerry-ai
legendtkl
Mr0bean
cngump
bailu-ZZ
coldbrewtea
excniesNIED
imaben
samz406
wangle201210
CLukeLi
jackiesre721
myssl
exgliuzhi
hoorayman
debin-ge
ocass-chen
AnxForever
DeanHH
yujiewanwan
longzhang83
lxm
susunola
desertsurge
View all contributors · Start contributing
Star History
License
TokenHub is licensed under the Apache License 2.0.