git404hub

what is token-hub fr?

xuya-dev/token-hub — explained in plain English

Analysis updated 2026-05-18

16VueAudience · developerComplexity · 4/5LicenseSetup · hard

tl;dr

Self-hosted marketplace that pools spare OpenAI, Anthropic, Google, and DeepSeek quota behind one sk-hub key with usage-based billing.

vibe map

mindmap
  root((TokenHub))
    Inputs
      Upstream API keys
      OpenAI or Anthropic requests
      Redemption codes
    Outputs
      Unified sk-hub key
      Routed model responses
      Earnings cut
    Use Cases
      Share spare AI quota
      Pool model access
      Self host an AI gateway
    Tech Stack
      Java
      Spring Boot
      MySQL
      Redis
      Vue
      Vite

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Self-host a gateway that pools spare OpenAI and Anthropic quota for a team

VIBE 2

Earn a cut by selling unused API quota to other callers under one sk-hub key

VIBE 3

Point the official OpenAI or Anthropic SDK at one endpoint and let TokenHub route it

VIBE 4

Track per-call billing with pre-deduction, settlement, and refund stages

what's the stack?

JavaSpring BootMySQLRedisVueVite

how it stacks up fr

xuya-dev/token-hubshuaizai88/chatbiglomatico/am-mix
Stars161714
LanguageVueVueVue
Setup difficultyhardhardmoderate
Complexity4/54/52/5
Audiencedeveloperpm foundergeneral

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · hard time til it works · 1day+

Needs Java 21, Node 20, MySQL 8, Redis 7, pnpm 10, plus secrets for JWT, AES-GCM encryption, and upstream API keys.

MIT, free to use, modify, and redistribute with attribution.

in plain english

TokenHub is a platform for sharing AI API access. The idea is that some people pay for accounts at OpenAI, Anthropic, Google, or DeepSeek and have spare quota sitting unused. They register that spare quota as a channel on TokenHub. Other people then use one unified key, in the format sk-hub-xxx, to call those models through TokenHub. The channel owner earns a configurable cut, between zero and fifty percent, every time their quota is used. For the caller side, the platform looks like an OpenAI or Anthropic endpoint. The README shows that pointing the official OpenAI or Anthropic SDK at TokenHub, by changing the base URL and API key, is enough to start using it. Behind that single endpoint, TokenHub routes the request to whichever channel has capacity, translates between OpenAI Chat Completions and Anthropic Messages formats when needed, and supports streaming responses through SSE. The billing model is described as three stages: a pre-deduction when the call starts, a real settlement based on actual token usage, and a refund if the call fails. Amounts are tracked in US dollars to eight decimal places. Users can earn free balance through a daily check-in, and admins can generate redemption codes to top up balances in bulk. The backend is Java 21 on Spring Boot 3.3.5, with MyBatis-Plus and Flyway for the database layer, Sa-Token for JWT and API-key authentication, Redis with Redisson for rate limiting and caching, and OkHttp for outbound calls. Upstream keys are stored encrypted with AES-GCM, and user keys are stored as SHA-256 hashes. The frontend is Vue 3 with Vite, TypeScript, Naive UI, UnoCSS, Pinia, and the SoybeanAdmin template. Installation needs Java 21, Node 20, MySQL 8, Redis 7, and pnpm 10. The README shows both a Maven dev-mode launch and a Docker Compose deployment, and lists the production environment variables for JWT secret, encryption key, CORS origins, and database credentials. License is MIT.

prompts (copy fr)

prompt 1
Walk me through deploying TokenHub with Docker Compose and setting the JWT secret and encryption key
prompt 2
Show me how a channel owner registers their OpenAI API key in TokenHub and sets the earnings cut
prompt 3
Help me point the official Anthropic SDK at my TokenHub instance using an sk-hub key
prompt 4
Explain how TokenHub translates between OpenAI Chat Completions and Anthropic Messages while streaming

Frequently asked questions

what is token-hub fr?

Self-hosted marketplace that pools spare OpenAI, Anthropic, Google, and DeepSeek quota behind one sk-hub key with usage-based billing.

What language is token-hub written in?

Mainly Vue. The stack also includes Java, Spring Boot, MySQL.

What license does token-hub use?

MIT, free to use, modify, and redistribute with attribution.

How hard is token-hub to set up?

Setup difficulty is rated hard, with roughly 1day+ to a first successful run.

Who is token-hub for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.