Best for: building Valyu into your product / agents. Wire Valyu search tools into a Vercel AI SDK app.
Paste into your AI assistant to wire Valyu tools into a Vercel AI SDK project.
Want to try without writing any code? Test our search tools and see results in our AI SDK Playground.
Installation
Installation
Install the Valyu AI SDK package:.env file:Quick Start
Quick Start
Get started with web search in seconds:Available Search Tools
Available search tools
Each tool is called the same way -tools: { name: toolName() }. Route each query to the most specific tool:| Tool | Best for |
|---|---|
webSearch | Real-time news, current events, general web content |
financeSearch | Stock prices, earnings, statements, market data |
paperSearch | Academic papers across PubMed, arXiv, bioRxiv, medRxiv |
bioSearch | Clinical trials, FDA labels, ChEMBL, PubChem, Open Targets, ICD codes |
patentSearch | USPTO patents, prior art, IP |
secSearch | SEC filings (10-K, 10-Q, 8-K), Form 4 insider transactions |
economicsSearch | BLS, FRED, World Bank, USAspending indicators |
companyResearch | Synthesized company intelligence reports with citations |
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).Combine multiple tools
Combine multiple tools
Register several tools so the agent chooses per query:generateText for streamText and iterate result.textStream.Configuration and best practices
Configuration and best practices
Tool configuration options
Tool configuration options
maxPrice/maxNumResults and raise relevanceThreshold to control cost. Valyu prices on CPM (cost per thousand retrievals).System prompting
System prompting
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.Build a custom tool
Build a custom tool
Call the Search API directly with the AI SDK
tool() helper:TypeScript types
TypeScript types
Full types ship with the package:
ValyuBaseConfig, ValyuWebSearchConfig, and per-tool config types (ValyuFinanceSearchConfig, ValyuPaperSearchConfig, etc.), plus ValyuSearchResult and ValyuApiResponse.Next Steps
- Valyu Platform - Get your API keys
- Valyu Documentation - Full API documentation
- Valyu Website - Learn more about Valyu
- GitHub Repository - View source code

