# astaxie/TokenHub

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

Repository: https://github.com/astaxie/TokenHub
Canonical: https://ross.abutalabs.com/products/tokenhub
Homepage: https://thinkinai-labs.github.io/tokenhome/
Language: Go
License: Apache-2.0
License Family: permissive
Topics: ai, ai-gateway, enterprise, gateway
Last push: 2026-09-02T16:00:58+00:00

## Health v2 (maintenance only)
Score: 81/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 100, release rhythm 99, longevity 6
- inputs: {"age_days": 84, "days_push": 0, "days_rel": 8, "gap_med": 9, "n_releases_24m": 4}
- flags: young
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1237, forks 152 (observed 2026-09-03T02:15:09.327014+00:00)

## What it is
TokenHub is a self-hosted enterprise AI gateway written in Go that provides a governance layer over AI model access, including model routing, permission management, token quotas, and cost control. It is OpenAI-compatible and adds usage attribution, budget control, and provider bill reconciliation on top of simple provider fan-out.

## Use cases
- unify access to multiple AI model providers behind one private gateway
- control which teams and projects can use which models and how many tokens
- route model requests by cost, performance, health, and fallback policy
- track and attribute AI token usage to users, teams, and applications
- reconcile internal AI usage against upstream provider bills
- reduce AI spend through caching, quotas, and smarter model selection

## When to choose
- you need enterprise governance, budgets, and cost attribution for AI model usage across many teams
- you want a self-hosted, OpenAI-compatible gateway with routing and access control
- finance and platform teams need to explain and reconcile AI spend against provider invoices

## When to avoid
- you only need a simple developer proxy to fan out requests to multiple providers without governance
- you want a fully managed cloud AI gateway rather than self-hosting
- your usage is a single developer or small team with no need for quotas or attribution

## Facets
- artifact type: service
- maturity: active
- function: api-gateway, llm-inference, auth, rate-limiting, monitoring, analytics, caching, middleware
- domain: large-language-models, self-hosted, developer-tools, apis, security
- platform: self-hosted, go, cross-platform
- tags: ai-gateway, token-governance, model-routing, cost-optimization, usage-attribution, provider-reconciliation, openai-compatible, enterprise, ai-agents, docker, web-server, linux

## Member repositories
- astaxie/TokenHub (main) score 81

## Provenance
- Observed fields: from GitHub, fetched 2026-09-03T02:15:09.327014+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:23:42.100571+00:00, confidence not recorded.
  - readme: https://github.com/astaxie/TokenHub (fetched 2026-09-03T02:15:09.327014+00:00, sha 3ac656a54c4e)
  - homepage: https://thinkinai-labs.github.io/tokenhome/ (fetched 2026-08-29T12:30:36.886538+00:00, sha 2c363513df15)
- Data as of 2026-08-30T08:39:29.467469+00:00.
