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
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.
About ai-sdk-provider-opencode-sdk
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.x | OpenCode 1.x | |
|---|---|---|
| AI SDK v7 | 5.x — npm i ai-sdk-provider-opencode-sdk | 4.x — npm i ai-sdk-provider-opencode-sdk@opencode-v1 |
| AI SDK v6 | not supported | 3.x (legacy) — npm i ai-sdk-provider-opencode-sdk@ai-sdk-v6 |
| AI SDK v5 | not supported | 0.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
| Provider | AI SDK | OpenCode server | npm tag | Branch | Status |
|---|---|---|---|---|---|
| 5.x | v7 | 2.x (@opencode/cli; tested against 2.0.24) | latest | main | Active |
| 4.x | v7 | 1.x (opencode-ai) | opencode-v1 | opencode-v1 | Maintenance |
| 3.x | v6 | 1.x | ai-sdk-v6 | ai-sdk-v6 | Legacy |
| 2.x, 1.x | v6 | 1.x | — | historical | Legacy |
| 0.x | v5 | 1.x | ai-sdk-v5 | ai-sdk-v5 | Legacy |
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, notopencode-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
7/30/90-day growth
Ranking history
Listing placement
Listing placement
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)Similar npm AI SDKs plugins
All 20 ai-sdk-provider-opencode-sdk alternativesData 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.