v0.1.152

Wei-Shaw/sub2apiv0.1.152Jul 13, 2026by github-actions[bot]

AI Summary

This release focuses on enhancing Grok platform capabilities with xAI API Key support and OAuth prompt caching, integrating Codex web search with per-request billing, and improving Chat compatibility for various tools.

Key Highlights

  • Grok platform enhanced with xAI API Key account support and free OAuth prompt caching
  • Codex web search endpoint integration with per-request billing ($0.01/req)
  • Chat compatibility bridge support for tool_search and custom tools
  • User strategy updates allowing email fuzzy search for Fast/Flex policies

New Features

  • xAI API Key account management
  • Codex web search endpoint forwarding and billing
  • Chat tool search and custom tool support
  • User email fuzzy search for policies

Full Release Notes

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

Grok 平台能力大幅增强:新增 xAI API Key 账号支持与免费 OAuth 提示词缓存;Codex alpha/search 网页搜索接入转发并支持按次计费。

## 新增功能

- Grok 支持 xAI API Key 账号:可在管理后台创建/编辑,支持 Responses 转发与连接测试
- Grok 免费 OAuth 账号启用提示词缓存,可缓存对话请求自动经 Responses 链路转发
- Codex alpha/search 网页搜索端点转发与按次计费:默认 $0.01/次,分组可设覆盖价(0 为免费),实际扣费叠加分组倍率,前端表单实时预览单次价格
- Chat 兼容桥支持 tool_search 服务端工具与 custom 工具,Codex exec 与 MCP 工具在 chat-only 上游可正常使用
- Fast/Flex 策略指定用户改为邮箱模糊搜索多选,无需手工输入用户 ID

## 优化改进

- Grok 账号用量展示剩余配额容量;配额耗尽记录为限流状态,账号状态指示更准确
- Grok OAuth 订阅请求统一经 CLI 代理路由,并加固 CLI 版本校验
- Grok composer 推理参数自动净化,避免被上游拒绝
- 无可用账号错误信息按平台区分,便于定位模型不可用原因
- 接入指引优化:OpenCode 改用 Responses 适配器

## Bug 修复

- 修复 Codex OAuth Messages 转发缺失身份头的问题
- 修复 remote_compaction_v2 请求未保留原生 Responses 链路的问题
- 修复 compact 心跳 writer 生命周期问题及释放后空指针 panic
- 修复续链请求中 message 项携带非法 item_* id 导致上游 400、客户端反复重试失败的问题
- 修复 Responses↔Anthropic 转换(含流式路径)丢失 cache_creation_input_tokens 的问题,缓存创建 token 统计恢复准确
- 修复 Codex MCP 工具经 chat 桥调用被判 unsupported call 的问题(namespace 子工具回程还原)
- 修复 tool_choice 转发问题:仅转发转换后实际存在的工具、强制选择 tool_search 时正确降级、工具撞名时显式拒绝而非静默错误还原
- 修复 tool_search 参数对象反序列化失败的问题
- 修复网页搜索按次计费三处问题:分组覆盖价未生效、倍率口径不一致、非 2xx 响应误计费



---

## 📥 Installation

**Docker:**
```bash
# Docker Hub
docker pull weishaw/sub2api:0.1.152

# GitHub Container Registry
docker pull ghcr.io/wei-shaw/sub2api:0.1.152
```

**One-line install (Linux):**
```bash
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

- [GitHub Repository](https://github.com/Wei-Shaw/sub2api)
- [Installation Guide](https://github.com/Wei-Shaw/sub2api/blob/main/deploy/README.md)