A collection of AI SDK tools that give your AI agents the ability to store and manage files using Vercel Blob.
npm install vercel-blob-ai-sdkSet the BLOB_READ_WRITE_TOKEN environment variable with your Vercel Blob token.
import { generateText, stepCountIs } from "ai";
import { uploadAsset, listAssets, downloadAsset } from "vercel-blob-ai-sdk";
const { text } = await generateText({
model: 'openai/gpt-5.2',
tools: { uploadAsset, listAssets, downloadAsset },
prompt: "Save a file called hello.txt with the content 'Hello, world!'",
stopWhen: stepCountIs(3),
});| Tool | Description |
|---|---|
uploadAsset |
Upload files, images, or text content to cloud storage |
listAssets |
List stored assets with optional filtering by prefix |
getAssetInfo |
Get metadata about an asset without downloading |
downloadAsset |
Download and retrieve the contents of an asset |
copyAsset |
Copy an asset to a new location |
deleteAsset |
Delete a single asset (requires approval) |
deleteAssets |
Delete multiple assets at once (requires approval) |
Find other AI SDK agents and tools in the AI SDK Library.
Contributions are welcome! Please read our Contributing Guide for more information.