Black Friday · 30% off

Get 30% off

npm package

YouTube transcripts in Vercel AI SDK

Add YouTube to any AI SDK model with three tools: transcript (optionally timestamped), YouTube search and a channel's video list. They run fine on Vercel and other serverless platforms, where direct YouTube requests are often blocked, and Mastra agents accept them as-is.

Set it up

  1. 1

    Install

    Alongside the AI SDK:

    npm install @tubeagentkit/ai-sdk ai zod
  2. 2

    Get an API key

    Sign in at getyoutubetranscript.com and create a key on the developers page (100 free credits, no card). Keys start with sk_live_. Add it to your environment:

    GETYOUTUBETRANSCRIPT_API_KEY=sk_live_...

Summarize a video with tools

import { generateText, isStepCount } from 'ai';
import { youtubeTranscript } from '@tubeagentkit/ai-sdk';

const { text } = await generateText({
  model: 'openai/gpt-5-mini',
  prompt: 'Summarize https://youtu.be/jNQXAC9IVRw with timestamps for each key point.',
  tools: {
    youtubeTranscript: youtubeTranscript(),
  },
  stopWhen: isStepCount(3),
});

console.log(text);

What you can build

  • A chat route that answers questions about any pasted YouTube link.
  • All tools at once with getYouTubeTranscriptTools(): transcript, search and channel videos.
  • Mastra: new Agent({ ..., tools: getYouTubeTranscriptTools() }) works without changes.

Good to know

  • The key is read when a tool first runs, so building the tools never throws. API errors are passed back to the model as tool errors.

Links

Questions about Vercel AI SDK

Does it work with streamText and any provider?

Yes. These are standard AI SDK tools, so any model and any of generateText, streamText or agents can use them.

Does it work in Mastra?

Yes. Mastra 1.x agents accept AI SDK tools directly, so pass getYouTubeTranscriptTools() as the agent's tools.

What does it cost?

Each transcript, search or channel page uses one credit from your account, and failed requests are not charged. New accounts get 100 free credits, no card, and paid plans add more credits each month.

Use it in your other tools

All integrations

Featured on aitoolfame.comFeatured on Aura++Featured on DeepLaunch.ioFeatured on Dofollow.ToolsFeatured on EasyDoFollowFeatured on EarlyHuntFeatured on Findly.toolsFeatured on FoundrListGood AI ToolsFeatured on IndieHuntFeatured on LaunchBuffFeatured on launched.toolsFeatured on Launch Llama ToolsFeatured on LemonLaunchLiftOff launch badgeMy Launch StashGetYouTubeTranscript on Nick LaunchesOpenHunts Club MemberFeatured on saasfame.comShinyLaunchFeatured on ShowMeBestAIFeatured on toolfame.comListed on Turbo0Featured on Twelve ToolsHuzzler Embed BadgeFeatured on CodeHypeGetYouTubeTranscript on Better LaunchDokeyAIFeatured on WayfindioFeatured on LaunchZoneFeatured on NoonlaunchFeatured on WhatsthebigdataSurfaced on CodeTrendyFeatured on ScrollLaunchFeatured on ufind.bestFeatured on ShipBoostProduct WingWe Like ToolsAppa ListAcid ToolsPower Up ToolsToshi ListAIGC 160Appsy ToolsHunt for ToolsBeam ToolsTool Find DirTool SignalSaaS Tools DirSoftware BoltProduct List DirStack DirectorySaaS FieldSaaS WheelSaaS RootsStartup BenchmarksUnite ListTrustinerBest Tool VaultSolver ToolsAsh ListSmart Kit HubAI X CollectionAI Tech ViralMillion Dot HomepageThat App ShowLaunch ScrollMy Start ToolsLatest AI UpdatesSuper AI BoomTools Under RadarThe Key ToolsTool JourneyTools List HQThe App ToolsThe Mega ToolsSource DirTool CosmosTop Trend ToolsTiny Tool HubTool PrismStartup AIdeasFeatured on WonderLaunchFeatured on ShipycornFeatured on ToolsClawListed on ProofStoriesFeatured on ToolListedLaunched on Launch Streak