mirror of
https://github.com/jasonxu114514/opencode2api.git
synced 2026-12-05 08:02:53 +00:00
The free tier refuses a shaped body whose tool list still reads as another client's session. A Claude Code request that declares both ReportFindings and ScheduleWakeup is answered with FreeUsageLimitError — the same 429 a genuinely exhausted IP receives — and the refusal is deterministic: rename either name and the same request succeeds, and two empty placeholder tools carrying just those two names reproduce it. Schema, size and tool count do not matter. The gateway forwarded client tools as clint_<name>, so every Claude Code session behind CLIProxyAPI was refused (14 tools, both markers present) while the official CLI kept working and small requests through the gateway were fine. Client tools now get an opaque wire name: clint_ plus 12 hex characters of the name's SHA-256, collision-suffixed like before. Descriptions and schemas are untouched, so the model still knows what a tool does, and the response path still restores the names the client declared, streaming included. Verified against the captured Claude Code request (95 KB, 14 tools): 3/3 429 before the change, 3/3 200 after, and the same request replayed through CLIProxyAPI (Anthropic /v1/messages -> chat -> /inference) returns 200. Session ids are unaffected: they are normalized by CanonicalSessionID, and an implausible session timestamp is a separate 429 trigger documented there.