返回目錄

dsh-gemini-oauth-bridge

精選清單收錄維護狀態: 活躍

hyqhyq3/dsh-gemini-oauth-bridge

將 Google AI(Antigravity/Gemini OAuth)訂閱橋接為 DeepSeek Harness 的 OpenAI 相容端點。

前往 GitHub
$ dsh plugin add dsh-gemini-oauth-bridge

安裝

dsh 沒有統一的安裝指令 —— 把該外掛 README 中的設定行加入你的 profile / patch 設定,然後重啟即可。

查看安裝教學

11

星數

5

Fork

JavaScript

語言

MIT

授權條款

2026-09-03

建立於

2026-11-09

最近推送

README

dsh-gemini-oauth-bridge

English | 简体中文

Bridges a Google AI subscription (AI Pro / AI Ultra, via the Antigravity / Code Assist OAuth surface) into an OpenAI-compatible endpoint that DeepSeek Harness (DSH) can use directly as a model provider.

Important boundary: Google AI subscription developer quotas only cover the AI Studio web UI and OAuth login inside official CLI tools (Gemini CLI / Antigravity); API-key usage is billed separately. This plugin speaks the same OAuth surface as the official client, so it consumes subscription quota rather than API credit — but that also means it is not a Google-sanctioned third-party integration. Account risk / breakage is possible; evaluate for yourself.

Features

  • Login and go: one-click Google OAuth from Settings → Gemini OAuth (authorization code + loopback callback), with automatic loadCodeAssist registration / onboardUser onboarding and upstream model discovery.
  • OpenAI-compatible endpoint: /gemini-oauth-bridge/v1/chat/completions (streaming SSE + non-streaming) and /v1/models (so DSH can discover models).
  • Full protocol translation: system messages, multimodal (data-URL images), function calling (tool_calls ↔ functionCall/functionResponse), reasoning_content (thinking stream), usage stats, finish-reason mapping.
  • Gemini 3 thought-signature replay: the server remembers upstream thoughtSignature values by tool-call id and re-attaches them to functionCall parts on the next turn — OpenAI format carries no signatures, and Gemini 3 multi-turn tool calls fail without replay.
  • Subscription-friendly (anti-drift): dynamically tracks the latest shipping Antigravity client version for the User-Agent (stale versions are rejected for newer models); requests carry requestType: "agent", a stable derived sessionId, and agent-<uuid> request IDs; keep-alive connections without Connection: close.
  • 429 cooldowns: parses upstream Retry-After / retryDelay, enters a per-model cooldown window, and refuses requests locally during it instead of hammering upstream.
  • Catalog honesty: an entry the upstream catalog flags disabled: true — e.g. gemini-4-argon-disabled ("Unavailable" / "available to Ultra and paid Pro plan subscribers") — is never published as a DSH model, so the picker cannot offer something that can only fail. A request for an id the account cannot use returns the upstream's own explanation plus a refresh hint instead of an opaque 404 Requested entity was not found. Per-model context/output limits are read from the upstream maxTokens / maxOutputTokens fields.
  • Browser-trust fence: a plugin prefix route is dispatched before DSH's own Host/Origin fence, so the bridge enforces its own — the Host must be an authority it serves (loopback by default), a Sec-Fetch-Site: cross-site request, an opaque Origin: null, or an Origin that disagrees with the Host is refused with 403, and a request carrying no Host at all is only accepted from a loopback peer.
  • Tabbed settings page: the section splits into Overview / Quota / Usage / Models panels, each carrying only its own actions (refresh client version, refresh quota, refresh model list, sign out). All four panels survive a sign-out: Quota and Usage explain what signing in would reveal, and Models shows a sign-in hint instead of the model list, because available models depend on the account's plan and the list endpoint needs a token — so losing the token never collapses the page back to the single-pane layout, and never leaves a stale list from a previous account on screen.
  • Subscription quota display: queries v1internal:retrieveUserQuotaSummary when opening Settings → Gemini OAuth and, at most once a minute, after a completed chat turn; a two-minute cache backs the status poll, so a busy conversation does not spend one upstream request per turn. Each pool shows its Weekly limit (weekly) and 5-hour limit (5h) remaining percentage, progress bar, reset time and refresh timestamp, with a one-click Refresh quota action.
  • Model family & thinking-effort grouping: collapses multi-effort upstream variants (*-low, *-medium, *-high, etc.) into a single base model entry with reasoningEfforts in DSH (llm-pi-ai), so you pick the model first and the thinking effort second; /v1/chat/completions resolves (model, reasoning_effort) back to the concrete upstream ID.
  • One catalogue, two doors: GET /v1/models applies the same publishable filter and the same effort grouping as the provider document and reports each entry's context/completion limits, so a discovery pass can never hand DSH a different list than the route actually serves.
  • Local usage dashboard: records per-call requests (succeeded / failed / 429 rate-limited) and prompt/completion tokens into local day and hour buckets, then renders KPI cards, a token bar + call-count line trend chart, a per-model share donut, and a per-model table. The chart drills down by click — weeks → days → the day's 24 hours — via a single Back up link. No tooltip layer sits on top: hovering a bar feeds that bucket's numbers to the KPI cards and the panel heading, and leaving the chart restores the period totals.
  • Single-flight token refresh: access tokens auto-renew 120 s before expiry; concurrent requests share one refresh.

Install

dsh plugin --profile web add github:hyqhyq3/dsh-gemini-oauth-bridge
# or a local checkout
dsh plugin --profile web add link:/path/to/dsh-gemini-oauth-bridge

Restart dsh --profile web, then open Settings → Gemini OAuth.

Usage

在 GitHub 閱讀完整 README →

DSH Plugins 是獨立的 DeepSeek Harness 外掛目錄,與 DeepSeek 官方無關,也不代表官方背書。第三方外掛未經安全稽核,安裝前請審查原始碼。

每週取得最新的 DeepSeek Harness 外掛,絕不濫發。