Skip to main content
The AI SDK by Vercel is the AI toolkit for TypeScript and JavaScript from the creators of Next.js. DeepInfra has a first-party AI SDK provider. See the full AI SDK docs for DeepInfra.

Installation

Get your API key from the Dashboard.

Text generation

With a system message:

Streaming

Conversations

Streaming conversations work the same way — use streamText with messages.

Structured data

Generate typed, structured output using Zod schemas:
Enum output:

Tool / function calling