← All projects
Developer building blocks

AI SDK

A free TypeScript library that lets programmers add AI chat, text and agents to their web apps.

Widely used

What it does

The AI SDK is a code library for building AI features into apps made with popular web tools like React, Next.js, Svelte and Vue.

It offers one common way to talk to many AI providers, such as OpenAI, Anthropic and Google, so switching models takes little change. It can generate text, return neatly structured data, and power agents.

By default it routes requests through Vercel's own AI Gateway, but you can also connect directly to each provider.

Who it's for

Web developers working in JavaScript or TypeScript.

Can I use it without coding?

Developers only. Installed with npm and used in code; needs Node.js. New to this? Start here.

Can I run it?

Cost
Free, but needs an AI accountThe software is free, but it uses an online AI service (like OpenAI or Anthropic), which usually charges for use.
Computer
An ordinary computer is fine
Privacy
Sends what you give it to an online service
API key
Needed. An API key is a password-like code from an online AI service. What's that?

Try it

Using Claude Code, Cursor or another AI coding assistant? Paste the prompt and it will walk you through the setup.New to this?

Before you install

  • Only download from the official GitHub page. Copies with similar names exist for many popular projects.
  • No standard license listed. Check the GitHub page before using it for business.
  • Keep your API key private. Never paste it into websites or share it, and set a spending limit with the AI service.
  • What you type or upload is sent to an online service. Avoid sharing private or sensitive information.
  • More on staying safe

Where people are talking about it