DeveloperCore APIs
OAuth 2.1 · OIDC · API Gateway · Billing. One integration, all platforms.
OAuth 2.1 Authorization
Authorization Code + PKCE, zero secret leakage
Open platform standard OAuth 2.1 authorization code flow. SPA / mobile / iframe all use PKCE, no client secret exposure. state prevents CSRF, 5-minute code cache prevents replay.
Key Endpoints
# 1. 引导用户授权
GET /oauth/authorize?
response_type=code&
client_id=YOUR_APP_KEY&
redirect_uri=https://yourapp.com/callback&
scope=openid%20profile&
state=RANDOM_STATE&
code_challenge=BASE64URL(SHA256(verifier))&
code_challenge_method=S256
# 2. 回调接收 code,换 token
POST /oauth/token
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code&
code=AUTH_CODE&
redirect_uri=https://yourapp.com/callback&
client_id=YOUR_APP_KEY&
code_verifier=ORIGINAL_VERIFIER
# 3. 调用 API(Bearer JWT)
GET /oauth/userinfo
Authorization: Bearer <access_token>OIDC Identity Layer
id_token direct verification, cross-app zero-trust identity
OpenID Connect layers identity on top of OAuth 2.1. id_token is JWT with user claims, apps verify locally without calling UM. scope=openid profile email.
Key Endpoints
# 请求 id_token(scope 含 openid)
GET /oauth/authorize?
response_type=code&
client_id=YOUR_APP_KEY&
scope=openid%20profile%20email&
...
# token 响应含 id_token
{
"access_token": "eyJ...",
"token_type": "Bearer",
"expires_in": 3600,
"id_token": "eyJ...", // JWT,含用户声明
"scope": "openid profile email"
}
# id_token 载荷(JWT decode)
{
"iss": "https://um.yunjii.cn",
"sub": "umid_8x4k...",
"aud": "YOUR_APP_KEY",
"exp": 1730000000,
"iat": 1729996400,
"nickname": "张三",
"picture": "https://..."
}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.
Key Endpoints
# 同一 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-dataBilling & Quota
UM unified billing, IF/MF pass-through, clear tiers
All service quota/deduction/tiers managed by UM. free keeps branding, white_label removes branding ¥999/year, enterprise custom. No interruption on exceed, monthly settlement.
Key Endpoints
// 查询当前配额
GET /api/v1/quota
Authorization: Bearer <access_token>
// 响应
{
"code": 1,
"data": {
"tier": "white_label",
"quota": {
"calls_remaining": 48392,
"calls_limit": 50000,
"reset_at": "2026-08-01T00:00:00Z"
},
"usage_this_month": {
"um": 8234,
"modelflow": 23410,
"payment": 142,
"storage": 98
}
}
}
// 计费档位
// free: 60 req/min, 1k req/day, 保留版权
// white_label: 600 req/min, 50k req/mo, 去版权
// enterprise: 协商, 无限, SLA 99.9%Pick a capability, integrate in 5 minutes
Each module works standalone; together they form a complete identity infrastructure. Read the docs to start.