🌐
Unified API Gateway
One app_key across services, unified quota/rate/audit
All Yunjii Stack products (UM/IF/MF/Pay/Up/Studio) share the same app_key auth. Gateway handles rate limiting, quota deduction, audit, CORS. One integration, all-access.
example.http
# 同一 access_token 调用不同服务
# 1. 调用 AI 服务(modelflow)
POST https://mf.yunjii.cn/v1/chat/completions
Authorization: Bearer <access_token>
Content-Type: application/json
{ "model": "gpt-4", "messages": [{"role":"user","content":"hi"}] }
# 2. 调用支付服务
POST https://pay.yunjii.cn/api/v1/pay
Authorization: Bearer <access_token>
{ "amount": 9900, "order_id": "order_xxx" }
# 3. 调用存储服务
POST https://up.yunjii.cn/api/v1/upload
Authorization: Bearer <access_token>
Content-Type: multipart/form-dataCore Features
6 core features, each works standalone
One integration, all access
One app_key across um / if / mf / pay / up / studio
Unified rate limit
Token bucket per app_key, 429 + Retry-After on exceed
Quota deduction
Auto-deduct quota per call, UM unified billing
Call audit
Every call logged (app/user/IP/duration/status)
CORS
allow-origin by tier, free=*, enterprise=whitelist
Unified errors
{error, error_code, message} consistent across services
API Endpoints
Via /api/* call the following endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/quota | Query current app_key quota |
| GET | /api/v1/usage | Query usage statistics |
| POST | /api/v1/apps | Create/manage apps |