Skip to content

Non-empty tools triggers 429 Free usage limit reached while tools: [] succeeds on OpenCode Zen #180

Closed

Description

@wisqqud

Body:

  • opencode2api v1.4.7, anonymous Zen free lane (anonymous: true, no upstream keys), OpenAI Chat Completions protocol, Windows 11.
  • Sending POST /v1/chat/completions with no tools field or "tools": [] returns 200 OK.
  • Sending the same request with exactly one valid tool (e.g. read with a non-empty parameters schema) returns 429 {"error":{"message":"Free usage limit reached.","type":"FreeUsageLimitError"}}.
  • Reproduced with deepseek-v4.1-flash-free and big-pickle; same IP, same messages, only difference is tools.
  • Any single tool name/schema tested (read, bash, glob, grep, custom hahahaha, placeholder parameters: {}) causes the 429.
  • Actual: every non-empty tools payload is rejected with FreeUsageLimitError, independent of model and tool name.
  • If tools NOT in Request body, like if this in "role": "system" then returns 200, and tools are in prompt.

Activity

  1. changed the title [-]Non-empty tools triggers 429 Free usage limit reached while tools: [] succeeds on anonymous OpenCode Zen[/-] [+]Non-empty tools triggers 429 Free usage limit reached while tools: [] succeeds on OpenCode Zen[/+] on Nov 16, 2026
  2. wisqqud commented on Nov 16, 2026

    @wisqqud
    Author
    image image image
  3. bagusandrewijaya commented on Nov 16, 2026

    @bagusandrewijaya

    same issue bro

  4. wisqqud commented on Nov 16, 2026

    @wisqqud
    Author
  5. bagusandrewijaya commented on Nov 16, 2026

    @bagusandrewijaya

    @MakotoNikki thanks mate

  6. unrayed commented on Nov 16, 2026

    @unrayed
    Contributor

    Your test isolates it perfectly, and the answer is the tool-name rename, not the tools themselves.

    tools: [] never produces a wire tool name, so nothing is renamed. Any non-empty tools array does, and the gateway renames each client tool to clint_ + a digest — which the free tier now refuses. The single constant is the whole cause; schema, name and placeholder content are irrelevant, which is why hahahaha and {} fail the same way.

    Verified with one identical body, same session/project id and egress, two builds of 14faec7 differing only in that prefix:

    wire-name prefix result
    clint_ (current main) 429 FreeUsageLimitError
    CLINT_ 429
    clint (no underscore) 200
    client_, copilot_, mcp_, srv_, fn_, zz_ 200
    client names passed through, shaping bypassed 200

    Fix: #182 (head 75bb45d) — ClientToolPrefix becomes mcp_, chosen so a prefix ban also catches genuine MCP traffic, which upstream cannot afford. Tool calls still round-trip: the response is restored to the name the client declared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions