Skip to content
PluginStats

@tanstack/openai-base weekly downloads statistics

By tanstack (52 listings) · npm · AI SDKs

Shared OpenAI SDK base adapters for TanStack AI providers using Chat Completions and Responses APIs.

View on npm Fresh · Oct 17, 2026

@tanstack/openai-base has 258,276 recorded weekly downloads on npm, an increase of 101% over the past 30 days.

It ranks #323 of 2,256 tracked npm listings by weekly downloads.

Over 90 days, weekly downloads changed by +370%.

PluginStats has 543 daily observations since Apr 23, 2025; the latest is from Oct 17, 2026.

Weekly downloads
258,276
Official API · Oct 17, 2026
7-day growth
-17.4%
-54.4K weekly downloads
30-day growth
+101%
+130K weekly downloads
90-day growth
+370%
+203.3K weekly downloads
Rank
#323
Among tracked npm listings

About @tanstack/openai-base

@tanstack/openai-base

Shared base adapters for providers that drive the official openai SDK against a different baseURL.

TL;DR

Several providers ship endpoints that the official openai Node SDK can talk to verbatim — you just point it at a different baseURL. xAI's Grok endpoint, Groq's /openai/v1 endpoint, and OpenAI itself all fall in this camp. This package contains the shared logic for both wire formats those endpoints expose:

• OpenAIBaseChatCompletionsTextAdapter — for /v1/chat/completions • OpenAIBaseResponsesTextAdapter — for /v1/responses

Provider packages (@tanstack/ai-openai, @tanstack/ai-groq, @tanstack/ai-grok) construct an OpenAI client with their own baseURL, pass it to the relevant base adapter, and override a small set of protected hooks for SDK-shape variance and provider-specific quirks.

Why this package exists

Every text adapter in TanStack AI — regardless of provider — emits AG-UI events (RUN_STARTED, TEXT_MESSAGE_*, TOOL_CALL_*, RUN_FINISHED, …) as its output stream. That is the universal unification.

Input protocols differ. The OpenAI Chat Completions and Responses wire formats both have multiple implementers in the ecosystem, so it pays to write the streaming-chunk assembly, partial-JSON tool-arg buffering, tool-call deduplication, and structured-output coercion once and share it. That shared code lives here.

Providers whose native API doesn't match either OpenAI wire format (Anthropic, Gemini, Ollama's native API, OpenRouter's own SDK) extend BaseTextAdapter from @tanstack/ai directly — there's nothing to share, so they don't pay the indirection cost.

What goes here vs. in @tanstack/ai-openai

| Belongs in @tanstack/openai-base | Belongs in @tanstack/ai-openai |

| Logic for the Chat Completions wire format | OpenAI-specific tool types (web_search_preview, code_interpreter, local_shell, apply_patch, computer_use, mcp, …) | | Logic for the Responses wire format | OpenAI model metadata, model lists, capability matrices | | Streaming chunk assembly, AG-UI lifecycle, partial-JSON tool-arg buffering, tool-call deduplication | OpenAI-only request/response fields that no other consumer of the base sets | | Schema converters and structured-output coercion that all consumers accept | OpenAI's media adapters (image/TTS/video/transcription) that Grok/Groq don't implement |

Rule of thumb: if a field would be useful to at least two of the consuming packages (ai-openai, ai-grok, ai-groq), it belongs here. Otherwise it belongs in the provider's own package, plumbed in via a subclass override or a hook.

How providers extend the bases

The base constructor takes a pre-built OpenAI client. Subclasses construct the SDK with their own baseURL (and any other client options) and pass it to super:

Per-provider quirks are handled via protected hooks:

• convertMessage, mapOptionsToRequest — bridge request-shape differences (extra fields, omitted fields, alternative encodings). • extractReasoning — surface a provider's reasoning channel into the shared REASONING_* AG-UI lifecycle. • transformStructuredOutput, makeStructuredOutputCompatibleWithMap — adjust structured-output handling for provider quirks (e.g. Groq's schema-shape requirements). • processStreamChunks — wrap the shared chunk processor for last-mile fixups (e.g. Groq's x_groq.usage → chunk.usage promotion). • extractTextFromResponse — pull the assistant text out of the provider's non-streaming response shape.

Each provider typically overrides 2–6 hooks and inherits everything else.

Architecture

Note: ai-openai ships only the Responses-based text adapter. For pure Chat Completions use cases without OpenAI-specific behaviour, use ai-grok or ai-groq, or build a new provider package extending OpenAIBaseChatCompletionsTextAdapter.

Direct use

Most users don't import from this package directly; they install a provider package and the adapter from there does the work.

If you're building an adapter for a new endpoint that the official openai SDK can talk to verbatim (vLLM, Together, Fireworks, a self-hosted gateway, …), import the abstract adapters from this package and subclass them. The existing providers are worked examples — @tanstack/ai-grok is the simplest (xAI's API is a near-direct OpenAI Chat Completions clone), @tanstack/ai-groq shows the processStreamChunks and makeStructuredOutputCompatibleWithMap override pattern.

Description from the npm listing.

  • ai
  • ai-sdk
  • typescript
  • tanstack
  • openai
  • adapter
  • provider-adapter
  • chat-completions
  • responses-api
  • structured-outputs

Where @tanstack/openai-base sits in the listing

Each band is one page of 20. Weekly downloads on a log 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.

All npm2,256 listings · 113 pages · page 17, #3 (overall #323)
All npm: every listing in weekly downloads order
PNG SVG
AI SDKs250 listings · 13 pages · page 1, #13 (overall #13)
AI SDKs: every listing in weekly downloads order
PNG SVG

Charts

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

Adoption over time

@tanstack/openai-base weekly downloads on npm, last 90 days: 258,276 weekly downloads as of Oct 17, 2026, +370% over 90 days.@tanstack/openai-baseWeekly downloads on npm · Last 90 days258,276downloads / week+370% over 90 days0100K200K300K400K500KJul 19Aug 3Aug 18Sep 2Sep 17Oct 2Oct 17downloads / weekobservedarchived (Internet Archive)no observationsJul 21, 2026 – Oct 17, 2026 · 89 observations · Updated Oc…pluginstats.com
@tanstack/openai-base weekly downloads on npm, last 90 days: 258,276 weekly downloads as of Oct 17, 2026, +370% over 90 days.
PNG SVG

7/30/90-day growth

@tanstack/openai-base weekly downloads growth on npm: -17.4% over 7 days, +101% over 30 days, +370% over 90 days.@tanstack/openai-baseWeekly downloads growth on npm258,276downloads / week now7-day growth-54,367 weekly downloads-17.4%30-day growth+130,041 weekly downloads+101%90-day growth+203,339 weekly downloads+370%Growth vs. nearest observation to each baseline date · Updated Oct 17, 2026pluginstats.com
@tanstack/openai-base weekly downloads growth on npm: -17.4% over 7 days, +101% over 30 days, +370% over 90 days.
PNG SVG

Ranking history

@tanstack/openai-base npm ranking history: currently #323 (by weekly downloads).@tanstack/openai-basenpm ranking · by weekly downloads · Last 90 days#323current rank#100#150#200#250#300#350Jul 21Aug 5Aug 20Sep 4Sep 19Oct 4Oct 19rankOct 17, 2026 – Oct 19, 2026 · 3 observations · Updated Oct 17, 2026pluginstats.com
@tanstack/openai-base npm ranking history: currently #323 (by weekly downloads).
PNG SVG

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.

Recent observations

Full history (543)
Recent weekly downloads observations for @tanstack/openai-base
Date (UTC)Weekly downloadsChange vs. previous
258,276-67K
325,262+24.2K
301,063-68.2K
369,219-47.2K
416,3760
416,376+61K
355,340+42.7K
312,643+42.2K
270,491+38.5K
231,956+33.1K
198,862+13K
185,853-31.4K
217,225+694
216,531—

Similar npm AI SDKs plugins

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/@tanstack/openai-base. First seen Oct 16, 2026; last successful collection Oct 19, 2026. See the methodology.