
The Open Source AI Toolkit for TypeScript. Built by @Vercel.
- Tweets694
- Following4
- Followers36.8K
- Likes82
![Code snippet using generateText with the web fetch tool. const { text } = await generateText({ model: 'openai/gpt-6.1-sol', prompt: 'Read https://ai-sdk.dev and summarize.', tools: { webFetch: createWebFetchTool({ allowedDomains: ['ai-sdk.dev', 'vercel.com'], requireUrlInUserMessage: true }) } })](https://pbs.twimg.com/media/HVVDEE9aYAYLPk8.jpg?name=small&format=webp)
ALT Code snippet using generateText with the web fetch tool. const { text } = await generateText({ model: 'openai/gpt-6.1-sol', prompt: 'Read https://ai-sdk.dev and summarize.', tools: { webFetch: createWebFetchTool({ allowedDomains: ['ai-sdk.dev', 'vercel.com'], requireUrlInUserMessage: true }) } })
![Code snippet using Jev 1.14.0 to decide whether a cat is shown in an image. import { experimental_decide as decide } from 'ai' import { readFileSync } from 'node:fs' const { answers } = await decide({ model: 'typesafe-ai/jev-1.14.0', state: [ { type: 'file', mediaType: 'image', data: readFileSync('cat.jpg') } ], questions: { cat: { type: 'boolean', instructions: 'Does the image show a cat?' } } }) console.log(answers.cat.probability)](https://pbs.twimg.com/media/HU_DZdmakAElgfE.jpg?name=small&format=webp)
ALT Code snippet using Jev 1.14.0 to decide whether a cat is shown in an image. import { experimental_decide as decide } from 'ai' import { readFileSync } from 'node:fs' const { answers } = await decide({ model: 'typesafe-ai/jev-1.14.0', state: [ { type: 'file', mediaType: 'image', data: readFileSync('cat.jpg') } ], questions: { cat: { type: 'boolean', instructions: 'Does the image show a cat?' } } }) console.log(answers.cat.probability)

ALT Code snippet showcasing a text streaming function using Gemini 4 Argon to generate database guide content efficiently: import { streamText } from "ai" const result = streamText({ model:"google/gemini-4-argon", prompt: "Write a detailed guide to building a relational database from scratch", maxOutputTokens: 200_000 }) for await (const textPart of result.textStream) { process.stdout.write(textPart); }

ALT A code snippet shows an import statement for generating text using an AI model, detailing a prompt for creating a new holiday: import { generateText } from 'ai' const { text } = await generateText({ model: 'anthropic/claude-sonnet-5.5', prompt: 'Invent a new holiday and describe its traditions.' })
















