Skip to content

Error: 429: {"type":"FreeUsageLimitError","message":"Error from provider (Console): Rate limit exceeded. Please try again later."} #42029

Closed as not planned

Description

@YoungJurry

Description

Error: 429: {"type":"FreeUsageLimitError","message":"Error from provider (Console): Rate limit exceeded. Please try again later."}
??????????????
I have not used it today

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. MathieuT1508 commented on Aug 12, 2026

    @MathieuT1508

    I have the same problem , it's affect the sub agent for me

  2. github-actions commented on Aug 12, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Steps to reproduce is empty — please describe what you were doing when the error occurred (e.g., which model/provider you were using, what action triggered it)
    • OpenCode version is missing
    • Operating System and Terminal are missing
    • The description only contains the raw error message with no additional context

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    If you believe this was flagged incorrectly, please let a maintainer know.

  3. Dave147789 commented on Aug 12, 2026

    @Dave147789

    I have the same problem

  4. github-actions commented on Aug 12, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

  5. 12errh commented on Aug 13, 2026

    @12errh

    @MrMushrooooom @Dave147789 @palmamartin @MathieuT1508

    Root Cause

    The issue is triggered by the User-Agent header, not the API key or IP address. The upstream "Console" inference provider (which serves the -free models) gates anonymous free capacity strictly based on this header:

    • TUI request (User-Agent: opencode/<version>) → 200 OK
    • Custom request (User-Agent: curl/8.0 or any non-opencode UA) → 429 FreeUsageLimitError

    Testing confirmed that x-opencode-client, x-opencode-version, and session headers alone do not unlock the capacity. Only the User-Agent value matters.

    According to the source code (packages/opencode/src/session/llm/request.ts), the TUI always sends User-Agent: opencode/<version>. The gateway strips all x-opencode-* headers before forwarding upstream but passes the User-Agent through untouched, allowing the upstream provider to use it for free-pool validation.


    Fix

    Set the opencode User-Agent directly on your request:

    curl -s https://opencode.ai \
      -H "Authorization: Bearer <key-or-public>" \
      -H "Content-Type: application/json" \
      -H "User-Agent: opencode/1.18.16" \
      -d '{"model":"deepseek-v4-flash-free","messages":[{"role":"user","content":"hi"}],"max_tokens":5}'

    Verified: Including the opencode/ UA returns an HTTP 200 (including streaming). Excluding it results in a 429 error, regardless of IP or key.


    Notes

    • This restriction only affects -free models. Paid and balance-backed models are not gated by the User-Agent.
    • This is an anti-abuse gate designed to reserve free capacity for the official client. Because of this, it may change at any time. For long-term stability, it is better to Bring Your Own Key (BYOK) with a non-free model.
    • If you are writing a custom client, inject User-Agent: opencode/<version> into the request. Please also forward the user's real IP so per-IP quotas remain fair.
    • The solution i make is this simple proxy https://github.com/12errh/zen-proxy it just change the agent header line so it can work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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