@dxv-systems/ai weekly downloads statistics
By dxv-systems · npm · AI SDKs
App client for the DXV AI gateway: OpenAI and Vercel AI SDK providers, Kennisbank Ask, passages and access groups, and agent runs. Server only.
@dxv-systems/ai has 3,730 recorded weekly downloads on npm, an increase of 81.6% over the past 30 days, ranking #1652 of 3,247 tracked listings.
About @dxv-systems/ai
@dxv-systems/ai
App client for the DXV AI gateway (/api/ai/v1): a standard OpenAI client, a Vercel AI SDK provider, Kennisbank Ask and agent runs, all with the app's own credentials and a per-feature label.
Server only. The helpers use gateway credentials. Importing the package in a browser bundle is a bug: every factory throws AiConfigError when window exists. Call it from route handlers, server actions and jobs.
Install
npm install @dxv-systems/ai # ask() and runs
npm install openai # only for @dxv-systems/ai/openai
npm install @ai-sdk/openai-compatible ai # only if you use the AI SDK subpath
openai and @ai-sdk/openai-compatible are optional peer dependencies: install the one you use. openai() lives in @dxv-systems/ai/openai and aiSdk() in @dxv-systems/ai/ai-sdk, separate entry points so a bundler never resolves a package you did not install. The main entry (ask, createRuns, the errors, isAiUnavailable) imports neither.
Environment
| Variable | Meaning |
|---|---|
DXV_AI_GATEWAY_URL | Full gateway base. Default https://platform.dxvagentic.com/api/ai/v1. |
DXV_AI_GATEWAY_TOKEN | Gateway token. When set, it is sent as the bearer. |
VERCEL_OIDC_TOKEN | Used when DXV_AI_GATEWAY_TOKEN is not set. Read through @vercel/oidc on every request (it refreshes; nothing is cached at import time). |
AI_PROVIDER | dxv (default), openai, anthropic or openrouter. Swaps inference only, see below. |
AI_MODEL_LOW AI_MODEL_MEDIUM AI_MODEL_HIGH AI_MODEL_MAX (AI_MODEL_AUTO) | Model id each dxv/* alias maps to under a non-dxv provider. |
OPENAI_API_KEY OPENROUTER_API_KEY ANTHROPIC_API_KEY | Key of the swapped-to provider. |
Credentials
The package looks for a credential in this order on every request:
DXV_AI_GATEWAY_TOKEN, when set.- A Vercel OIDC token. On a Vercel deployment it is injected for you. Locally, run
vercel env pullin the app: it writesVERCEL_OIDC_TOKENto.env.local. The token is short lived; pull again when it expires.
With neither source the call throws AiConfigError naming these variables and vercel env pull.
Never put a provider key in the app unless you set AI_PROVIDER to swap away from DXV. With the default provider the gateway holds the keys, budgets and usage records; an app-held key bypasses all of it.
Features
Every factory takes { feature }, the label that appears in the gateway's usage and AI feature registry (X-DXV-Feature). It must match ^[A-Za-z0-9._:-]{1,100}$, otherwise the factory throws AiConfigError. Use a stable key per product feature (search.summary), never a per-user value.
OpenAI client
import { openai } from "@dxv-systems/ai/openai";
const client = openai({ feature: "support.reply" });
const res = await client.chat.completions.create({
model: "dxv/medium", // dxv/low | dxv/medium | dxv/high | dxv/max | dxv/auto
messages: [{ role: "user", content: "Summarise this ticket" }],
});
openai() returns a plain OpenAI instance from the openai package. The base URL, the per-request bearer and X-DXV-Feature are set for you; the API key is a placeholder the gateway ignores. Retries are the SDK's own (the gateway's x-should-retry stops retries on budget errors). Errors stay the SDK's errors (APIError, RateLimitError, ...).
openai({ feature, context }) also sends X-DXV-Context (at most 2000 characters, Latin-1, no control characters) for features with retrieval enabled.
Images
The gateway generates images. Use the SDK's own images.generate():
import { openai } from "@dxv-systems/ai/openai";
const res = await openai({ feature: "content.image" }).images.generate({
model: "google/gemini-3.1-flash-image",
prompt: "A red bicycle against a white wall",
aspect_ratio: "4:5", // a gateway field, not in the SDK's types
} as never);
const image = Buffer.from(res.data![0].b64_json!, "base64");
modelis an exact image model id. Adxv/*alias or a text model is a 400.- The gateway forwards
prompt,n(1 to 10),resolution,aspect_ratio,size,quality,output_format,background,output_compressionandinput_references(1 to 8 source images for an edit, each{ type: "image_url", image_url: { url } }with adata:orhttps://URL). Other fields, such as the SDK'sresponse_format, are dropped, not refused. stream: trueis a 400, and a request body over 4 MB is a 413.- With another
AI_PROVIDER, the model id and the extra fields are that provider's.
Vercel AI SDK
import { generateText } from "ai";
import { aiSdk } from "@dxv-systems/ai/ai-sdk";
const dxv = aiSdk({ feature: "support.reply" });
const { text } = await generateText({ model: dxv.chatModel("dxv/high"), prompt: "..." });
Ask
import { ask } from "@dxv-systems/ai";
const r = await ask({ feature: "faq", question: "What are the opening hours?", endUser: session?.userId ?? null });
r.answer; r.sources; r.needsHuman; r.insufficientContext; r.reviewRequired;
endUser is required (string | null): it narrows the gateway's per-person limits. path optionally narrows the search: one folder or document, or a list of 1-10 searched as one set (for example the folders a user's role may read). Every entry must lie inside the feature's registered folders, else the gateway answers 400 (AiRequestError).
Access groups
When who may see a document is data in your app (roles set per document), map your roles onto access groups. The kennisbank never sees your users or roles, only these keys.
import { ask, setDocumentGroups, syncAccess } from "@dxv-systems/ai";…
Description from the npm listing.
- dxv
- ai
- gateway
- openai
- ai-sdk
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 (142)Similar npm AI SDKs plugins
All 20 @dxv-systems/ai 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/@dxv-systems/ai. First seen Nov 9, 2026; last successful collection Dec 6, 2026. See the methodology.