Integration
InferencePass with the Vercel AI SDK.
Stream routed chat completions into Next.js and TypeScript applications using an OpenAI-compatible provider.
Create the provider
Configure the provider in server code and read the API key from a server environment variable.
Vercel AI SDK
const inferencepass = createOpenAI({
name: "inferencepass",
apiKey: process.env.INFERENCEPASS_API_KEY,
baseURL: "https://api.inferencepass.com/v1",
});
const result = streamText({
model: inferencepass("auto"),
prompt: "Explain vector search simply.",
});Streaming
The gateway emits OpenAI-compatible SSE chunks, which lets the AI SDK surface incremental text without waiting for the full provider response.
Production handling
Abort work when the client disconnects, cap output for each product action, and translate upstream failures into a useful retry state.