Skip to content

Sub2API 0.2.28

Choose a tag to compare

@github-actions github-actions released this 30 Sep 02:42
· 230 commits to main since this release

AI API Gateway Platform - 将 AI 订阅配额分发和管理

本次同步的重点是 Claude Sonnet 5.5 支持(上游 Wei-Shaw#7683 已合并),以及 Claude
重置额度状态、风控白名单等新功能,外加一批网关与计费修复。

  • Claude Sonnet 5.5(claude-sonnet-5-5):模型注册、effort 档位、Bedrock 映射、
    内置定价与家族匹配一并进入。官方价 $2 / $10 每 MTok,缓存读取 $0.2。
    Sonnet 5.5 不再接受 thinking: {"type":"disabled"} 与 tool_choice any/tool,
    上游已对这两类请求做兼容处理。

  • 账号页:按需显示 Claude 重置额度状态,并与 Codex 重置次数按钮对齐;
    后端暴露脱敏后的原生重置额度状态。

  • 风控:新增风控用户白名单(cyber_policy_user_allowlist),名单内用户只记录日志、
    不触发会话屏蔽。

  • 前端:Claude Code 专用分组隐藏不支持的客户端。

  • 仪表盘:近期用量可在 Token 与花费之间切换。

  • fix(anthropic): 保留请求中的 structured-outputs beta;工具名改写合并为单次遍历。

  • fix(openai): 保留 Responses multi-agent beta;上下文回滚时断开 websocket 链;
    额度暂停保持到已知的未来重置时间。

  • fix(gateway): 客户端断开统一记为 499,不再被记成 502 或 200 上游错误。

  • fix(antigravity): 首个内容出现前保持兼容流存活;Signature-only 事件不计入
    有效数据判定。

  • fix(billing): 账号统计定价遵守长上下文闸门;Free Fast 无定价时保留零成本用量日志。

  • fix(apicompat): 转换后的 role 条目标记为 message。

  • fix(ccswitch) / fix(keys): 保留 Codex provider 根端点;Windows 下 Codex 模型
    目录路径使用 ~/。

  • fix: OpenAI 分组不再下发 Codex 模型目录。

  • fix(deploy): redis command 改用 exec 列表形式;fix(setup): 去除过时的限流默认值。

  • domain_constants.go:设置项常量块取并集,保留我们独有的 Kiro 模型目录门控
    两个 key,同时加入上游新增的 cyber_policy_user_allowlist。

  • VERSION 保持 fork 自己的版本线。

OpenAI 已发布 gpt-6.1-sol。上游对应的适配 PR Wei-Shaw#7730 尚未合并,本版本不含代码级
支持;账号侧通过 model_mapping 白名单放行,定价在 new-api 侧单独配置。

后端 build / vet / -tags=unit / -tags=integration / golangci-lint(0 issues),
前端 typecheck / lint 均通过。


📥 Installation

Docker:

# Docker Hub
docker pull doublepi/sub2api:0.2.28

# GitHub Container Registry
docker pull ghcr.io/doublepi123/sub2api:0.2.28

One-line install (Linux):

curl -sSL https://raw.githubusercontent.com/doublepi123/sub2api/main/deploy/install.sh | sudo bash

Manual download:
Download the appropriate archive for your platform from the assets below.

📚 Documentation