Skip to main content
Use Exa web search through Vercel AI Gateway with 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
When you deploy your application on Vercel, you can use the automatically available 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

Use streamText to process generated text and search tool events as they arrive:
stream.ts
In a Next.js route handler, return the stream to the client with return result.toUIMessageStreamResponse().

Configuration

Pass options to gateway.tools.exaSearch() to tune your search:
configuration.ts
The available options include: 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-in web_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
Models called through a direct provider instead of AI Gateway keep their native web search. See eve’s harness documentation for the full tool set.

Pricing

Exa web search is free through August 31 on AI Gateway and eve, so you can build with it today at no cost.
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.
Last modified on August 13, 2026