Skip to content

Repository files navigation

TokenHub

TokenHub

TokenHub gives enterprises a private gateway to unify AI model access and governance, making every request controllable, traceable, and attributable.

License Go 1.26 Docker Compose OpenAI Compatible

English | 简体中文 | 日本語

Supported Providers

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:

Codex Subscription
Codex Subscription
OpenAI
OpenAI
Anthropic
Anthropic
Google Gemini
Google Gemini
Azure OpenAI
Azure OpenAI
Amazon Bedrock
Amazon Bedrock
Google Vertex AI
Google Vertex AI
xAI Grok
xAI / Grok
DeepSeek
DeepSeek
Qwen DashScope
Qwen / DashScope
Moonshot AI Kimi
Moonshot AI / Kimi
Z.AI GLM
Z.AI / GLM
MiniMax
MiniMax
Doubao
Doubao
SiliconFlow
SiliconFlow
ModelScope
ModelScope
OpenRouter
OpenRouter
Groq
Groq
Together AI
Together AI
Fireworks AI
Fireworks AI
Mistral AI
Mistral AI
Cohere
Cohere
Perplexity
Perplexity
Hugging Face
Hugging Face
NVIDIA NIM
NVIDIA NIM
GitHub Models
GitHub Models
GitHub Copilot
GitHub Copilot
Vercel AI Gateway
Vercel AI Gateway
Cloudflare AI Gateway
Cloudflare AI Gateway
Ollama
Ollama
LM Studio
LM Studio
vLLM and custom providers
vLLM / Custom

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.

Screenshots

TokenHub product tour: login, overview, API documentation, provider channels, model catalog, routing policies, usage analytics, and system settings

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 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

Platform Capabilities

  • 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/generations and /v1/images/edits, with asynchronous jobs and server-side image retention; codex-gpt-image-2 uses Codex subscription capacity, while gpt-image-2 uses 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.

Quick Start

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 install

Docker 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.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.

Documentation

Contributors

TokenHub grows through product feedback, gateway integrations, documentation, tests, and the steady care of people who run it in real enterprise environments.

TokenHub contributors

View all contributors · Start contributing

Star History

Star History Chart

License

TokenHub is licensed under the Apache License 2.0.

About

TokenHub gives enterprises a private gateway to unify AI model access and governance, making every request controllable, traceable, and attributable.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages