# 1. 规则层:零成本快速过滤
·ThisToken.AI·
Use Cases场景案例ThisToken.AI
hit = rule_engine.check(content.text)
if hit.severity == "high":
return AuditResult(auto="reject", reason=hit.reason)
2. AI层:走统一网关,结构化输出
prompt = MODERATION_PROMPT.format(text=content.text)
resp = await ai_gateway.chat(
model="content-moderation-v2",
messages=[{"role": "user", "content": prompt}],
response_format="json",
)
verdict = json.loads(resp.content)
verdict = {"category": "soft_ad", "confidence": 0.72, "evidence": "..."}
3. 置信度路由
if verdict["confidence"] >= 0.9:
return AuditResult(auto="reject" if verdict["category"] != "safe" else "pass")
return AuditResult(auto="pending", queue=verdict["category"])
First week's data after launch: the rules layer intercepted about 12%, AI auto-processed about 65%, and about 23% went to the human queue. Operators averaged 8 seconds per review, handling about 460 items per day in a little over an hour—**compressing manual moderation from over 6 cumulative hours per day down to 1 hour**.
## Why a Unified AI Gateway Is the Key to Lower Maintenance Costs for Small Teams
This is the part I most want to talk about. In the initial version, we called a single vendor's SDK directly, and within two weeks we ran into three issues:
**The model wasn't good enough**. General-purpose chat models were too lenient on soft ad detection, so we needed to switch to a model better at content safety. Because everything went through the unified gateway, switching was just a config change—**it took 15 minutes in practice**; if every call site had the SDK hard-coded, based on past experience it would have taken at least half a day of code changes plus a round of regression testing.
**Rate limiting and retry logic only needs to be written once**. The gateway layer handles timeouts, retries, and rate-limit backoff uniformly, keeping the business code clean—no copy-pasting fault-tolerance logic at every call site. What small teams lack most is people, and this kind of "glue code that every project has to rewrite" is a huge chunk of hidden maintenance cost.
**Cost observability**. The gateway dashboard shows token consumption and costs per use case directly, so month-end reconciliation doesn't require digging through multiple vendor consoles. Based on this, we also switched the high-frequency "pre-screening of obviously normal content" to a cheaper model, sending only suspicious content to the more capable model—**tiered routing cut API monthly costs by another ~40%**.
One-sentence summary: **once the access layer is abstracted, swapping models, adding models, or adjusting the mix are all configuration changes rather than code engineering projects**. For a two-to-three-person team with no dedicated ops, this determines whether the system is "barely running" or "easy to maintain."
## The Numbers After One Month Live
| Item | Before | After |
|---|---|---|
| Moderation latency | 4 hours average | Under 30 seconds average |
| Labor | 2 part-timers / ~8,000 yuan per month | 0.5 / ~2,000 yuan per month |
| API cost | None | ~600 yuan per month |
| Standard consistency | Varied by person | Unified rules, humans only handle edge cases |
Total cost is about 2,600 yuan—one-third of the original; if content volume doubles again, the marginal cost is mostly API fees, no more linear headcount growth. More surprisingly, because moderation results feed back into the rule base, the rules layer interception rate slowly rose from 12% to 17%, and the human queue keeps shrinking.
## Three Lessons for Indie Developers
1. **Don't chase full automation—design confidence-based routing well**. AI compresses the volume, humans handle the edges; that's the most robust cost-efficiency point today;
2. **Structured output is the prerequisite for engineering**—free-text moderation opinions can't drive routing logic;
3. **Go with a unified AI gateway from day one**, even if you're only using one model. Models will definitely change; every day you delay abstracting the access layer is another day of pain during migration.
If you're working on a similar project, or want to quickly integrate multiple large models for content moderation, text processing, and similar scenarios, try this unified AI API gateway—register and go, with multi-model switching and unified billing: https://api.thistoken.ai/register
---
Ready to try it yourself? Sign up at https://api.thistoken.ai/register to get your API key and start building.Token.AI を試してみませんか?
プロジェクトレベルの API Key を作成し、コンソールでチャネルを有効にして、ルーティング、予算、監査ログを設定しましょう。
注册 ThisToken.AI 并获取 API Key