Repository navigation
Closed
Description
Summary
Claude Code consistently returns 429 Free usage limit reached when routed through opencode2api to OpenCode free models. However, the same proxy returns 200 for:
/v1/chat/completionsvia the playground/v1/messagesvia the playground / diagnostic test
This suggests the proxy and WARP egress are healthy, but Claude Code’s request shape is being rejected upstream.
Environment
- OS: Windows 10/11
- opencode2api version:
dev(from startup log) - opencode2api address:
http://localhost:8080 - WebUI:
http://localhost:8081 - Claude Code version:
v2.1.325 - Model:
deepseek-v4.1-flash-free[1m] - Auth: local token / anonymous Zen tier
- WARP: enabled, IPv6 egress rotation active
Steps to reproduce
- Start
opencode2apiwithconfig.json. - Configure Claude Code to use:
ANTHROPIC_BASE_URL=http://localhost:8080ANTHROPIC_AUTH_TOKEN=sk-local-...- model
deepseek-v4.1-flash-free[1m]
- Open Claude Code and send a simple prompt:
hii. - Observe
429in Claude Code. - In the opencode2api WebUI, run a diagnostic/playground request against the same model.
- Observe
200with a valid response.
Expected behavior
Claude Code should receive a 200 response, the same as the playground/diagnostic request.
Actual behavior
Claude Code returns:
API Error: Request rejected (429) · Free usage limit reached.
Free models work in OpenCode (https://opencode.ai); subscribe to OpenCode Go to keep going.
Proxy log for the Claude Code request:
{"level":"INFO","msg":"request routed","method":"POST","path":"/v1/messages","status":429,"model":"deepseek-v4.1-flash-free","tier":"zen","attempts":5,"legs":"anon:429:3148ms@warp:... anon:429:2879ms@warp:... 3yUBQ:429:3825ms 3yUBQ:429:4117ms 3yUBQ:429:3892ms","outcome":"client_error"}
Proxy log for a successful playground request on the same WARP pool:
{"level":"INFO","msg":"request routed","method":"POST","path":"/v1/chat/completions","status":200,"model":"deepseek-v4.1-flash-free","tier":"zen","key_id":"anonymous","channel":"anonymous","attempts":1,"legs":"anon:200:2487ms@warp:...","outcome":"success"}
Metadata
Metadata
Assignees
Labels
No labels
Activity
fix(gateway): harden free-tier retries and client compatibility
jasonxu114514 commentedon Nov 16, 2026
Main 14faec7 preserves the latest upstream HTTP error and Retry-After across later transport failures, fixes title classification before shaping, legacy tool renaming and Responses assistant turns. Optional prompt_environment retains existing defaults. Offline regressions, vet, Windows/Linux builds and WebUI checks passed. No live model request was made, so this does not prove the reported Claude Code 429 is resolved; keeping this issue open. Please retest an updated binary and report its commit plus a minimal sanitized reproduction if still failing. Never include credentials, authorization headers or private prompts. Related #178 and #180. Commit: 14faec7
unrayed commentedon Nov 16, 2026
Root cause found, and it is not the session or the egress: the free tier refuses the literal
clint_that the gateway puts in front of every renamed client tool. Fixed in #182.Reproduced on your path. Anthropic-shaped
/v1/messagesrequest with Claude Code's tool vocabulary (9 tools,Bash/Read/Edit/…,stream: true), replayed against two builds of14faec7that differ only inClientToolPrefix:clint_429in 2.4 smcp_200in 2.2 s,tool_useblock restored toBashSame on the official CLI's 20-tool chat body (75,654 B,
max_completion_tokens: 32000):clint_429in 3.4 smcp_200in 2.6 s, tool call restored toshell; follow-up carrying the tool result200with the final answerWhat the gate actually matches, one identical body, same session id, same project id, same egress:
clint_CLINT_clint(no underscore)client_,copilot_,mcp_,srv_,fn_,zz_So the rename itself is still accepted and another client's vocabulary is still refused — the
clint_token became a marker, case-insensitive, trailing underscore required.That also rules out the alternatives: the session id, project id and egress were identical in the 429 and the 200 runs, so re-minting (#175) and per-egress quota accounting (#172) do not explain your report.
Retest: PR #182, head
75bb45d, branchfix/free-tier-wire-name-prefix. A commit hash plus a minimal sanitized reproduction is all that is needed — no credentials, authorization headers or private prompts.