github Wei-Shaw/sub2api v0.1.79
Sub2API 0.1.79

latest releases: v0.1.131, v0.1.130, v0.1.129...
3 months ago

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.79

One-line install (Linux):

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

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

📚 Documentation

Don't miss a new sub2api release

NewReleases is sending notifications on new releases.