@vercel/ai-sdk-openai-websocket-fetch has 11,435 recorded weekly downloads on npm, an increase of 101% over the past 30 days.
About @vercel/ai-sdk-openai-websocket-fetch
ai-sdk-openai-websocket-fetch
Drop-in fetch replacement that routes OpenAI Responses API streaming requests through a persistent WebSocket connection instead of HTTP.
Installation
npm install ai-sdk-openai-websocket-fetch
Usage
import { streamText } from 'ai';
import { createOpenAI } from '@ai-sdk/openai';
import { createWebSocketFetch } from 'ai-sdk-openai-websocket-fetch';
const wsFetch = createWebSocketFetch();
const openai = createOpenAI({ fetch: wsFetch });
const result = streamText({
model: openai('gpt-4.1-mini'),
prompt: 'Hello!',
onFinish: () => wsFetch.close(),
});
Why?
OpenAI's WebSocket API keeps a persistent connection open. After the initial handshake, subsequent requests skip TCP/TLS/HTTP negotiation entirely — reducing TTFB in multi-step agentic workflows where the model makes many tool calls.
License
MIT
Description from the npm listing.
- ai-sdk
- openai
- websocket
- streaming
- fetch
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 (122)Similar npm AI SDKs plugins
All 20 @vercel/ai-sdk-openai-websocket-fetch 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/@vercel/ai-sdk-openai-websocket-fetch. First seen Oct 16, 2026; last successful collection Oct 22, 2026. See the methodology.