Skip to main content
Use the @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

Get your Exa API key

Create a key in the dashboard. New accounts start with free credits.
Set your key as EXA_API_KEY before you run the example. The package reads this environment variable automatically.

Defaults

webSearch() uses these defaults:
  • type: auto
  • numResults: 10
  • contents.text: 3000 characters per result
  • maxAgeHours: the default cache fallback; set this option when you need stricter freshness
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

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.
You can also find the package on npm and read the Vercel AI SDK web search guide.
Last modified on September 15, 2026