IndustryAI infrastructure / API gateway

Ygg Lab Token — API Quota Gateway

Every model call, clear and in control — nine upstream provider types behind a single sk- key, with quota, logs and billing you own.

In short

Ygg Lab Token is YGG's self-built, OpenAI-compatible API quota gateway. It collapses nine upstream provider types into one sk- key and one /v1/chat/completions endpoint. Admins issue per-person keys with spending caps and expiry dates, every call's tokens and cost are logged individually — so teams stop juggling separate top-ups across vendors and always know who spent what.

What the agent takes off people's plates

Core capabilities

01

OpenAI-compatible unified gateway

POST https://token.ygg.com.cn/v1/chat/completions with Authorization: Bearer sk-… — point an existing OpenAI SDK at a new base_url and you are done. Nine upstream types supported: OpenAI, OpenAI-compatible, Anthropic, Azure, Gemini, DeepSeek, Volcengine, Tongyi Qianwen, AWS.

9 upstream types · 1 endpoint

02

Token and quota control

Members create and name their own keys (e.g. "paper experiment"), each with its own spending cap and expiry, switchable on or off at any time. Four visible states — active, expired, exhausted, disabled — so a runaway experiment burns only that one key's quota, never the whole team's wallet.

03

Per-call billing log

Every call records input tokens, output tokens, cost, model and timestamp. The dashboard rolls it up into today's requests, today's spend, cumulative usage, remaining balance, usage trend, model mix, recent calls and active keys — month-end reconciliation stops being an act of memory.

04

Multi-tenancy and group discounts

User management assigns quota, groups members, toggles open registration and sets the default balance for new accounts. Group discounts apply as a multiplier (1 = list price, 0.8 = 20% off), so one set of upstream channels can serve faculty, students and partners at once, each billed on its own terms.

05

Channel management and upstream failover

A single channel accepts a batch of pasted keys, a priority level, a self-hosted or proxy endpoint, automatic model-list discovery per key, and a one-click connectivity test. When an upstream raises prices or throttles you, reorder channel priority — the sk- keys and application code stay untouched.

06

Pricing, wallet and system integration

Model pricing is set per $/1M tokens with input and output priced separately, matching upstream conventions. The wallet supports package top-ups, redemption codes and invoice history, with WeChat Pay Native (public-key verification) and Alipay Face-to-Face RSA2. Downstream products can call POST /api/system/register with a system integration key to auto-provision an account by external user ID and mint a billable sk- token.

Side by side

Self-hosted token gateway vs each vendor's own console vs a public API reseller

DimensionSelf-hosted Ygg Lab TokenEach vendor console, managed separatelyPublic API reseller
Cost roll-upOne wallet, split by person, key and modelN separate invoices and top-ups, merged by handOne invoice, but rates and discounts set by the reseller
Quota controlPer-key cap and expiry, hard stop when exhaustedUsually account-level only — one runaway job drains the teamSub-accounts exist, but granularity follows the reseller's product
Call-level audit trailEvery call logs input/output tokens, model, cost, timestampLog formats and retention differ per vendor, hard to compareLogs exist but live with the reseller; export is limited
Switching upstreamReorder channel priority; sk- keys and code untouchedEdit base_url and keys in each project, with regression costDepends on whether the reseller carries that model
Data ownershipGateway and logs run on your own servers, fully self-hostedRequests go straight to vendors; logs stay on their sideBoth requests and logs pass through a third party

Quantified before / after

Measured impact

Lab lead
BeforeA few hundred dollars topped up at each vendor; nobody could say which project spent it
AfterOne dashboard shows cumulative usage, model mix and spend per key
Researcher / engineer
BeforeHad to chase someone for a key; keys got passed around in group chats
AfterSelf-serve a key named "paper experiment", disable it when done, auto-stop when the cap is hit
Finance / admin
BeforeReconciled several overseas invoices on a foreign-currency card; receipts scattered
AfterTop up the internal wallet via WeChat or Alipay; invoices and redemption codes settle in one place
Platform / ops
BeforeA price hike or throttle meant editing base_url and keys in every project
AfterReorder channel priority in the console — zero downstream code changes

Subjects and capability matrix

Covered modules

Dashboard

Spend · trend · model mix

API keys

Caps · expiry

Call log

Per-call tokens and cost

Wallet

Packages · codes · invoices

Channels

Multi-key · priority · health

Users

Quota assignment · groups

Model pricing

$/1M tokens · in/out separate

Group discounts

Multiplier · 1 = list price

How the agent and human supervision collaborate

System architecture (conceptual)

source

Lab member / downstream app

agent

Token gateway (sk- auth · metering)

human

Admin (channels / pricing / quota)

output

Nine upstream provider types

output

Call log / billing

Flow

  • Lab member / downstream appToken gateway (sk- auth · metering)Bearer sk- request
  • Admin (channels / pricing / quota)Token gateway (sk- auth · metering)Configure channels & quota
  • Token gateway (sk- auth · metering)Nine upstream provider typesRoute by priority
  • Token gateway (sk- auth · metering)Call log / billingMeter every call
  • Call log / billingAdmin (channels / pricing / quota)Usage & cost review

Verifiable facts

Numbers and sources

Nine upstream channel types are supported: OpenAI, OpenAI-compatible, Anthropic, Azure, Gemini, DeepSeek, Volcengine, Tongyi Qianwen and AWS.

Self-reportedBuilt-in channel-type enumeration in the running system, verified 2026-08.2026-08-01

A single OpenAI-compatible endpoint is exposed: POST /v1/chat/completions, authenticated with Authorization: Bearer sk-….

Self-reportedUsage instructions on the live system at token.ygg.com.cn, verified 2026-08.2026-08-01

Model pricing is denominated in $ per 1M tokens, with input and output priced separately.

Self-reportedField definitions of the admin console's Model Pricing module, verified 2026-08.2026-08-01

Group discounts apply as a multiplier: 1 = list price, 0.8 = 20% off.

Self-reportedMultiplier documentation in the admin console's Group Discount module, verified 2026-08.2026-08-01

Default safety thresholds: a balance below $10 triggers a reminder; SMS codes are rate-limited to once per 60 seconds and five per 24 hours; passwords must be at least 8 characters.

Self-reportedDefault notification and account-security policy configuration, verified 2026-08.2026-08-01

Top-ups run on WeChat Pay Native QR (public-key verification mode) and Alipay Face-to-Face (RSA2 signing); SMS goes through Tencent Cloud SMS.

Self-reportedConfigured payment and SMS channels of the wallet module, verified 2026-08.2026-08-01

Delivery and pricing

Pricing

¥98,000Self-hosted perpetual license · single payment

Included

  • · Full self-hosted deployment — gateway core, member workspace and admin console — onto your own servers
  • · Configuration for all nine upstream channel types (OpenAI, OpenAI-compatible, Anthropic, Azure, Gemini, DeepSeek, Volcengine, Tongyi Qianwen, AWS)
  • · The complete admin console: channels, model pricing, group discounts, redemption codes and system integration keys
  • · The user and quota system: sign-up and login, user groups, quota allocation, key management, call logs, dashboard and wallet
  • · Deployment, admin training and one year of technical support

Provided by the client

  • · Servers, cloud instances and database resources
  • · Domain names and HTTPS certificates
  • · API keys and account balances with each upstream vendor
  • · WeChat Pay and Alipay merchant accounts, including their fees
  • · A Tencent Cloud SMS account, signature/template filing and per-message fees

Add-ons

  • · Technical support and version upgrades from year two (annual renewal)
  • · Custom upstream adapters, SSO integration and deeper product integration (billed per person-day)
WeChat consultation QR code

Scan for the full solution document

Scan with WeChat to reach the solution lead and request the complete documentation and deployment checklist.

Where it fits

When this approach does not apply

  • The gateway aggregates and meters; it does not pay for inference. You still bring and top up your own API keys with each upstream vendor.
  • Billing at $/1M tokens depends entirely on the admin entering correct input/output rates and group multipliers. Misconfigure them and the ledger is wrong — upstream price changes must be synced manually.
  • It is an internal quota hub for a lab or team, not a public API marketplace. Selling access to the general public would require separate work on compliance, invoicing and fraud control.
  • Every call takes an extra hop: client → gateway → upstream. Latency depends on both your server and upstream availability, so ultra-low-latency workloads need real measurement first.
Written by: YGG Solutions TeamPublished: 2026-08-01Last reviewed: 2026-08-01