AI SDK
SDK and development tools · Free
A Vercel TypeScript SDK for text and structured data generation, tool calls, agents, and streaming AI interfaces with different model providers.
Also known as: vercel/ai

What you can use for free
You can use the code under the stated license; servers, APIs, and compute must be provided separately.
Paid features and costs
Model APIs, AI Gateway, and hosting are billed separately; Apache-2.0 applies to the SDK.
Access and limitations
You can use the code under the stated license; servers, APIs, and compute must be provided separately. Model APIs, AI Gateway, and hosting are billed separately; Apache-2.0 applies to the SDK.
Use cases
- Connect a provider and start with a short request or streamText in a server route.
- Define tool and output schemas, add UI streaming, and handle failures.
Example workflow
A possible workflow; this is not a report of hands-on testing.
A Vercel TypeScript SDK for text and structured data generation, tool calls, agents, and streaming AI interfaces with different model providers.
Before you start
- A TypeScript project, a model provider, and an input data schema.
Steps
- Connect a provider and start with a short request or streamText in a server route.
- Define tool and output schemas, add UI streaming, and handle failures.
- Compare the result with the workflow's goal; after changing the project, run its standard checks.
Check your result
- The response structure is validated; errors, cancellation, and the token limit are handled.
- Check connection permissions and dependency terms; confirm external service costs if the workflow requires them.
Choosing AI SDK
Connect a provider and start with a short request or streamText in a server route.
Choose this when
- Connect a provider and start with a short request or streamText in a server route.
- Define tool and output schemas, add UI streaming, and handle failures.
Requirements
- Choose gateway or direct provider credentials and install the package for your UI framework.
Things to consider
- Costs and limits of free use: Model APIs, AI Gateway, and hosting are billed separately; Apache-2.0 applies to the SDK.
- Terms of use: Apache-2.0 for this repository; connected services, models, and data have separate terms.
- The SDK does not include free inference; the model provider, gateway, and hosting have their own terms.
Frequently asked questions
What can you use for free in AI SDK?
You can use the code under the stated license; servers, APIs, and compute must be provided separately.
What additional costs might arise with AI SDK?
Model APIs, AI Gateway, and hosting are billed separately; Apache-2.0 applies to the SDK.
What terms of use matter for AI SDK?
Apache-2.0 for this repository; connected services, models, and data have separate terms.
How do you get started with AI SDK?
Connect a provider and start with a short request or streamText in a server route. Define tool and output schemas, add UI streaming, and handle failures. Compare the result with the workflow's goal; after changing the project, run its standard checks.
Does AI SDK require Vercel hosting or support direct provider connections?
The provider-agnostic TypeScript toolkit supports generation, structured Output/schema, tools/agents, and UI streaming. A model string uses Vercel AI Gateway by default; provider packages enable direct connections. AI SDK UI has a separate framework package, such as @ai-sdk/react. Current README installation instructions require Node.js 22+ on the development machine.
License
Apache-2.0 for this repository; connected services, models, and data have separate terms.
Apache 2.0 — permissive license with patent terms
You can use and modify the code in commercial and closed-source projects. When distributing it, retain the license and relevant notices, identify modified files, and include NOTICE if provided. Authors grant a limited patent license for their contributions; it does not grant permission to use trademarks.
License termsTechnologies and topics
- AI SDK
- vercel
- Developer tools