Vercel AI SDK

View as MarkdownOpen in Claude

Integrate You.com’s real-time web search and webpage content extraction capabilities into any application you’ve built with Vercel’s AI SDK.

The @youdotcom-oss/ai-sdk-plugin package provides three ready-made tools for the Vercel AI SDK:

  1. youSearch() for real-time web and news search
  2. youContents() for page content extraction
  3. youResearch() for comprehensive web research with citations

Drop all three into any generateText, streamText, or generateObject call to give your AI application real-time web access.

Starting from scratch? We recommend using Skills, so your agent can build this integration for you. Learn how.

Getting Started

1

Install the Package

$npm install @youdotcom-oss/ai-sdk-plugin
2

Set Your API Key

$export YDC_API_KEY="<YDC_API_KEY>"

Get your API key at you.com/platform.


Usage

Use youSearch() to give a model access to structured real-time web and news results.

1import { generateText, isStepCount } from "ai";
2import { youSearch } from "@youdotcom-oss/ai-sdk-plugin";
3import { anthropic } from "@ai-sdk/anthropic";
4
5const { text } = await generateText({
6 model: anthropic("claude-sonnet-4-5"),
7 prompt: "What happened in San Francisco last week?",
8 tools: {
9 search: youSearch(),
10 },
11 stopWhen: isStepCount(3),
12});
13
14console.log(text);

Resources