
AI Integration
RSS →Production Node.js patterns for OpenAI APIs, RAG, streaming, retries, cost controls, and vector search. Start here when an AI feature needs to behave like the rest of your backend: observable, testable, bounded, and safe to deploy.
Wiring an LLM into a Node.js backend is mostly unglamorous engineering: streaming, retries, token budgets, and the failure modes nobody mentions in the quickstart. This section keeps that part front and center. You will find practical integrations with the OpenAI and Claude APIs, function and tool calling, response streaming with the Vercel AI SDK, retrieval-augmented generation backed by Postgres and pgvector, LangChain.js when orchestration earns its weight, and building an MCP server in TypeScript. Every guide notes the rate limits and the ways a call can fail before it shows you the happy path, because in production the happy path is the part you spend the least time on. The code targets current Node.js LTS and the SDKs as they actually behave today, not the marketing version.
Start here
Related sections: Tutorials · Deploy & DevOps


Stream AI responses in Node.js with the Vercel AI SDK

OpenAI function calling in Node.js

Build an MCP server in Node.js and TypeScript

Claude API in Node.js

Building a RAG API in Node.js: the setup I’d ship in 2026

How to use the OpenAI API in Node.js (with streaming, retries, and cost control)
FAQ
OpenAI or Claude for a Node.js integration?
How do I stream responses instead of waiting for the whole thing?
Stream tokens over Server-Sent Events or use a toolkit that handles the transport for you. The Vercel AI SDK streaming guide covers both the server and client halves.
What is RAG and do I need it?
Retrieval-augmented generation feeds the model relevant chunks of your own data at query time instead of fine-tuning. You need it when answers must come from your documents. The RAG guide builds one on pgvector.
How do I handle rate limits and failures?
Expect 429s and timeouts as normal traffic: retry with exponential backoff and jitter, set a token budget per request, and degrade gracefully when the provider is down. Treat the model as an unreliable network dependency, because it is.