Skip to content
PluginStats

@tanstack/openai-base weekly downloads statistics

By tanstack (53 listings) · npm · AI SDKs

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

View on npm Fresh · Dec 6, 2026

@tanstack/openai-base has 4,260,219 recorded weekly downloads on npm, an increase of 256% over the past 30 days, ranking #180 of 3,247 tracked listings.

Weekly downloads
4,260,219
Official API · Dec 5, 2026
7-day growth
+14.0%
+522.4K weekly downloads
30-day growth
+256%
+3.1M weekly downloads
90-day growth
+3661%
+4.1M weekly downloads
Rank
#180
Among tracked npm listings

About @tanstack/openai-base

<div align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/api/readme/ai.png?theme=dark" /> <source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/api/readme/ai.png" /> <img src="https://tanstack.com/api/readme/ai.png" alt="TanStack AI" width="900" /> </picture> </div> <br />

@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-baseBelongs in @tanstack/ai-openai
Logic for the Chat Completions wire formatOpenAI-specific tool types (web_search_preview, code_interpreter, local_shell, apply_patch, computer_use, mcp, …)
Logic for the Responses wire formatOpenAI model metadata, model lists, capability matrices
Streaming chunk assembly, AG-UI lifecycle, partial-JSON tool-arg buffering, tool-call deduplicationOpenAI-only request/response fields that no other consumer of the base sets
Schema converters and structured-output coercion that all consumers acceptOpenAI'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:

import OpenAI from 'openai'
import { OpenAIBaseResponsesTextAdapter } from '@tanstack/openai-base'
import type { GrokTextConfig } from '@tanstack/ai-grok'

declare function withGrokDefaults(config: GrokTextConfig): GrokTextConfig

class GrokTextAdapter<
  TModel extends string,
> extends OpenAIBaseResponsesTextAdapter<TModel> {
  constructor(config: GrokTextConfig, model: TModel) {
    const options = withGrokDefaults(config)
    super(model, 'grok', new OpenAI(options), { fetch: options.fetch })
  }
}

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…

Description from the npm listing.

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

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

@tanstack/openai-base weekly downloads on npm, last 90 days: 4,260,219 weekly downloads as of Dec 5, 2026, +3661% over 90 days.@tanstack/openai-baseWeekly downloads on npm · Last 90 days4,260,219downloads / week+3661% over 90 days01M2M3M4M5MSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@tanstack/openai-base weekly downloads on npm, last 90 days: 4,260,219 weekly downloads as of Dec 5, 2026, +3661% over 90 days.

7/30/90-day growth

@tanstack/openai-base weekly downloads growth on npm: +14.0% over 7 days, +256% over 30 days, +3661% over 90 days.@tanstack/openai-baseWeekly downloads growth on npm4,260,219downloads / week now7-day growth+522,359 weekly downloads+14.0%30-day growth+3,064,164 weekly downlo…+256%90-day growth+4,146,937 weekly downlo…+3661%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@tanstack/openai-base weekly downloads growth on npm: +14.0% over 7 days, +256% over 30 days, +3661% over 90 days.

Ranking history

@tanstack/openai-base npm ranking history: currently #180 (by weekly downloads).@tanstack/openai-basenpm ranking · by weekly downloads · Last 90 days#180current rank#100#150#200#250#300#350#400Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
@tanstack/openai-base npm ranking history: currently #180 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 9, #20 (overall #180)
All npm: every listing in weekly downloads order

Listing placement

AI SDKs378 listings · 19 pages · page 1, #7 (overall #7)
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 @tanstack/openai-base
Date (UTC)Weekly downloadsChange vs. previous
4,260,219+71.9K
4,188,302+126.2K
4,062,115+112.3K
3,949,840+93.3K
3,856,558+64.2K
3,792,385+21.2K
3,771,192+33.3K
3,737,860+12.8K
3,725,057-28.6K
3,753,636+36.4K
3,717,199+65.9K
3,651,306+105.1K
3,546,245+101.6K
3,444,603—

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 Dec 6, 2026. See the methodology.