mrkeyoor.com_
Thu 13 Aug 15:39 UTC
Self-Hostedevaluationupdated 13 Aug 2026

TokenHub

TokenHub is a self-hosted gateway that puts one governed API in front of commercial and local AI model providers. It centralizes project keys, model routing, failover, quotas, usage costs, roles, and audit records so an organization does not have to give every application a collection of provider credentials.

Verdict

TokenHub is unusually complete for such a young gateway, particularly around project ownership, cost attribution, Codex subscription routing, and single-host to multi-instance deployment. I would trial it before building an internal gateway from scratch, but I would not yet make it the only path to every production model. Pin a release, test upgrades and each protocol your clients use, and keep provider break-glass access while the project matures.

Setup3/5Good installers, followed by serious identity and routing configuration
Docs5/5Detailed role, architecture, deployment, provider, and migration guides
Community4/5Rapid releases and active issues from a young contributor base
Maturity3/5Broad v0.5 feature set with upgrade and protocol gaps still visible

Who it’s for

Platform teams standardizing access to OpenAI, Azure OpenAI, Anthropic, Gemini, DeepSeek, Qwen, Codex subscriptions, vLLM, or Ollama.
Organizations that need project-scoped keys, model allowlists, rate and concurrency limits, routing policy, and cost attribution.
Self-hosters who want an OpenAI-compatible API plus a role-aware administration console.
Teams prepared to run SQLite on one host or PostgreSQL for higher concurrency and multiple instances.

Who it’s NOT for

Organizations requiring a long-established gateway with slow change: TokenHub was created in June 2026 and is currently at v0.5.0.
Security teams that require provider credentials to stay in Vault, a cloud secret manager, environment references, or mounted secret files: external secret references are still proposed in issue #181.
Applications needing the whole OpenAI surface: Codex voice chat returns 404 because /v1/live is absent, while audio transcription and document reranking remain open feature requests.
Operators expecting every minor upgrade to be routine: issue #205 reports a team-membership problem after moving from v0.4.0 to v0.5.0.
Teams whose support workflow requires every issue report in English: the main documentation is English with Chinese and Japanese translations, but several current operational issues are primarily written in Chinese.

Setup reality

A local evaluation is credible with Docker Compose or the native Linux installer, but this is an identity, billing, and traffic control service, so production is not a one-command decision. Operators must replace bootstrap secrets, configure provider credentials and model routes, place HTTPS in front of the default exposed ports, choose retention rules, and back up the database. SQLite suits a single instance; PostgreSQL, connection sizing, shared secrets, and replica coordination enter the picture for high availability. Existing LiteLLM users get a migration tool, not freedom from validating the resulting policies and costs.

One doorway for many model providers

TokenHub sits between applications and AI providers. Instead of placing OpenAI, Anthropic, Gemini, Azure, DeepSeek, Qwen, or local-model credentials in every service, a platform team connects those upstreams once and gives applications project-scoped TokenHub keys. Clients use familiar OpenAI-compatible Chat Completions, Responses, Embeddings, and image endpoints, or Anthropic Messages endpoints.

That consolidation is only useful if the gateway can enforce policy, and TokenHub's feature set goes beyond request forwarding. Administrators create providers, resources, models, and routes. Routes can use priority, weight, failover order, health, and affinity. Projects and API keys can restrict model access and apply requests-per-minute, tokens-per-minute, quota, IP, and concurrency limits. Usage and cost records are attributed to users, projects, teams, models, and cost centers.

The result is a plausible internal model platform rather than a developer proxy. A user can find allowed models and issue a key, a team leader can manage membership and costs, and an administrator can own providers, routing, identity, and audit. The main documentation is in English, with maintained Simplified Chinese and Japanese versions for the principal guides.

Routing and compatibility are the strongest parts

TokenHub includes native adapters for major providers, more than 150 provider templates, and custom OpenAI-compatible upstreams. A model catalog separates the stable name applications call from a provider's inventory. That allows a route to swap providers or map an internal alias without rewriting every client. Unhealthy resources are skipped, half-open recovery controls trial traffic, and streaming calls do not pretend they can fail over after output has begun.

Codex subscription integration is a notable differentiator. TokenHub can connect subscription resources and route selected Codex CLI or desktop sessions through an isolated profile. Version 0.5.0 also added compatibility for Codex-backed CLI clients, native Codex image generation, DeepSeek Responses routing, scoped routing policies, and provider credential tests. LiteLLM users get a migration CLI with validation and dry-run planning.

Compatibility is not completeness. The documented surface covers chat, Responses, embeddings, Anthropic messages, and images. Issue #163 confirms that Codex voice chat fails because /v1/live is not implemented. Audio transcription and document reranking have detailed open proposals in issues #183 and #184. An application should inventory the exact endpoints, streaming shapes, usage fields, tool calls, and error behavior it relies on, then run contract tests against every intended route.

That last point matters because translation bugs can affect billing as well as output. Issue #208 describes Anthropic streaming responses that persist upstream cache-hit usage internally but do not return those cache fields to the client. The report is narrow and supplies a proposed fix, yet it shows why protocol conformance deserves tests beyond a successful text response.

The demo is easy, production is infrastructure

The native installer targets Linux systemd on amd64 and arm64, verifies release checksums, generates production secrets, and supports update and rollback. Docker Compose uses a managed container holding the Go backend, Next.js console, and Node runtime. A health-checked first start can be quick once every placeholder secret is replaced.

The default SQLite mode is intended for single-server deployments and the documentation describes it as suitable below 1,000 users. PostgreSQL is recommended for production concurrency and required for multiple backend replicas. The multi-instance Compose option adds Nginx, shared PostgreSQL state, cluster leases, and connection-pool decisions. Every replica must share the same stable encryption key, while SQLite must never be shared between replicas.

The default Compose deployment publishes frontend and backend ports directly and includes no TLS reverse proxy. Production operators need HTTPS termination, trusted-proxy settings, CORS policy, database backup, monitoring, and a recovery plan. Synchronous request and response payloads may be recorded for audit, so retention, disk encryption, database access, and backup permissions are product decisions, not cleanup work for later. PostgreSQL backups use external database tooling; the built-in backup API is SQLite-only.

Provider credentials and some stored payloads are encrypted with the configured TokenHub secret. Project API keys retain digests rather than plaintext. Still, issue #181 shows an important missing enterprise boundary: external secret references are proposed, not shipped. A company that requires Vault, cloud KMS, environment variables, or restricted files as the source of provider secrets should wait or contribute that work instead of assuming the database never receives credentials.

Governance is broad, with boundaries still forming

The architecture includes RBAC, OAuth or OIDC sign-in, project model allowlists, audit trails, usage records, route-attempt logs, billing connectors, and OTLP or Langfuse tracing. Background Responses use a durable queue and encrypted, time-limited job records. These are meaningful controls for teams that otherwise build governance around a thin proxy.

Do not promote open proposals into present features. Issue #158 describes an enterprise MCP gateway as work to build, not a current TokenHub endpoint. Issue #159 asks for a deeper three-layer guardrail pipeline using rules, lightweight detectors, and local semantic models. TokenHub already documents content-security policy entities and request inspection, but the proposed full pipeline should not be treated as delivered.

Project health is strong and maturity is the open question. The repository was created on June 10, 2026, pushed on August 13, and released v0.5.0 on August 7. Its 32 open count combines issues and pull requests. Fresh reports and feature proposals were active in August, and the release notes show contributions from several people. That is excellent velocity over two months, not evidence of years of production stability.

TokenHub deserves a trial when governance and cost ownership matter as much as provider normalization. Its operational documentation is a standout, and the move from SQLite to PostgreSQL is clearly explained. Keep the rollout reversible: validate a pinned release, shadow real traffic, compare usage and costs with provider records, test upgrades on a database copy, and retain a direct-provider escape path.

Alternatives

ProjectWhat it isPick it when
LiteLLMA widely used Python proxy and SDK that normalizes many model providers behind OpenAI-style calls.pick this instead when provider breadth, ecosystem adoption, and a familiar proxy are more important than TokenHub's exact console and governance model.
Portkey AI GatewayAn open-source AI gateway focused on routing, fallbacks, retries, caching, and observability.pick this instead when you want a focused gateway layer and plan to compose identity or cost governance separately.
HeliconeAn open-source platform combining an AI gateway with request observability, cost tracking, and experiments.pick this instead when analytics and model-application observability are the center of the purchase.

What people are saying

  1. [github-trending] astaxie/TokenHub

Sources

  1. TokenHub README
  2. TokenHub deployment guide
  3. TokenHub architecture
  4. TokenHub v0.5.0 release
  5. External secret references proposal
  6. Codex voice endpoint issue
  7. v0.4.0 to v0.5.0 team upgrade issue
  8. Anthropic streaming cache usage issue