5 protocols · 1 endpoint

Every frontier model, one gatewayBuiltforAICoding

No more juggling multiple vendor accounts and invoices. One API key, one console — every major model behind a single endpoint, with billing, rate limiting and observability built in.

  • Claude Code
  • Codex CLI
  • Cursor
  • Cline
  • Roo Code
  • OpenAI SDK
  • Gemini CLI
  • Cherry Studio

CAPABILITIES

Everything a model gateway should have

Six capabilities covering access, billing, observability and failover — a model foundation you can rely on long-term.

Unified access

Chat, Responses, Messages, Embeddings and Rerank — five protocols on a single endpoint, with async image and audio tasks out of the box.

Transparent billing

Per-model input/output pricing, with quota, transaction and top-up ledgers queryable in real time. Every charge is backed by a request-level audit record.

Real-time observability

Time-to-first-token, success rate and token usage are traceable per request. Trend charts and detail tables share the same source — no reconciliation needed.

Smart routing

Mount multiple channels per model and split traffic by priority and weight, or assign different routing policies per organization.

Automatic failover

Channel health checks trigger automatically; failing channels are removed instantly and traffic shifts to healthy upstreams — no manual babysitting.

Organizations & quotas

API keys are managed per organization, with members, invitations and quota adjustments fully audited — ideal for teams sharing one account pool.

GET STARTED IN 5 MINUTES

Works with official SDKs — zero code changes

Point your base URL at TokenHub, swap in your key, and your existing codebase just works.

curl http://183.240.79.21:52099/v1/chat/completions \n  -H "Authorization: Bearer $YITUOTOKEN_API_KEY" \n  -H "Content-Type: application/json" \n  -d '{
    "model": "gpt-5.2",
    "messages": [{ "role": "user", "content": "Hello" }]
  }'

Works from any language with an HTTP client.

  • Chat/v1/chat/completions
  • Responses/v1/responses
  • Messages/v1/messages
  • Embeddings/v1/embeddings
  • Rerank/v1/rerank

HOW IT WORKS

Four steps behind every request

From key validation to quota settlement, every step leaves a trace — so issues can be pinned to the exact stage.

  1. 01

    Auth & ownership

    Validate the API key and resolve its organization and model scope.

  2. 02

    Route selection

    Pick an available upstream among the channels serving the model, by priority and weight.

  3. 03

    Forward & fail over

    Translate to the upstream protocol, stream back the response, and retry on unhealthy channels automatically.

  4. 04

    Meter & audit

    Settle quota via billing expressions, deduct atomically, and write request and audit logs.

BILLING & OBSERVABILITY

Every charge reconciles

  • Input and output are priced separately, published in the model catalog
  • Quota, transaction and top-up ledgers stay mutually consistent
  • Admin quota adjustments are written to the audit log for traceability
  • New requests require a positive effective balance — no silent overruns

SECURITY & COMPLIANCE

Keys never leak, actions are traceable

  • Upstream keys are encrypted at rest with AES-256-GCM; plaintext never leaves the trust boundary
  • Sessions use dual tokens: short-lived access + long-lived refresh
  • All sensitive operations are audit-logged and filterable by action type
  • Host allowlists and cross-site request origin checks are enforced at the deployment layer

FAQ

Things you may want to know first

Do I need to change my existing code?

No. Just point your base URL at TokenHub and swap in your key. With both the OpenAI and Anthropic official SDKs, only the initialization parameters change — your business calls stay as they are.

Is streaming supported?

Yes. Streaming and non-streaming go through the same gateway core. Time-to-first-token and total duration are recorded per request and visible on the usage page.

What happens when an upstream goes down?

Channel health checks trigger automatically, unhealthy channels are removed, and requests are served by other healthy channels for the same model. If a model truly has no healthy channel, requests fail fast instead of hanging.

How is billing accuracy guaranteed?

All quota math is centralized in the billing engine and settled via expressions. Deductions use atomic updates keyed by a unique request ID, preventing double-charges or balance overflows under concurrency.

What happens when my balance runs out?

New requests are rejected upfront if the effective balance is insufficient. If upstream costs have already been incurred, the settlement stage allows the balance to go negative, and the debt is offset by your next top-up.

How do I manage a team?

Members and keys are managed per organization. You can invite members, switch the active organization, and assign routing policies per organization, with quota consumption aggregated at the organization level.

One key, every model

Check live pricing in the model marketplace, then sign in and create a key to start calling.