Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d1ba579
feat: add native TypeSafe Jev System One support
aofee Sep 20, 2026
0da18e4
feat(admin): inline quick-adjust stepper for account priority
william-drakemond Sep 27, 2026
58d6050
fix(admin): keep disabled priority stepper hidden until hover
william-drakemond Sep 27, 2026
cf19f30
fix(payment): rate-limit anonymous public order verify endpoint
william-drakemond Sep 28, 2026
d359196
fix(antigravity): sanitize upstream error body before returning to cl…
william-drakemond Sep 28, 2026
b1ce3c6
fix(email): atomic verify-code attempts and hashed single-use reset t…
william-drakemond Sep 28, 2026
42bc7f6
chore: sync VERSION to 0.2.11 [skip ci]
github-actions[bot] Sep 30, 2026
2e3c2cf
fix(i18n): correct the custom error codes warning text
william-drakemond Sep 30, 2026
0094074
fix(deps): upgrade axios to 1.20.0 to pass security audit
william-drakemond Sep 30, 2026
fdce5b8
修复 Grok CLI 版本门槛并对齐官方无界面请求头
lyen1688 Oct 1, 2026
ad05eda
依据正常交互式 CLI 抓包修正 Grok 身份头
lyen1688 Oct 1, 2026
5315858
升级 Axios 至 1.20.0 修复前端安全审计
lyen1688 Oct 1, 2026
d6adebd
Merge pull request #7780 from lyen1688/fix/grok-cli-identity-1-0-46
Wei-Shaw Oct 1, 2026
1b1039f
feat(payment): 充值赠送阶梯(按金额档位额外赠送到账额度)
feeeei Oct 1, 2026
1aa34d4
feat(payment): 充值优惠阶梯支持折扣模式,快捷金额角标改为促销价签
feeeei Oct 1, 2026
0cecf3c
feat(keys): support sorting API keys by group name
william-drakemond Oct 1, 2026
7225538
merge: sync Jev support with latest upstream main
aofee Oct 2, 2026
bb97ab3
fix(typesafe): align System One validation with upstream schema
aofee Oct 2, 2026
2d8a386
fix(typesafe): 补齐平台迁移、审计覆盖、端点隔离与错误策略
Wei-Shaw Oct 2, 2026
9eb394e
fix(typesafe): 堵住校验解析差异与审计盲区,收紧模型列表口径
Wei-Shaw Oct 2, 2026
fa49647
test(model): 错误透传平台列表守卫纳入 typesafe
Wei-Shaw Oct 2, 2026
34fe845
Merge pull request #7425 from aofee/codex/jev-system-one
Wei-Shaw Oct 2, 2026
5637f46
Merge pull request #7802 from feeeei/feat/recharge-promotion-tiers
Wei-Shaw Oct 2, 2026
f3dc083
Merge pull request #7673 from william-drakemond/fix/public-order-veri…
Wei-Shaw Oct 2, 2026
7190130
Merge pull request #7803 from william-drakemond/feat/api-key-group-sort
Wei-Shaw Oct 2, 2026
43c4c88
Merge pull request #7674 from william-drakemond/fix/antigravity-sanit…
Wei-Shaw Oct 2, 2026
2529371
Merge pull request #7676 from william-drakemond/fix/email-code-token-…
Wei-Shaw Oct 2, 2026
46f5f5e
Merge pull request #7773 from william-drakemond/fix/custom-error-code…
Wei-Shaw Oct 2, 2026
5106065
Merge pull request #7630 from william-drakemond/feat/account-priority…
Wei-Shaw Oct 2, 2026
a29346e
merge: integrate Sub2API v0.2.12 while preserving Zero One contracts
XiaoSiKe Oct 2, 2026
5852924
fix: keep platform quotas coherent and verify v0.2.12 integration
XiaoSiKe Oct 2, 2026
0a614bc
test(ui): align the reviewed mobile v0.2.12 version badge
XiaoSiKe Oct 2, 2026
64e04eb
docs(ui): pin reviewed v0.2.12 source and version snapshots
XiaoSiKe Oct 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/scripts/ui-baseline.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schema_version": 1,
"baseline_ref": "ui-approved-2026-10-01-v0211-version-badge",
"baseline_commit": "be36f46044301526977db2a2800dfb6be0f01de7",
"baseline_ref": "ui-approved-2026-10-02-v0212-version-badge",
"baseline_commit": "0a614bcb02f258881e466f75e3198bfbdf6c843b",
"protected_paths": [
"landing/",
"frontend/",
Expand Down
7 changes: 7 additions & 0 deletions .github/scripts/verify-upstream-boundary.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ test('allows named immutable exceptions while adjacent seam files still fail', (
'frontend/src/api/admin/affiliates.ts',
'frontend/src/api/admin/ops.ts',
'frontend/src/api/__tests__/admin.affiliates.spec.ts',
'frontend/src/api/__tests__/settings.authSourceDefaults.spec.ts',
'frontend/src/api/__tests__/admin.users.spec.ts',
'frontend/src/api/admin/redeem.ts',
'frontend/src/api/__tests__/admin.redeem.spec.ts',
Expand Down Expand Up @@ -926,6 +927,12 @@ test('allows named immutable exceptions while adjacent seam files still fail', (
path: 'frontend/src/api/admin/ops.ts',
immutable_path: 'frontend/src/api/',
},
{
name: 'public-capabilities-auth-source-quota-type-regression',
owner: 'Public Capabilities',
path: 'frontend/src/api/__tests__/settings.authSourceDefaults.spec.ts',
immutable_path: 'frontend/src/api/',
},
],
)
})
Expand Down
42 changes: 27 additions & 15 deletions .github/upstream-baseline.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"schema_version": 5,
"repository": "Wei-Shaw/sub2api",
"release": "v0.2.11",
"commit": "96f4c115c9749078f90cbf210a01d39baf3f53b6",
"release": "v0.2.12",
"commit": "5106065716e494204fc0e8db16f68f6e9d576be0",
"upstream_sync": {
"previous_release": "v0.2.8",
"previous_commit": "fd80b08c90b55edcad5b00171b53f08721d30da1",
"product_commit": "ce899e5ae03cf4265855022a54d2d1ef5b5c5a68",
"merge_commit": "9d9aecbb860b8bceb1ae0c031a7c77f08c7b3d83"
"previous_release": "v0.2.11",
"previous_commit": "96f4c115c9749078f90cbf210a01d39baf3f53b6",
"product_commit": "6a540fca7db34220add8d4c6a2f71f1d8ea61617",
"merge_commit": "a29346e2dd0406fa2c82bc3102ba804884f88f98"
},
"approved_backports": [],
"preserve_bytes_on_upstream_sync": [
Expand Down Expand Up @@ -1315,7 +1315,10 @@
"docs/upgrades/v0.2.11.md",
"docs/upgrades/v0.2.11-change-map.json",
"backend/internal/service/account_stats_pricing_test.go",
"backend/internal/service/billing_inflight_reservation_test.go"
"backend/internal/service/billing_inflight_reservation_test.go",
"docs/upgrades/v0.2.12-change-map.json",
"docs/upgrades/v0.2.12.md",
"frontend/src/api/__tests__/settings.authSourceDefaults.spec.ts"
],
"retired_preserved_paths": [
{
Expand Down Expand Up @@ -1874,7 +1877,7 @@
"legacy_hotfixes": [
{
"name": "approved-v0.1.179-production-correctness-and-billing-compatibility",
"valid_for_release": "v0.2.11",
"valid_for_release": "v0.2.12",
"exit_condition": "Remove each path when the first stable upstream release containing its equivalent production-correctness fix becomes the baseline; remove the entire block when no listed path remains.",
"paths": [
"backend/internal/handler/admin/admin_basic_handlers_test.go",
Expand Down Expand Up @@ -1904,15 +1907,15 @@
},
{
"name": "approved-v0.1.179-version-metadata-alignment",
"valid_for_release": "v0.2.11",
"valid_for_release": "v0.2.12",
"exit_condition": "Remove this metadata alignment when the first stable upstream release makes backend/cmd/server/VERSION match the baseline release.",
"paths": [
"backend/cmd/server/VERSION"
]
},
{
"name": "approved-v0.1.179-race-safety",
"valid_for_release": "v0.2.11",
"valid_for_release": "v0.2.12",
"exit_condition": "Remove each path when the first stable upstream release contains the equivalent race-safe runtime cache and asynchronous test fixture handling.",
"paths": [
"backend/internal/service/content_moderation.go",
Expand All @@ -1927,23 +1930,23 @@
},
{
"name": "approved-v0.1.179-remove-unconditional-sticky-debug-logs",
"valid_for_release": "v0.2.11",
"valid_for_release": "v0.2.12",
"exit_condition": "Remove this hotfix when the first stable upstream release removes or explicitly gates the equivalent per-request sticky-session debug logs.",
"paths": [
"backend/internal/service/gateway_scheduling.go"
]
},
{
"name": "approved-v0.1.181-grok-mapping-test-isolation",
"valid_for_release": "v0.2.11",
"valid_for_release": "v0.2.12",
"exit_condition": "Remove this hotfix when the first stable upstream release contains equivalent runtime model-mapping isolation in the canonical scheduling test.",
"paths": [
"backend/internal/service/openai_model_mapping_test.go"
]
},
{
"name": "approved-v0.1.182-go-dependency-security-updates",
"valid_for_release": "v0.2.11",
"valid_for_release": "v0.2.12",
"exit_condition": "Remove this hotfix when the first stable upstream release uses golang.org/x/image v0.45.0 or later, Testcontainers v0.44.0 or later, github.com/moby/go-archive v0.3.0 or later, and no longer depends on github.com/docker/docker.",
"paths": [
"backend/go.mod",
Expand All @@ -1955,7 +1958,7 @@
},
{
"name": "approved-v0.2.7-sse-keepalive-test-determinism",
"valid_for_release": "v0.2.11",
"valid_for_release": "v0.2.12",
"exit_condition": "Remove this hotfix when the first stable upstream release makes the ordinary-client SSE keepalive test tolerate a comment payload and at least two ticker periods of runner scheduling delay.",
"paths": [
"backend/internal/service/gemini_sse_comment_compat_test.go"
Expand Down Expand Up @@ -2594,7 +2597,10 @@
"docs/upgrades/v0.2.11.md",
"docs/upgrades/v0.2.11-change-map.json",
"backend/internal/service/account_stats_pricing_test.go",
"backend/internal/service/billing_inflight_reservation_test.go"
"backend/internal/service/billing_inflight_reservation_test.go",
"docs/upgrades/v0.2.12-change-map.json",
"docs/upgrades/v0.2.12.md",
"frontend/src/api/__tests__/settings.authSourceDefaults.spec.ts"
]
},
{
Expand Down Expand Up @@ -2847,6 +2853,12 @@
"owner": "Public Capabilities",
"path": "frontend/src/api/admin/ops.ts",
"immutable_path": "frontend/src/api/"
},
{
"name": "public-capabilities-auth-source-quota-type-regression",
"owner": "Public Capabilities",
"path": "frontend/src/api/__tests__/settings.authSourceDefaults.spec.ts",
"immutable_path": "frontend/src/api/"
}
]
}
2 changes: 1 addition & 1 deletion CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ _Avoid_: 普通用户、站长账号
_Avoid_: User、客户账号

**Provider Platform Catalog(供应商平台目录)**:
Provider Account、分组筛选、渠道定价、渠道监控、运维筛选、订阅筛选、错误透传规则与 Composite 路由目标共同使用的有序一等平台集合;新增平台必须在一个目录中同时进入这些管理入口。它不同于模型白名单,Qwen、Mistral 等模型名称不自动成为 Provider Account 平台。
Provider Account、分组筛选、渠道定价、渠道监控、运维筛选、订阅筛选、错误透传规则与 Composite 路由目标共同使用的有序一等平台集合;新增平台必须在一个目录中同时进入这些管理入口。它不同于模型白名单,Qwen、Mistral 等模型名称不自动成为 Provider Account 平台。TypeSafe / Jev System One 是原生结构化判定平台,不是对话端点,因此不进入主动渠道监控的探测子集。
_Avoid_: 模型白名单、各页面复制的平台数组、任意 OpenAI 兼容模型列表

**API Key(密钥)**:
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,31 @@ Administrators can override automatic media eligibility through the account crea

---

## TypeSafe / Jev Support

Sub2API supports TypeSafe API-key accounts through Jev's native, non-streaming System One protocol.

- Platform: `typesafe`; account type: API Key
- Default upstream: `https://api.typesafe.ai`
- Public endpoint: `POST /v1/systemone`
- Model: `jev-latest`, also returned by `/v1/models` for TypeSafe groups
- Questions: `noul`, `choice`, and `score`

Requests and successful responses retain the native System One JSON structure. This endpoint is not compatible with Chat Completions, Responses, Anthropic Messages, or streaming clients.

Question validation follows the TypeSafe OpenAPI wire schema (also used by SDK v0.5.7). `instructions` may be omitted or `null` for all question types. Noul `criteria` may be omitted or `null`; its `true`/`false` descriptions and Choice descriptions accept strings, objects, arrays, or `null`. Score `criteria` must be a non-empty array of string, object, or array descriptions; a single level is valid. SDK integer-keyed Score maps are normalized to arrays by the SDK before sending.

```bash
curl https://your-sub2api.example.com/v1/systemone \
-H 'Authorization: Bearer sk-your-sub2api-key' \
-H 'Content-Type: application/json' \
--data '{"model":"jev-latest","state":"Text to evaluate","questions":{"safety":{"type":"noul","instructions":"Evaluate whether the text is unsafe"}}}'
```

The built-in `jev-latest` price is `$0.042` per million input tokens and `$0` for output tokens. Channel pricing can override both values. Credential, billing, permission, rate-limit, overload, server, and network failures (`401`, `402`, `403`, `429`, `529`, `5xx`, transport errors) use the existing account error policy (including custom error codes and temporary-unschedulable rules) and fail over to another account; request errors (`400`, `413`, and `422`) are returned without retrying another account and never change account state. TypeSafe groups (and Composite requests routed to TypeSafe) reject Messages, Chat Completions, Responses, and count_tokens requests with `404`.

---

## Antigravity Support

Sub2API supports [Antigravity](https://antigravity.so/) accounts. After authorization, dedicated endpoints are available for Claude and Gemini models.
Expand Down
25 changes: 25 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,31 @@ go generate ./cmd/server

---

## TypeSafe / Jev 使用说明

Sub2API 支持使用 TypeSafe API Key 账户,通过 Jev 原生、非流式的 System One 协议调用模型。

- 平台:`typesafe`;账号类型:API Key
- 默认上游:`https://api.typesafe.ai`
- 对外端点:`POST /v1/systemone`
- 模型:`jev-latest`,TypeSafe 分组的 `/v1/models` 也会返回该模型
- 问题类型:`noul`、`choice`、`score`

请求和成功响应保持 System One 原生 JSON 结构。该端点不兼容 Chat Completions、Responses、Anthropic Messages 或流式客户端。

问题校验遵循 TypeSafe OpenAPI 的线上协议 schema(SDK v0.5.7 也使用该 schema)。所有问题的 `instructions` 都可以省略或为 `null`。Noul 的 `criteria` 可以省略或为 `null`,其中 `true`/`false` 的描述和 Choice 描述支持字符串、对象、数组或 `null`。Score 的 `criteria` 必须是至少包含一档描述的数组,每档支持字符串、对象或数组;单档也合法。SDK 的整数键 Score 映射会由 SDK 在发送前转换为数组。

```bash
curl https://your-sub2api.example.com/v1/systemone \
-H 'Authorization: Bearer sk-your-sub2api-key' \
-H 'Content-Type: application/json' \
--data '{"model":"jev-latest","state":"待评估文本","questions":{"safety":{"type":"noul","instructions":"评估文本是否不安全"}}}'
```

`jev-latest` 内置价格为输入 `$0.042/百万 tokens`、输出 `$0`,渠道定价可以覆盖。凭据、欠费、权限、限流、过载、服务端和网络错误(`401`、`402`、`403`、`429`、`529`、`5xx`、传输错误)沿用现有账号错误策略(含自定义错误码与临时不可调度规则)并切换账号;请求错误(`400`、`413`、`422`)不会切换账号重试,也不会改变账号状态。TypeSafe 分组(以及路由到 TypeSafe 的 Composite 请求)调用 Messages、Chat Completions、Responses、count_tokens 时返回 `404`。

---

## Antigravity 使用说明

Sub2API 支持 [Antigravity](https://antigravity.so/) 账户,授权后可通过专用端点访问 Claude 和 Gemini 模型。
Expand Down
2 changes: 1 addition & 1 deletion backend/cmd/server/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.11
0.2.12
19 changes: 10 additions & 9 deletions backend/ent/migrate/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading