← Research Notes中文
Business · 9 min read · Light read

Token Relay Stations: The Architecture, Market, and Trust Crisis of the AI API Resale Ecosystem

A breakdown of the "Token relay station" ecosystem that sits between apps and the upstream large-model providers: how it uses open-source gateways to aggregate multiple APIs, how it makes money, and the trust crisis exposed by a 2026 security paper — nearly half of the tested endpoints silently swapping models — along with ways to protect yourself.

On top of the large-model APIs, a gray-market yet thriving layer of infrastructure has quietly grown up: the Token relay station (API Relay Station). It sits between your app and upstream providers like OpenAI, Anthropic, and Google, aggregating multiple APIs into a single unified entry point while also handling billing, quotas, and the problem of "no direct connection from inside China." It sounds like nothing more than an ordinary gateway — but once a 2026 security paper revealed that "nearly half of the tested endpoints were silently swapping models," this invisible piece of middleware became worth taking apart in earnest.

This article walks the ecosystem all the way from its business logic and technical architecture down to its most fatal problem: trust. As a study of a technical ecosystem, it neither recommends nor endorses any commercial resale service — quite the opposite: the further you read, the clearer it becomes why you should treat them with caution.

1. What it actually is

A Token relay station is an intermediate gateway deployed between the user's app and the upstream AI provider. At its core it does four things:

The business logic is simple: operators buy API credits in bulk from official sources or channels, then resell them to downstream users through a self-built platform at a markup or at cost, pocketing the spread and service fees. The technical bar is low and the demand is real, so the whole space has quickly filled up with open-source projects and commercial sites.

2. The open-source projects in the ecosystem

The "de facto standard" in this space comes from two Chinese open-source projects; nearly every commercial relay station is built on them or on a fork of them.

ProjectTech stackPositioning
One APIGo + React + SQLite/MySQLThe pioneer; 25+ providers; load balancing, key rotation, quota management, redemption codes, multiple OAuth options; MIT license
New APIEnhanced fork of One APIModern UI, multi-language, online payments, visual dashboard, OpenAI↔Claude / OpenAI→Gemini format conversion, Realtime and reasoning-parameter support

Around these two cores, a batch of special-purpose tools has emerged: schemes that turn a personal subscription (Claude, OpenAI, etc.) into an API and "carpool" to split the cost; a "relay station for relay stations" that aggregates several relay-station accounts back into a single key and does smart routing; and browser extensions that manage balances and daily check-ins across multiple sites. On the front-end side, lightweight chat UIs pointed straight at a relay endpoint are common.

Internationally, mature gateways with similar positioning include LiteLLM (the most widely adopted worldwide, 100+ providers), Portkey Gateway (200+ routes plus AI guardrails), and the performance-obsessed Bifrost. Their biggest difference from the Chinese ecosystem is that they emphasize observability, guardrails, and enterprise-grade compliance rather than "resale arbitrage."

3. Technical architecture

Abstractly, a relay station is just a reverse proxy with business logic bolted on:

[User app] --> [Relay station] --> [Upstream providers]
                  |                           |-- OpenAI / Azure OpenAI
                  |-- Auth & token check      |-- Anthropic Claude
                  |-- Rate limiting           |-- Google Gemini
                  |-- Key pooling & rotation  |-- DeepSeek / domestic models
                  |-- Load balancing & failover
                  |-- Usage tracking & billing
                  |-- Request/response format conversion
                  |-- Caching (optional Redis) / model mapping

A few key components are worth understanding on their own:

4. Deployment and setup

Because the open-source projects are so well packaged, the deployment bar is pushed very low. The most common starting point is a single Docker command:

docker run --name one-api -d --restart always \
  -p 3000:3000 -e TZ=Asia/Shanghai \
  -v /path/to/data:/data \
  justsong/one-api

In production, people usually switch to a MySQL/PostgreSQL + Redis Compose setup; some use Cloudflare Workers as a zero-cost lightweight proxy, or a one-click install via the BaoTa (宝塔) panel aimed at non-technical users. The setup flow is much the same everywhere: deploy → log into the admin panel and immediately change the default password → configure upstream channels (enter the key, pick the type, set the Base URL and priority) → create downstream tokens (quota, expiry, model restrictions, IP allowlist) → put an Nginx reverse proxy plus HTTPS in front → smoke test.

There is one easily overlooked detail that is critical to the streaming experience: the reverse proxy must turn off buffering, otherwise SSE streaming output will stall.

location / {
    proxy_pass http://localhost:3000;
    proxy_set_header Host $host;
    proxy_buffering off;   # SSE streaming requires buffering off
}

5. Market and monetization

The resale model shapes the commercial form of this space. From what's visible on the open market, the common monetization methods fall into a few rough categories: prepaid credit/points systems (deducted by usage — the mainstream), bulk redemption codes, tiered-quota subscriptions, a straight per-token markup (profiting on exchange rates and price spreads), and group-based differential pricing that assigns different rate multipliers to different user groups. Payments mostly run through Alipay, WeChat, Stripe, or cryptocurrency.

Price differences are exactly what expose the tiers of channel quality. Roughly speaking, the quotes on the market can be split into three tiers:

Channel typeRelative priceCharacteristics
Reverse-engineered / low-cost channelLowestSimulates a browser session, unstable, may silently swap models, often no Function Calling support
Azure channelMediumFairly stable, but may come with content filtering
Official forwardingClose to official pricingMost stable and reliable, full functionality

In other words, a price well below the official rate is usually not "operator charity" but a discount on quality or legality. And that leads naturally to the sharpest question in the whole ecosystem.

6. The most fatal problem: model fraud

In 2026, a CISPA paper, Real Money, Fake Models: Deceptive Model Claims in Shadow APIs, systematically audited these "shadow APIs," and its conclusions are rather glaring:

Paper findings

Among the tested endpoints, about 45.83% exhibited model substitution — you pay for GPT-4-Turbo but get back the response of a cheaper model, with a price gap of up to 10–50×. Even more worrying, the study traced 187 academic papers that used these shadow APIs, roughly 60% of them published at top venues like ACL, CVPR, and ICLR — meaning a body of research conclusions rests on "models of unknown provenance."

The paper also notes that most of the audited shadow APIs are built on the open-source projects mentioned above, and the vast majority lack a legal entity, business registration, or ICP filing. In other words, the technology of this infrastructure layer is transparent, while the business entities behind it are often invisible.

7. Security and legal risks

Model fraud is only the tip of the iceberg. Handing your requests to an unconstrained middleman inherently entails several kinds of structural risk:

8. If you must use one, how to protect yourself

Setting the operator's perspective aside, from the user's angle alone, there are a few low-cost ways to tell channels apart that can markedly reduce the odds of being served a "reskinned, swapped-out model":

For the operator side, prioritizing reliable official forwarding, using low-cost channels only as a fallback, combined with channel-availability health checks, auto-disabling failed channels, and Redis-based rate limiting and alerting, is the basic discipline for taking something from "it runs" to "it can be trusted."

Conclusion

The Token relay station is a textbook case of "mature technology, absent governance": open-source projects let anyone stand up a multi-model gateway in a few minutes, and it is precisely this low bar that has spawned a gray market where the prices are tempting but trust is thin. Its value is beyond doubt — aggregation, failover, and unified formats are all real needs; but when the middleman can both see all your data and quietly swap out the model you paid for, the word "cheap" deserves to be weighed again. Understanding its architecture is about staying a bit more clear-eyed when you choose: on the chain of AI infrastructure, what you trust is not just the model, but every hop in between.

Amos · research.xishe.ai · Please credit when sharing