Derived from dsh-packycode-api 1.1.7 (MIT) and rebuilt for the Geek2API (sub2api) gateway: multi-endpoint failover, /v1/usage balances with wallet dedupe, per-key coverage from /v1/models, sub2api failure wording, a Claude runtime switch (HTTP or local CLI), and Claude/GPT web search backends. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
3.0 KiB
3.0 KiB
Changelog
0.1.0
First release. Derived from dsh-packycode-api 1.1.7 (MIT) and rebuilt for the Geek2API gateway (sub2api).
- Route and catalog. A self-contained
Geek2APImodel route with 13 models, each pinned to the protocol its vendor serves on this gateway: Claude Opus 5.5, Claude Sonnet 5.5, and Claude Haiku 4.5 on Messages; GPT-6.1 Sol, GPT-6 Astra, GPT-6 Luna, Grok 4.6, and Grok 4.7 on Responses; DeepSeek V4.1 Flash, DeepSeek V4 Pro, Gemini 3.8 Flash, GLM-5.3, and Kimi K3 on Chat Completions. Gemini, GLM, and Kimi are declared without reasoning control; the route asks them foroffso the profile's default effort never refuses them. - Multi-endpoint failover. The built-in endpoints are
hk,hk2,hk3,hk4, andwww.geek2api.com. They are ranked by/healthlatency (re-measured every 10 minutes and on demand). A host that fails in transit — DNS, TLS, connect timeout, reset — is passed over for two minutes, and the harness's retry of the step lands on the next one. Balance, model-list, and search reads fail over the same way. The list is editable in Settings → Geek2API → Endpoints. - Balance. Read from
/v1/usageper key, covering the three shapes sub2api answers: wallet, subscription (the tightest daily/weekly/monthly window), and per-key quota (with 5h/1d/7d windows). Keys of one account share a wallet, so the total counts a wallet once (by the gateway'saccount_refwhen present, otherwise by identical balance). Today's spend is shown per key. - Per-key models. Each key's
/v1/modelsdecides which catalog models it reaches (✓/✕ per family). Group names are shown when/v1/usagereports them. A key whose group was deleted or withdrawn (API Key 所属分组已删除) is recognized as rejected. - Key rotation. sub2api's own wording moves a key aside:
Invalid API key,API key is disabled,API key 已过期,余额不足,请充值,No active subscription. A request for a model none of the stored keys can use (Model 'x' is not available) is explained instead of retried; HTTP 400 is no longer retryable. - Claude runtime. Claude models call the Messages API directly by default (DSH's own tools, permissions, and plan mode). Settings → Geek2API → Claude runtime switches them to the local Claude Code CLI, which keeps the CLI adapter, MCP web search bridge, and plan-mode handoff of the original. The
claude_codedelegation tool is unchanged. - Web search. Same design as the original, routed through the profile patch, with backends Claude (
claude-haiku-4-5-20251001, Messages +web_search_20250305, the default, about 8.5K input tokens per search) and GPT (gpt-6.1-sol, Responses +web_search). The DeepSeek backend is dropped: this gateway's DeepSeek groups ignore the server tool and answer without searching. - Lighter balance reads. Balance and group reads call
/v1/usage?lite=1, which skips the per-day and 30-day model statistics on gateways that support it; older gateways ignore the parameter.