Skip to content

zen: free models return 403 FreeTierError to documented direct API calls #56702

Closed as not planned

Description

@nilsbarrios

Summary

The Console docs publish free models (e.g. space-bunny-free) with public inference endpoints and list them as Free in the pricing table, but any direct API call to those endpoints returns 403 FreeTierError, so the documented direct-access path for the free tier cannot be used by third-party apps.

Environment

  • opencode version: 2.0.26 (latest channel; opencode binary not on PATH in the shell used for this report)
  • OS: Microsoft Windows [Versión 10.0.26200.9711]
  • Terminal: TERM=xterm-256color, no TERM_PROGRAM / WT_SESSION
  • Shell: C:\WINDOWS\system32\cmd.exe
  • Install/channel: latest (release)
  • Active plugins: none found (no opencode.json/opencode.jsonc in the project; global config dir contains only service.json)
  • Key: Console API key (oc_sk_…, redacted)

Reproduction

  1. Create a Console API key at https://opencode.ai/auth.
  2. Call the endpoint published in the docs "Endpoints" table for space-bunny-free:
curl https://opencode.ai/inference/openai/v1/chat/completions \
  -H "Authorization: Bearer $OPENCODE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "space-bunny-free",
    "messages": [{"role": "user", "content": "ping"}]
  }'
  1. Observe the response below. The legacy alias https://opencode.ai/zen/v1/chat/completions behaves identically.

Expected Behavior

The free models are documented with public endpoints and Free pricing, so the request should return a completion (HTTP 200), or the docs should state that they are restricted to in-app usage.

Actual Behavior

HTTP 403 {"type":"error","error":{"type":"FreeTierError","message":"OpenCode's free tier can only be used from within OpenCode. Download it at https://opencode.ai and keep building."}}

Reproduced for every free model tried (space-bunny-free, big-pickle, deepseek-v4.1-flash-free), on both endpoints, on 100% of attempts.

Two details that may help pinpoint it:

  • The same 403 FreeTierError is returned when the Authorization header is omitted entirely. The free-tier check appears to run before authentication, so this is not a credential problem.
  • A paid model (deepseek-v4.1-flash) with the same key returns HTTP 402 {"error":{"type":"server_error","message":"Upstream request failed: Insufficient account funds"}}, which confirms the key is valid and the rejection is scoped to the free models.

Additional Context

The docs contradict the observed behavior in three places on https://opencode.ai/docs/zen:

  • Endpoints table lists https://opencode.ai/inference/openai/v1/chat/completions for space-bunny-free, big-pickle, beam-free, mimo-v2.6-flash-free, nemotron-3.5-lightning-free, deepseek-v4.1-flash-free and glm-5.3-flash-free.
  • Pricing table lists those same models as Free for input/output/cached read.
  • Free models section says they are "free on OpenCode for a limited time".

Also worth noting: beam-free is documented as unavailable in Venezuela (among other regions), so region-based availability is already a documented constraint for free models — but no equivalent constraint is documented for "only usable from within OpenCode", and no header, flag or opt-in is documented for enabling direct access.

Question: is direct API access to the free tier intentionally unsupported? If so, the docs should not publish those endpoints or should mark them in-app only. If it is supposed to work, the FreeTierError check appears to be applied too broadly.

Impact: third-party apps that follow the documented Zen integration for structured extraction have no way to use the free tier, and no documented paid model works without adding credits first.

Workaround used: switched to a different OpenAI-compatible provider with its own free tier; the Zen client code now skips the provider instead of failing.

No plugins involved. The app under test is a plain Node.js HTTP server (no dependencies) calling the endpoint above.

Activity

  1. opencode-agent commented on Oct 18, 2026

    @opencode-agent
    Contributor

    Thanks for the clear, detailed report, @nilsbarrios!

    To answer your question: the free models are meant to be used only from within OpenCode's own clients. The error message says so: "OpenCode's free tier can only be used from within OpenCode". The check runs on OpenCode's server, so calls from a third-party app (with or without an API key) are expected to get 403 FreeTierError. To use Zen from your own app, you need a paid model.

    You're right that the docs don't say this. The free models are listed with the /inference/openai/v1/chat/completions endpoint and "Free" pricing, and the Free models section mentions region limits but not this one. I've filed this as a request to make the docs clearer (and to bring up direct API access to the free tier, if the team wants it). Maintainers will decide what to do about it.

    Related issues:

  2. Tarquinen commented on Oct 20, 2026

    @Tarquinen
    Member

    Thanks for reaching out! OpenCode's free models are meant to be used only from within OpenCode's own clients, so direct API calls and third-party apps are rejected on purpose. For API access from other tools, please use the paid models on OpenCode Zen or Go: https://opencode.ai/v2/docs/console/go. Closing this issue.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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