Skip to main content
Add Valyu search tools to an application built with Vercel AI SDK 5 or 6. Your model chooses when to call a tool; your application controls the prompt, tool selection and step limit.
Want to try without writing any code? Test our search tools and see results in our AI SDK Playground.
1

Installation

Installation

Install the Valyu AI SDK package:
Get your free API key from Valyu Platform - $10 free credits ($20 with a company email) when you sign up.Add it to your .env file:
The package reads it automatically.
2

Quick Start

Quick start

Get started with web search in seconds:
Your AI agent now has access to real-time web search.
3

Available Search Tools

Available search tools

Each tool is called the same way - tools: { name: toolName() }. Route each query to the most specific tool:Discovery tools (datasources, datasourcesCategories) let an agent list the available sources and categories before searching.
companyResearch auto-detects whether a company is public or private and pulls from filings, financials, news, and funding accordingly. It supports section filtering (summary, leadership, products, funding, competitors, filings, financials, news, insiders).
4

Combine multiple tools

Combine multiple tools

Register several tools so the agent chooses per query:
For streaming, swap generateText for streamText and iterate result.textStream.
5

Configuration and best practices

Configuration and best practices

Lower maxNumResults and raise relevanceThreshold to control cost. Each tool call is a separate Search request. See pricing.
Guide the model to route to the right tool, cite sources as Markdown links [Title](URL), combine tools for complex topics, and use natural-language queries (not operators). See the Prompting Guide.
Call the Search API directly with the AI SDK tool() helper:
Full types ship with the package: ValyuBaseConfig, ValyuWebSearchConfig, and per-tool config types (ValyuFinanceSearchConfig, ValyuPaperSearchConfig, etc.), plus ValyuSearchResult and ValyuApiResponse.

Next steps