Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
d1ba579
feat: add native TypeSafe Jev System One support
aofee Sep 20, 2026
b13200d
fix(gateway): forward received chat stream usage
wucm667 Sep 19, 2026
ece1ecc
fix(gateway): normalize streamed Anthropic usage
wucm667 Sep 21, 2026
0416c9e
fix(gateway): avoid ambiguous late-cache input subtraction
wucm667 Sep 23, 2026
13fcfc0
fix(gateway): resolve composite routes for websocket aliases
wucm667 Sep 19, 2026
e878ab7
fix(gateway): constrain account model route ownership
wucm667 Sep 21, 2026
453b796
fix(gateway): enforce composite model ownership in legacy scheduling
wucm667 Sep 23, 2026
e2c35cf
fix(account): prevent whitelist model mapping conflicts
wucm667 Sep 23, 2026
b31b435
fix(gateway): Claude Code 限制分组的 OpenAI 兼容入口改走降级分组,不再直接 403
feeeei Sep 24, 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
9a62841
chore: sync VERSION to 0.2.9 [skip ci]
github-actions[bot] Sep 28, 2026
bd48b2b
fix(antigravity): keep compat streams alive before first content
wucm667 Sep 28, 2026
aa3a3ea
feat(dashboard): toggle recent usage between tokens and spending
wucm667 Sep 28, 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
2840cde
feat(frontend): hide unsupported clients for Claude Code-only groups
PMExtra Sep 23, 2026
6a69dd0
feat: add risk control user allowlist
PMExtra Sep 24, 2026
6073704
fix: omit Codex model catalog for OpenAI groups
PMExtra Sep 23, 2026
43f88c9
fix(billing): reserve in-flight balance to prevent concurrent overdraft
william-drakemond Sep 28, 2026
52c123e
fix(billing): hold inflight reservation until billing lands; price es…
william-drakemond Sep 28, 2026
652a7d7
fix(billing): estimate unpriced aliases via billing fallback models; …
william-drakemond Sep 28, 2026
8490a81
feat: support Claude Sonnet 5.5
StarryKira Sep 28, 2026
b886fb8
fix(billing): read account-level mappings from scheduler snapshot onl…
william-drakemond Sep 28, 2026
475c083
style: gofmt
william-drakemond Sep 28, 2026
2cc459e
style: satisfy Sonnet 5.5 lint checks
StarryKira Sep 28, 2026
6a8f921
feat(claude): expose sanitized native reset credit status
korkin25 Sep 24, 2026
f8984b8
feat(accounts): show Claude reset credit status on demand
korkin25 Sep 24, 2026
48970f6
fix(claude): explicitly close status HTTP response
korkin25 Sep 24, 2026
421da3f
feat(accounts): align Claude reset credit query with Codex reset coun…
william-drakemond Sep 28, 2026
35232c3
fix(accounts): address review of Claude reset credit count
william-drakemond Sep 28, 2026
860782e
fix(claude): harden reset credit projection and cell state (review R2)
william-drakemond Sep 29, 2026
27a9421
fix(anthropic): rewrite tool names in one body pass
wucm667 Sep 29, 2026
dd6cb41
Merge pull request #7683 from StarryKira/codex/sonnet-5-5-upstream
Wei-Shaw Sep 29, 2026
1dca86f
Merge pull request #7701 from wucm667/fix/issue-7699-tool-rewrite
Wei-Shaw Sep 29, 2026
b35a611
Merge pull request #7646 from wucm667/feat/issue-7642-dashboard-spend…
Wei-Shaw Sep 29, 2026
883a53f
Merge pull request #7643 from wucm667/fix/issue-7637-antigravity-comp…
Wei-Shaw Sep 29, 2026
f50b99b
Merge pull request #7542 from wucm667/fix/model-whitelist-mapping-con…
Wei-Shaw Sep 29, 2026
ccb027b
Merge pull request #7378 from wucm667/fix/issue-7368-composite-ws-rou…
Wei-Shaw Sep 29, 2026
1f955af
Merge pull request #7380 from wucm667/fix/issue-7377-forward-stream-u…
Wei-Shaw Sep 29, 2026
052e08e
Merge pull request #7684 from william-drakemond/feat/claude-reset-cre…
Wei-Shaw Sep 29, 2026
41dcfec
Merge pull request #7680 from PMExtra/fix/openai-model-catalog
Wei-Shaw Sep 29, 2026
fe9dadf
Merge pull request #7679 from PMExtra/feat/risk-control-allowlist
Wei-Shaw Sep 29, 2026
2f3fed2
Merge pull request #7678 from PMExtra/feat/claude-code-only-client-tabs
Wei-Shaw Sep 29, 2026
a60a295
chore: sync VERSION to 0.2.10 [skip ci]
github-actions[bot] Sep 29, 2026
196b477
feat(claude): redeem native limit resets with server-selected grant
william-drakemond Sep 29, 2026
1872d44
feat(accounts): add confirmed Claude reset button next to reset count
william-drakemond Sep 29, 2026
dc2efc6
fix(claude): tighten reset redeem outcome handling (review R1)
william-drakemond Sep 29, 2026
514ad0a
fix(accounts): readable window labels in Claude reset confirm (review…
william-drakemond Sep 29, 2026
9688571
feat(models): support GPT-6.1 Sol
lyy0709 Sep 29, 2026
c91bb61
feat(codex): recognize current subscription plans
lyy0709 Sep 29, 2026
e6d191a
fix(openai): support Astra Ultrafast capabilities and pricing
lyy0709 Sep 29, 2026
b5efbe3
feat(codex): support remote model catalogs in client config
lyy0709 Sep 29, 2026
a0f41f9
Merge pull request #7579 from feeeei/fix/claude-code-only-fallback-op…
Wei-Shaw Sep 30, 2026
9ecb340
feat(api-key): 增加 API Key 创建数量与频率限制
Wei-Shaw Sep 30, 2026
017bbcb
chore(api-key): 创建频率默认值调整为每小时 60 次
Wei-Shaw Sep 30, 2026
b0cfff9
Merge pull request #7752 from Wei-Shaw/fix/api-key-create-limits
Wei-Shaw Sep 30, 2026
4f0c079
Merge pull request #7681 from william-drakemond/fix/balance-inflight-…
Wei-Shaw Sep 30, 2026
48b7109
Merge pull request #7736 from lyy0709/codex/remote-codex-model-catalog
Wei-Shaw Sep 30, 2026
327c322
Merge pull request #7730 from lyy0709/codex/gpt61-sol-codex-plans
Wei-Shaw Sep 30, 2026
96f4c11
Merge pull request #7726 from william-drakemond/feat/claude-reset-redeem
Wei-Shaw Sep 30, 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
458b92a
chore: sync VERSION to 0.2.12 [skip ci]
github-actions[bot] Oct 2, 2026
66a9e2e
fix(billing): allow upstream billing probe for TypeSafe API-key accounts
kingsleydon Oct 2, 2026
8b9788e
test(billing): drop added comments
kingsleydon Oct 2, 2026
d9d4333
docs: add security policy with private vulnerability reporting
Wei-Shaw Oct 2, 2026
99efaa4
docs(security): add dev@sub2api.org as fallback reporting email
Wei-Shaw Oct 2, 2026
ae501cc
Merge pull request #7814 from Wei-Shaw/docs/security-policy
Wei-Shaw Oct 2, 2026
c2d5bbd
fix(billing): settle usage when the API key is deleted before billing…
Wei-Shaw Oct 2, 2026
432a6a4
chore(billing): simplify comment
Wei-Shaw Oct 2, 2026
f5aca74
Merge pull request #7816 from Wei-Shaw/fix/usage-billing-deleted-key
Wei-Shaw Oct 2, 2026
3040209
Merge pull request #7813 from kingsleydon/fix/typesafe-upstream-billi…
Wei-Shaw Oct 2, 2026
b8dece9
chore: sync VERSION to 0.2.13 [skip ci]
github-actions[bot] Oct 2, 2026
90da36b
chore: record upstream v0.2.11 as merged (integrated by #220)
Oct 3, 2026
6e66355
chore: merge upstream v0.2.13 preserving downstream contracts
Oct 3, 2026
42023f6
fix(typesafe): fit System One accounts into downstream account flows
Oct 3, 2026
db05413
fix(migrations): keep typesafe in the quota platform CHECK on new dat…
Oct 3, 2026
9bd9728
fix(console): fit upstream's new admin UI into the console theme
Oct 3, 2026
a1d534d
docs(downstream): record the v0.2.13 integration review and risk mani…
Oct 3, 2026
74facf5
fix(typesafe): keep the upstream body of failed System One requests i…
Oct 3, 2026
2984e2f
fix(typesafe): pass the connection test only on a valid System One an…
Oct 3, 2026
121be16
fix(migrations): keep cindy in the quota list of the TypeSafe platfor…
Oct 3, 2026
1ab308a
docs(downstream): correct the v0.2.13 review after the resolution review
Oct 3, 2026
eac078f
docs(downstream): state where the TypeSafe answer shape comes from
Oct 3, 2026
cf06ba1
docs(downstream): make two statements of the v0.2.13 review exact
Oct 3, 2026
46b1da1
chore(migrations): number the TypeSafe quota tail migration 265
Oct 3, 2026
8b76943
Merge origin/main (#233) into the v0.2.13 integration
Oct 3, 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
2 changes: 1 addition & 1 deletion .downstream/upstream-base
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.2.11
v0.2.13
98 changes: 98 additions & 0 deletions .downstream/upstream-review-v0.2.13.md

Large diffs are not rendered by default.

734 changes: 387 additions & 347 deletions .downstream/upstream-risk.json

Large diffs are not rendered by default.

107 changes: 107 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Security Policy

[English](#english) | [中文](#中文)

## English

### Reporting a Vulnerability

**Please do not report security vulnerabilities through public GitHub issues, pull requests, or discussions.**

Report them privately through GitHub's private vulnerability reporting:

**[Report a vulnerability](https://github.com/Wei-Shaw/sub2api/security/advisories/new)**

(Repository → **Security** tab → **Report a vulnerability**.) Only the maintainers can see the report, and the advisory becomes the place to discuss, fix, and eventually publish the issue.

If you cannot use GitHub private vulnerability reporting, email **dev@sub2api.org** instead, with `[Security]` in the subject line.

A useful report includes:

- The affected component and version (release tag or commit)
- Impact: what an attacker can do and which privileges they need
- Minimal reproduction steps or a proof of concept
- Any non-default configuration required to trigger the issue
- A suggested fix, if you have one

### Supported Versions

Sub2API releases frequently, and fixes ship in a new release rather than being backported.

| Version | Supported |
| ------- | --------- |
| Latest release | ✅ |
| Older releases | ❌ |

Please confirm that the issue reproduces on the latest release or on `main` before reporting.

### Scope

In scope: the Sub2API backend, frontend, official Docker images, and deployment files in this repository.

Usually out of scope:

- Issues that require already-compromised admin credentials or server access
- Risks arising from explicitly weakening documented security settings (for example, disabling `security.url_allowlist`)
- Vulnerabilities in upstream AI providers or third-party dependencies with no Sub2API-specific impact (please report those upstream)
- Missing best-practice headers or scanner output without a demonstrated impact

### Disclosure Process

1. We acknowledge the report and assess its validity and severity.
2. We develop a fix privately in the advisory and may ask you to verify it.
3. We publish a release containing the fix, then publish the GitHub Security Advisory (with a CVE when applicable), crediting you unless you prefer to stay anonymous.

Please keep details private until the advisory is published. This is a volunteer-maintained project, so response times are best effort.

## 中文

### 报告漏洞

**请不要通过公开的 Issue、Pull Request 或 Discussion 报告安全漏洞。**

请使用 GitHub 私密漏洞报告功能提交:

**[提交漏洞报告](https://github.com/Wei-Shaw/sub2api/security/advisories/new)**

(仓库 → **Security** 标签页 → **Report a vulnerability**。)报告仅维护者可见,后续的讨论、修复与公告发布都在该安全公告中进行。

如果无法使用 GitHub 私密漏洞报告,也可以发送邮件至 **dev@sub2api.org**,邮件标题请注明 `[Security]`。

报告中建议包含:

- 受影响的组件与版本(Release tag 或 commit)
- 影响:攻击者能做什么、需要什么权限
- 最小复现步骤或 PoC
- 触发问题所需的非默认配置
- 修复建议(如有)

### 支持的版本

Sub2API 发版频繁,安全修复随新版本发布,不向旧版本回移。

| 版本 | 是否支持 |
| ---- | -------- |
| 最新 Release | ✅ |
| 更早的版本 | ❌ |

报告前请先确认问题在最新 Release 或 `main` 上仍可复现。

### 范围

范围内:本仓库中的 Sub2API 后端、前端、官方 Docker 镜像与部署文件。

通常不在范围内:

- 需要事先已掌握管理员凭据或服务器权限才能利用的问题
- 因主动关闭文档中的安全配置(如关闭 `security.url_allowlist`)而产生的风险
- 上游 AI 服务商或第三方依赖自身的漏洞,且对 Sub2API 无特定影响(请向上游报告)
- 仅缺少最佳实践响应头或扫描器输出,但未证明实际影响

### 披露流程

1. 我们确认收到报告,并评估其有效性与严重程度。
2. 我们在安全公告中私下开发修复,可能请你协助验证。
3. 我们先发布包含修复的版本,再公开 GitHub 安全公告(适用时申请 CVE),并致谢报告者(如你希望匿名则不署名)。

在公告发布前请勿公开漏洞细节。本项目由志愿者维护,响应时间尽力而为。
2 changes: 1 addition & 1 deletion .github/workflows/downstream-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ jobs:
src/api/__tests__/settings.authSourceDefaults.spec.ts \
src/components/admin/user/__tests__/UserPlatformQuotaModal.spec.ts \
src/components/account/__tests__/EditAccountModal.grokMediaEligibility.spec.ts \
-t 'platform option catalogs|全部 10 平台全 null|缺失平台填充为全 null|MiniMax scheduling threshold compatibility|已有数据正确填充 limit input|保存提交完整 10 platform payload|updates the dedicated endpoint only when the mode changes|reports partial-save errors when the dedicated endpoint fails'
-t 'platform option catalogs|全部 concrete 平台全 null|缺失平台填充为全 null|MiniMax scheduling threshold compatibility|已有数据正确填充 limit input|保存提交完整 platform payload|updates the dedicated endpoint only when the mode changes|reports partial-save errors when the dedicated endpoint fails'
- name: Production build
working-directory: frontend
run: pnpm run build
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,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 @@ -743,6 +743,31 @@ OAuth / Setup Token 图片请求使用 Responses 主控模型调用 `image_gener

---

## 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.13
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