Releases: Wei-Shaw/sub2api
Sub2API 0.1.86
AI API Gateway Platform - 将 AI 订阅配额分发和管理
-
新增 claude-sonnet-4-6 和 gemini-3.1-pro 模型支持及对应计费定价
-
新增混合渠道预检 API,创建/编辑账号前可提前验证渠道冲突风险
-
补充 Antigravity 的 Gemini 3.1 Pro 透传快捷按钮和模型映射
-
Antigravity OAuth 客户端密钥支持内置默认值,无需额外配置环境变量
-
模型限速指示器优化为响应式布局,使用短别名和倒计时显示
-
Warmup 请求拦截扩展支持 Antigravity 平台
-
重构 Failover 错误处理逻辑,提取为共享的 FailoverState 模块,减少重复代码
-
Gemini 平台启用 model_mapping UI 和模型过滤
-
Antigravity 使用映射后的模型进行计费和限速,确保一致性
-
区分客户端断开连接与上游重试失败的错误信息
-
移除无用的 ClientSecret 常量和冗余代码
-
修复 GO-2026-4512 安全漏洞(升级 utls 至 v1.8.2)
-
修复 Claude 用量进度条不显示 4.6 模型的问题
-
修复 Gemini 授权链接生成失败的问题
-
修复刷新用量后未自动清理账号可恢复错误状态
-
修复 intercept_warmup_requests 配置未保存的问题
-
修复前端批量编辑和状态网格布局问题
📥 Installation
Docker:
# Docker Hub
docker pull weishaw/sub2api:0.1.86
# GitHub Container Registry
docker pull ghcr.io/wei-shaw/sub2api:0.1.86One-line install (Linux):
curl -sSL https://raw.githubusercontent.com/Wei-Shaw/sub2api/main/deploy/install.sh | sudo bashManual download:
Download the appropriate archive for your platform from the assets below.
📚 Documentation
Sub2API 0.1.85
AI API Gateway Platform - 将 AI 订阅配额分发和管理
-
Sora 平台支持:完成 OAuth 流程、网关接入、媒体生成、TLS 指纹、Cloudflare 挑战处理,移除 sora2api 外部依赖
-
OpenAI OAuth 透传:支持自动透传开关、User-Agent 透传、Codex 官方客户端限制开关
-
Anthropic API Key 自动透传并优化透传链路性能
-
Gemini 3→3.1 模型映射及前端快捷按钮,新增 gemini-3.1-pro-preview 模型
-
关键写接口幂等保护,完善并发容错
-
API Key 上次使用时间记录
-
统一日志底座与系统日志运维能力,运维监控新增 OpenAI Token 请求统计表
-
代理质量检测结果持久化并在列表展示
-
Antigravity User-Agent 版本可通过环境变量 ANTIGRAVITY_USER_AGENT_VERSION 配置
-
JWT 密钥启动时自动迁移并持久化
-
使用量记录有界 worker 池与自动扩缩容
-
Codex CLI 模式强制及 UA 伪装
-
账号自动刷新改为 ETag 增量同步
-
使用 gjson/sjson 优化热路径 JSON 处理,替代全量序列化
-
SSE Scanner buffer 改用 sync.Pool 复用,减少高并发 GC 压力
-
订阅模式认证中间件优化,5 次串行调用降至 2 步同步 + 1 步异步
-
网关热点路径优化并补齐高覆盖测试
-
jitterTTL 改用 rand/v2 并移除全局锁
-
重试场景 thinking 过滤性能优化
-
连接池参数调优(max_conns_per_host=8192)
-
启用 h2c 并保留 HTTP/1.1 回退
-
常规成功日志降级为 Debug 级别降噪
-
账号管理改为单行增量更新避免全量刷新
-
修复密码重置链接 Host Header 注入漏洞(P0)
-
修复 Sora 媒体落地路径穿越风险
-
修复 OpenAI usage 为空导致 panic(P0)
-
修复管理员 JWT 未校验 TokenVersion 问题
-
修复仅配置小时时 JWT 会话提前失效
-
修复粘性会话预取分组错配
-
修复 SSE delta 将缓存创建明细重置为 0
-
修复 codex_cli_only 误拦截问题
-
修复 OAuth 透传流式断开与压缩头问题
-
修复 Postgres 数据未持久化导致重启后无法登录
-
修复日志重复输出及清理冗余迁移逻辑
-
修复限流时未同步清理临时不可调度状态
-
修复余额显示样式深色模式不兼容
-
修复额度窗口过期展示问题
-
修复前端审计问题并补充回归测试
-
后端单元测试覆盖率提升至 85%+
-
多轮代码审计修复(安全、数据一致性、性能)
-
完成后端日志结构化迁移
-
清理过时的 codex skills 和部署脚本
-
恢复并完善 CI 集成测试
📥 Installation
Docker:
# Docker Hub
docker pull weishaw/sub2api:0.1.85
# GitHub Container Registry
docker pull ghcr.io/wei-shaw/sub2api:0.1.85One-line install (Linux):
curl -sSL https://raw.githubusercontent.com/Wei-Shaw/sub2api/main/deploy/install.sh | sudo bashManual download:
Download the appropriate archive for your platform from the assets below.
📚 Documentation
Sub2API 0.1.84
AI API Gateway Platform - 将 AI 订阅配额分发和管理
-
前端新增 Sonnet 4.6 快捷映射按钮
-
支持账号级 Cache TTL 覆写,可将 Anthropic 缓存令牌的 5 分钟/1 小时分类进行重写
-
临时移除 context-1m-2025-08-07 以避免 sonnet4.6[1m] 触发 429 错误
-
修复 Codex 模型请求中不支持的参数未被过滤的问题
-
修复 OpenAI x-stainless-* 请求头导致的 CORS 错误
📥 Installation
Docker:
# Docker Hub
docker pull weishaw/sub2api:0.1.84
# GitHub Container Registry
docker pull ghcr.io/wei-shaw/sub2api:0.1.84One-line install (Linux):
curl -sSL https://raw.githubusercontent.com/Wei-Shaw/sub2api/main/deploy/install.sh | sudo bashManual download:
Download the appropriate archive for your platform from the assets below.
📚 Documentation
Sub2API 0.1.83
AI API Gateway Platform - 将 AI 订阅配额分发和管理
-
Anthropic 缓存计费细分:区分 ephemeral_5m 和 ephemeral_1h 两种缓存创建 token,按各自单价分别计费
-
前端使用记录展示 5m/1h 缓存创建明细,带彩色 badge 区分
-
修复 usage_log GORM column tag 确保写入正确的数据库列
-
删除 GORM 自动生成的重复列(迁移 054)
📥 Installation
Docker:
# Docker Hub
docker pull weishaw/sub2api:0.1.83
# GitHub Container Registry
docker pull ghcr.io/wei-shaw/sub2api:0.1.83One-line install (Linux):
curl -sSL https://raw.githubusercontent.com/Wei-Shaw/sub2api/main/deploy/install.sh | sudo bashManual download:
Download the appropriate archive for your platform from the assets below.
📚 Documentation
Sub2API 0.1.82
AI API Gateway Platform - 将 AI 订阅配额分发和管理
-
管理后台账号列表支持按分组筛选
-
docker-compose.yml 补充 PGDATA 环境变量配置
-
配置 gosec 安全扫描排除规则,排除 API 网关场景下的 SSRF 误报
-
修复 Anthropic 429 限流使用聚合最大值导致账号被标记为约 6 天不可调度的问题,改为使用精确的窗口重置时间
-
修复 StatCard 数值溢出显示问题
-
修复侧边栏 Logo 加载时的闪烁问题
-
修复 gosec 配置文件格式错误导致 CI 失败
📥 Installation
Docker:
# Docker Hub
docker pull weishaw/sub2api:0.1.82
# GitHub Container Registry
docker pull ghcr.io/wei-shaw/sub2api:0.1.82One-line install (Linux):
curl -sSL https://raw.githubusercontent.com/Wei-Shaw/sub2api/main/deploy/install.sh | sudo bashManual download:
Download the appropriate archive for your platform from the assets below.
📚 Documentation
Sub2API 0.1.81
AI API Gateway Platform - 将 AI 订阅配额分发和管理
-
Antigravity 支持 Refresh Token 批量导入创建 OAuth 账号
-
Claude Thinking 支持 adaptive 类型并适配 Opus 4.6 动态预算分配
-
管理后台账户列表支持邮箱搜索和限流状态过滤
-
兑换码搜索支持用户邮箱匹配,导出 CSV 新增 used_by_email 列
-
用户列表支持按 API Key 搜索
-
修复 Gemini 2.5 Pro/Flash thinking 模型的 thoughtsTokenCount 未计入输出 token 计费的问题
-
修复登录/注册页面自定义 Logo 不显示及闪烁问题(支持 data:image base64 格式)
📥 Installation
Docker:
# Docker Hub
docker pull weishaw/sub2api:0.1.81
# GitHub Container Registry
docker pull ghcr.io/wei-shaw/sub2api:0.1.81One-line install (Linux):
curl -sSL https://raw.githubusercontent.com/Wei-Shaw/sub2api/main/deploy/install.sh | sudo bashManual download:
Download the appropriate archive for your platform from the assets below.
📚 Documentation
Sub2API 0.1.80
AI API Gateway Platform - 将 AI 订阅配额分发和管理
-
Antigravity OnboardUser API:账号 onboarding 后自动获取 project_id
-
loadProjectIDWithRetry 增加 onboard 回退:LoadCodeAssist 未返回 project_id 时自动触发 onboarding
-
GetAccessToken 中 project_id 补齐改用轻量 FillProjectID 替代全量 RefreshAccountToken
-
补齐逻辑增加 5 分钟冷却机制,防止频繁重试
-
OnboardUser 轮询等待改为 context 感知,支持提前取消
-
提取 mergeCredentials 辅助方法消除重复代码
-
新增 extractProjectIDFromOnboardResponse 和 resolveDefaultTierID 单元测试
📥 Installation
Docker:
# Docker Hub
docker pull weishaw/sub2api:0.1.80
# GitHub Container Registry
docker pull ghcr.io/wei-shaw/sub2api:0.1.80One-line install (Linux):
curl -sSL https://raw.githubusercontent.com/Wei-Shaw/sub2api/main/deploy/install.sh | sudo bashManual download:
Download the appropriate archive for your platform from the assets below.
📚 Documentation
Sub2API 0.1.79
AI API Gateway Platform - 将 AI 订阅配额分发和管理
-
MODEL_CAPACITY_EXHAUSTED (503) 使用固定 1s 间隔重试最多 60 次,不切换账号
-
瞬态错误(Google 400、空流响应)同账号重试 2 次后再触发故障转移
-
空流响应触发 failover 自动换号重试,不再直接返回 502
-
Google "Invalid project resource name" 400 错误触发 failover 并临时封禁账号 1 小时
-
错误透传规则新增 skip_monitoring 选项,匹配的错误不记录到运维监控日志
-
Antigravity 转发支持 daily/prod 单 URL 切换
-
错误匹配性能优化:延迟/限制 body ToLower,预计算规则关键词和平台集合
-
MODEL_CAPACITY_EXHAUSTED 全局去重,避免并发请求重复重试
-
503 重试 body 读取限制从 2MB 降至 8KB
-
time.After 替换为 time.NewTimer,防止 context 取消时 timer 泄漏
-
临时封禁冷却时间从 30 分钟缩短至 1 分钟(同账号重试耗尽后)
-
修复错误透传规则 skip_monitoring 未生效的问题
-
修复 CI 检查失败(gofmt、errcheck、staticcheck)
📥 Installation
Docker:
# Docker Hub
docker pull weishaw/sub2api:0.1.79
# GitHub Container Registry
docker pull ghcr.io/wei-shaw/sub2api:0.1.79One-line install (Linux):
curl -sSL https://raw.githubusercontent.com/Wei-Shaw/sub2api/main/deploy/install.sh | sudo bashManual download:
Download the appropriate archive for your platform from the assets below.
📚 Documentation
Sub2API 0.1.78
AI API Gateway Platform - 将 AI 订阅配额分发和管理
-
单账号 503 退避重试:当分组内只有一个可用账号且上游返回 503 时,原地等待重试而非切换账号,避免双重等待和请求雪崩
-
修复单账号分组首次 503 设置模型限流标记导致后续请求雪崩的问题
-
移除特定 system prompt 注入以适配新版 CC 客户端缓存失效的 bug
📥 Installation
Docker:
# Docker Hub
docker pull weishaw/sub2api:0.1.78
# GitHub Container Registry
docker pull ghcr.io/wei-shaw/sub2api:0.1.78One-line install (Linux):
curl -sSL https://raw.githubusercontent.com/Wei-Shaw/sub2api/main/deploy/install.sh | sudo bashManual download:
Download the appropriate archive for your platform from the assets below.
📚 Documentation
Sub2API 0.1.77
AI API Gateway Platform - 将 AI 订阅配额分发和管理
-
CRS 同步预览:支持从 CRS 预览账号后选择性同步,三步向导式操作
-
分组拖拽排序:支持通过拖拽调整分组显示顺序
-
客户端断连检测:流式传输时检测客户端断开并继续计费
-
账号切换延迟:Antigravity 账号故障转移时增加线性延迟
-
相同优先级账号随机化:防止并发请求时的雷同效应
-
Upstream 账号类型路由:AccountTypeUpstream 正确路由到 ForwardUpstream
-
自定义错误码返回 500:当上游错误码不在配置列表时返回 500
-
重构 scope 级别限流为 model 级别限流,简化账号调度算法
-
统一 Antigravity 和 Gemini 的错误策略处理
-
使用上游返回的 retryDelay 替代固定默认值
-
重构 Trie 会话存储为扁平缓存结构
-
修复 Gemini 原生请求格式的会话哈希生成
-
混入会话上下文防止不同用户相同消息的哈希碰撞
-
修复分组徽章在账号编辑页面未显示平台颜色的问题
-
修复自定义错误码不匹配时仍触发限流的问题
-
修复 Gemini 错误策略检查应在重试逻辑之前执行
-
支持从操作菜单和临时取消调度中清除 model 级别限流
-
修复 sticky session 故障转移时的缓存计费豁免
-
修复 thoughtSignature 清理应用于所有客户端
-
移除 Antigravity API Key 账户的冗余表单字段
-
修复 TypeScript 类型检查错误
📥 Installation
Docker:
# Docker Hub
docker pull weishaw/sub2api:0.1.77
# GitHub Container Registry
docker pull ghcr.io/wei-shaw/sub2api:0.1.77One-line install (Linux):
curl -sSL https://raw.githubusercontent.com/Wei-Shaw/sub2api/main/deploy/install.sh | sudo bashManual download:
Download the appropriate archive for your platform from the assets below.