
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
ai-sdk-openai-websocket-fetch
Advanced tools
WebSocket transport for the AI SDK OpenAI provider — drop-in fetch replacement that routes streaming requests through a persistent WebSocket connection.
Drop-in fetch replacement that routes OpenAI Responses API streaming requests through a persistent WebSocket connection instead of HTTP.
npm install ai-sdk-openai-websocket-fetch
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(),
});
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.
MIT
FAQs
WebSocket transport for the AI SDK OpenAI provider — drop-in fetch replacement that routes streaming requests through a persistent WebSocket connection.
The npm package ai-sdk-openai-websocket-fetch receives a total of 23,355 weekly downloads. As such, ai-sdk-openai-websocket-fetch popularity was classified as popular.
We found that ai-sdk-openai-websocket-fetch demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.