Skip to content
Muhammad Septian
All projects

opencode-qwencode-oauth

Qwen OAuth plugin for the OpenCode coding agent, with multi-account rotation and OpenAI Responses ↔ Chat Completions translation.

Year
2026
Built with
TypeScript, Bun, OAuth
Links

A plugin that lets OpenCode use Qwen models through Qwen’s own OAuth login. It’s published on npm and configured from opencode.json.

Features

  • Device-flow OAuth with PKCE, so it works in headless and CI environments.
  • Multi-account rotation that picks an account using health scores, a token bucket, and LRU.
  • Proactive token refresh before tokens expire.
  • Rate-limit handling: detects 429 responses, rotates to another account, and respects retry-after.
  • API translation between the OpenAI Responses API and Chat Completions, including full SSE streaming.
  • Works on macOS, Linux, and Windows.

Setup

Add opencode-qwencode-oauth to the plugin list in opencode.json, together with a qwen provider. The full configuration is in the README.