Skip to content

Sub2API 0.1.131

Choose a tag to compare

@github-actions github-actions released this 26 Apr 04:04
· 4209 commits to main since this release

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

Cursor sends ApplyPatch as a custom grammar tool, but the OpenAI compat behavior that previously triggered model tool use matched the function-tool shape used by api2cursor. This keeps the Cursor-specific handling at the compat boundary and bridges ApplyPatch into a Responses function tool with a required patch string, while carrying the grammar text in the description. The forced Cursor instructions template now also preserves the original Cursor system prompt so the model keeps the editing rules.

Constraint: Cursor OpenAI chat/completions requests enter the shared OpenAI gateway after compat normalization

Rejected: Keep ApplyPatch as custom grammar only | current upstream behavior did not reliably continue into edit calls

Rejected: Change the shared OpenAI gateway | Cursor-specific protocol cleanup belongs in compat/cursor

Confidence: medium

Scope-risk: narrow

Directive: Do not remove ExistingInstructions from the Cursor GPT-5 forced template; it carries the client tool-use rules

Tested: go test ./internal/config ./internal/compat/cursor ./internal/handler ./internal/service -run 'Cursor|Compat|OpenAI|ResponsesShape|ChatCompletions|ForcedCodex' -count=1

Tested: go vet ./internal/config ./internal/compat/cursor ./internal/handler ./internal/service

Not-tested: Live Cursor client edit after v0.1.131 release


📥 Installation

Docker:

# GitHub Container Registry
docker pull ghcr.io/wanggang8/sub2api:0.1.131

One-line install (Linux):

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

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

📚 Documentation