Skip to content
PluginStats

ai-sdk-provider-opencode-sdk weekly downloads statistics

By ben-vargas (4 listings) · npm · AI SDKs

AI SDK v7 provider for OpenCode 2.x via @opencode/client: sessions, streaming, tool approvals, and interactive forms

View on npm Fresh · Dec 6, 2026

ai-sdk-provider-opencode-sdk has 59,930 recorded weekly downloads on npm, a decrease of 46.2% over the past 30 days, ranking #739 of 3,247 tracked listings.

Weekly downloads
59,930
Official API · Dec 5, 2026
7-day growth
-26.1%
-21.1K weekly downloads
30-day growth
-46.2%
-51.5K weekly downloads
90-day growth
-6.1%
-3.9K weekly downloads
Rank
#739
▼ 79 in 7 days

About ai-sdk-provider-opencode-sdk

<p align="center"> <a href="https://www.npmjs.com/package/ai-sdk-provider-opencode-sdk"><img src="https://img.shields.io/npm/v/ai-sdk-provider-opencode-sdk?color=00A79E" alt="npm version" /></a> <a href="https://www.npmjs.com/package/ai-sdk-provider-opencode-sdk"><img src="https://img.shields.io/npm/unpacked-size/ai-sdk-provider-opencode-sdk?color=00A79E" alt="install size" /></a> <a href="https://www.npmjs.com/package/ai-sdk-provider-opencode-sdk"><img src="https://img.shields.io/npm/dy/ai-sdk-provider-opencode-sdk.svg?color=00A79E" alt="npm downloads" /></a> <a href="https://nodejs.org/en/about/releases/"><img src="https://img.shields.io/badge/node-%3E%3D22-00A79E" alt="Node.js ≥ 22" /></a> <a href="https://www.npmjs.com/package/ai-sdk-provider-opencode-sdk"><img src="https://img.shields.io/npm/l/ai-sdk-provider-opencode-sdk?color=00A79E" alt="License: MIT" /></a> </p>

AI SDK Provider for OpenCode

5.x targets OpenCode 2.x. Still running an OpenCode 1.x server? Use the 4.x line: npm install ai-sdk-provider-opencode-sdk@opencode-v1. Not sure which you have? See Which version do I need?

A community provider for the Vercel AI SDK (v7) that runs generations through an OpenCode 2.x server via @opencode/client. OpenCode is an AI coding agent: it owns the model catalog, executes tools server-side, and manages sessions; this provider maps that onto generateText() / streamText() with tool observation, two-phase tool approvals, interactive forms, and native usage/cost metadata.

Which version do I need?

Two things decide it: your AI SDK major version and your OpenCode server major version.

OpenCode 2.xOpenCode 1.x
AI SDK v75.x — npm i ai-sdk-provider-opencode-sdk4.x — npm i ai-sdk-provider-opencode-sdk@opencode-v1
AI SDK v6not supported3.x (legacy) — npm i ai-sdk-provider-opencode-sdk@ai-sdk-v6
AI SDK v5not supported0.x (legacy) — npm i ai-sdk-provider-opencode-sdk@ai-sdk-v5

Which OpenCode do I have? opencode --version prints opencode v2.x.y on OpenCode 2 and a bare 1.x.y on OpenCode 1. A running 2.x server also answers GET /api/info with its version; a 1.x server has no such route. Note that the npm package opencode-ai is OpenCode 1.x — OpenCode 2.x is published as @opencode/cli.

Version compatibility

ProviderAI SDKOpenCode servernpm tagBranchStatus
5.xv72.x (@opencode/cli; tested against 2.0.24)latestmainActive
4.xv71.x (opencode-ai)opencode-v1opencode-v1Maintenance
3.xv61.xai-sdk-v6ai-sdk-v6Legacy
2.x, 1.xv61.x—historicalLegacy
0.xv51.xai-sdk-v5ai-sdk-v5Legacy

Maintenance lines get bug fixes; Legacy lines stay installable but receive no further releases.

Upgrading from 4.x? OpenCode 2.x is a new backend, not an SDK bump, and most settings changed — see docs/migrating-v4-to-v5.md and the CHANGELOG.

Server

5.x pins @opencode/client@2.0.24. Run the matching server from the published @opencode/cli (binary opencode, also exposed as opencode2), or use the opencode 2.x binary from the official installer:

OPENCODE_PASSWORD=<password> npx @opencode/cli@2.0.24 serve --port 4096

serve requires HTTP Basic auth on every route: username opencode, password from OPENCODE_PASSWORD or printed at startup as server password <...>. A server without the 2.x /api/info route (OpenCode 1.x, or the pre-2.0 beta builds) is reported as incompatible on first use.

Requirements

  • Node.js >= 22
  • An OpenCode 2.x server — npx @opencode/cli@2.0.24 serve (note the package is @opencode/cli, not opencode-ai)
  • Credentials on that server for the providers you want to use. The OpenCode zen free tier works without credentials on 2.x.
npm install ai-sdk-provider-opencode-sdk ai@^7.0.0

Quick start

The 2.x server requires Basic auth (opencode:<password>) on every route:

import { generateText } from "ai";
import { createOpencode } from "ai-sdk-provider-opencode-sdk";

// the password the server was started with (`OPENCODE_PASSWORD`)
const password = process.env.OPENCODE_PASSWORD ?? "";

const opencode = createOpencode({
  baseUrl: "http://127.0.0.1:4096",
  clientOptions: {
    headers: {
      Authorization:
        "Basic " + Buffer.from(`opencode:${password}`).toString("base64"),
    },
  },
});…

Description from the npm listing.

  • ai-sdk
  • ai-sdk-provider
  • vercel-ai-sdk
  • opencode
  • opencode-v2
  • opencode-sdk
  • language-model
  • llm

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

ai-sdk-provider-opencode-sdk weekly downloads on npm, last 90 days: 59,930 weekly downloads as of Dec 5, 2026, -6.1% over 90 days.ai-sdk-provider-opencode-sdkWeekly downloads on npm · Last 90 days59,930downloads / week-6.1% over 90 days020K40K60K80K100K120KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
ai-sdk-provider-opencode-sdk weekly downloads on npm, last 90 days: 59,930 weekly downloads as of Dec 5, 2026, -6.1% over 90 days.

7/30/90-day growth

ai-sdk-provider-opencode-sdk weekly downloads growth on npm: -26.1% over 7 days, -46.2% over 30 days, -6.1% over 90 days.ai-sdk-provider-opencode-sdkWeekly downloads growth on npm59,930downloads / week now7-day growth-21,134 weekly downloads-26.1%30-day growth-51,523 weekly downloads-46.2%90-day growth-3,899 weekly downloads-6.1%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
ai-sdk-provider-opencode-sdk weekly downloads growth on npm: -26.1% over 7 days, -46.2% over 30 days, -6.1% over 90 days.

Ranking history

ai-sdk-provider-opencode-sdk npm ranking history: currently #739 (by weekly downloads).ai-sdk-provider-opencode-sdknpm ranking · by weekly downloads · Last 90 days#739current rank#100#200#300#400#500#600#700#800Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
ai-sdk-provider-opencode-sdk npm ranking history: currently #739 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 37, #19 (overall #739)
All npm: every listing in weekly downloads order

Listing placement

AI SDKs378 listings · 19 pages · page 3, #6 (overall #46)
AI SDKs: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (592)
Recent weekly downloads observations for ai-sdk-provider-opencode-sdk
Date (UTC)Weekly downloadsChange vs. previous
59,930-9.4K
69,370+473
68,897-2.4K
71,284-2.2K
73,442-2.7K
76,173-3K
79,145-1.9K
81,064-2.4K
83,493-4K
87,469-1.7K
89,170-6.6K
95,738-3K
98,734-977
99,711—

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/ai-sdk-provider-opencode-sdk. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.