TokenHub gives enterprises a private gateway to unify AI model access and governance, making every request controllable, traceable, and attributable.
Tip
Codex subscription ready: connect OpenAI Codex subscription accounts to TokenHub and serve their models through the same governed gateway as API-based providers. Set up Codex access →
TokenHub includes native adapters for Codex subscriptions, OpenAI, Azure OpenAI, Anthropic, Gemini, DeepSeek, Qwen, and local models, plus a catalog of 150+ provider templates and custom OpenAI-compatible upstreams. 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.
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. - OpenAI-compatible image generation and reference-image editing through
/v1/images/generationsand/v1/images/edits, with asynchronous jobs and server-side image retention;codex-gpt-image-2uses Codex subscription capacity, whilegpt-image-2uses OpenAI API providers. See the image generation guide. - 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 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.
- 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.
Native Release on a Linux systemd host:
curl -fsSL https://raw.githubusercontent.com/astaxie/TokenHub/main/deploy/native/install.sh \
-o /tmp/tokenhub-install.sh
sudo bash /tmp/tokenhub-install.sh installDocker Compose from a repository checkout:
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 - 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.
View all contributors · Start contributing
TokenHub is licensed under the Apache License 2.0.

