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.
Pricing
Exa web search costs $7 per 1,000 search requests, including up to 10 results per request. Additional results beyond 10 cost $1 per 1,000 additional results. Vercel bills requests through AI Gateway, as described 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.