New to Exa? Try the Coding Agent Quickstart
to get started in under a minute.
@exalabs/ai-sdk package to add Exa web search to applications built with the AI SDK by Vercel. You provide an Exa API key, and the webSearch() tool handles search requests for your model.
Install
install.sh
Quick start
quickstart.ts
Create an Exa API key and set it as
EXA_API_KEY before you run the example. The package reads this environment variable automatically.Defaults
webSearch() uses these defaults:
type:autonumResults:10contents.text:3000characters per resultmaxAgeHours: the default cache fallback; set this option when you need stricter freshness
Configure search
Use the options below to tune search and content extraction:configuration.ts
Search options
Content options
TypeScript support
The package includes TypeScript types:types.ts
Related pages
Use Vercel AI Gateway
Use Exa web search without an Exa API key through Vercel’s AI Gateway.
Explore the AI SDK package
View the source code and package details on GitHub.