Skip to content

Use Claude Code, Codex, VSCode, Pi, and OpenCode (and 6 other harnesses) for free (1.3B+ free tokens) from your terminal, app, IDE, or phone, and now from the browser with native browser sessions (multi-harness + multi-model) like OpenClaw (voice supported + ToS friendly)

Python

fix: identify as opencode client to avoid zen throttling (#1471)

Davidaa0ce465fcd2
diff --git a/src/free_claude_code/providers/openai_chat/profiles.py b/src/free_claude_code/providers/openai_chat/profiles.py
index ac8961fc..6dac8048 100644
--- a/src/free_claude_code/providers/openai_chat/profiles.py
+++ b/src/free_claude_code/providers/openai_chat/profiles.py
@@ -426,10 +426,12 @@ OPENAI_CHAT_PROFILES: dict[str, OpenAIChatProfile] = {
"opencode_zen": OpenAIChatProfile(
_policy("OPENCODE_ZEN", ReasoningReplayMode.REASONING_CONTENT),
NO_REASONING,
+ user_agent="opencode",
),
"opencode_go": OpenAIChatProfile(
_policy("OPENCODE_GO", ReasoningReplayMode.REASONING_CONTENT),
NO_REASONING,
+ user_agent="opencode",
),
"vercel": OpenAIChatProfile(
_policy(
diff --git a/tests/providers/test_opencode.py b/tests/providers/test_opencode.py
index dd4b4a9f..f2b663d2 100644
--- a/tests/providers/test_opencode.py
+++ b/tests/providers/test_opencode.py
@@ -12,6 +12,24 @@ from tests.providers.support import (
)
[email protected]("provider_id", ["opencode_zen", "opencode_go"])
+def test_client_identifies_as_first_party_opencode_user_agent(
+ provider_id: str,
+) -> None:
+ """OpenCode Zen throttles third-party free usage; FCC identifies as ``opencode``."""
+ provider = profiled_provider(
+ provider_id,
+ make_provider_config(
+ api_key="test_opencode_key",
+ base_url="https://example.invalid/v1",
+ rate_limit=1,
+ rate_window=1,
+ ),
+ admission=immediate_admission(),
+ )
+ assert provider._client.default_headers["User-Agent"] == "opencode"
+
+
@pytest.mark.parametrize("provider_id", ["opencode_zen", "opencode_go"])
def test_build_request_body_replays_tool_reasoning_natively(
provider_id: str,