A lot of AI apps I see have the same feature request sooner or later: the user pastes a YouTube or podcast link and wants a summary, notes or answers about it. With the Vercel AI SDK the model side of that is easy. The hard part is getting the media in.
Fetching it yourself usually works on your laptop and then breaks once the app is deployed. Sites block the datacenter IPs that Vercel, AWS and the like run on, and plenty of videos have no captions to fall back on. I built Importly for this - you send it the link and get back the transcript, the file or the video's details - so here's how I wire it into an AI SDK app as tools.
The only packages you need are ai and zod .
1. Keep the key on the server
# .env.local IMPORTLY_API_KEY = your_api_key
Enter fullscreen mode
Exit fullscreen mode
The tools run in your route handler, so the key never reaches the browser.
2. Define the tools
Each tool starts a job and polls until it finishes.…