gateway.tools.exaSearch() from the ai package. You do not need an Exa API key; Vercel bills these requests through AI Gateway. See Vercel’s web search documentation for the complete reference.
Install
Install AI SDK 5 or later:install.sh
Authentication
AI Gateway requires an API key or OIDC token. Create an
AI_GATEWAY_API_KEY in the Vercel dashboard under AI Gateway > API Keys, then add it to your environment..env
VERCEL_OIDC_TOKEN instead. See Vercel’s authentication and BYOK documentation.
Quick start
You can use Exa search with any supported model:quickstart.ts
Streaming
UsestreamText to process generated text and search tool events as they arrive:
stream.ts
return result.toUIMessageStreamResponse().
Configuration
Pass options togateway.tools.exaSearch() to tune your search:
configuration.ts
See Vercel’s Exa web search reference for the full list of parameters and their behavior.
Vercel eve agents
Agents built with eve get the built-inweb_search tool, and AI Gateway models run it on Exa by default, without the need for configuration or an Exa API key. To pin the provider explicitly, export it from agent/tools/web_search.ts:
agent/tools/web_search.ts
Pricing
After that, Vercel bills requests through AI Gateway at the rates in Vercel’s web search documentation.This integration currently supports Exa’s standard search modes and content extraction controls. Deep synthesis modes and generated summaries are not exposed yet.
Use the Exa AI SDK
Call Exa directly with an Exa API key through
@exalabs/ai-sdk.Read Vercel's web search reference
Review the complete AI Gateway configuration and pricing reference.