> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keenable.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Vercel

> Web search and page fetch for apps on Vercel: AI SDK tools that work without a key, and Vercel Connect to keep the key out of your environment variables.

*AI SDK tools and Vercel Connect*

Two pieces, used together or on their own:

* **`@keenable/ai-sdk`** gives any `generateText` or `streamText` call web search and page fetch as AI SDK tools. It works without a key, so the first snippet below runs as-is, with no signup before the first call.
* **Vercel Connect** lists Keenable in its catalog. Connect keeps your API key at the team level and hands it to your code at runtime with `getToken`, so the key never sits in an environment variable.

→ [@keenable/ai-sdk on npm](https://www.npmjs.com/package/@keenable/ai-sdk) · [Keenable on Vercel Connect](https://vercel.com/connect/keenable)

## AI SDK tools

### Install

```bash theme={"system"}
npm install @keenable/ai-sdk ai zod
```

`ai` and `zod` are peer dependencies, already present in an AI SDK project. Works on `ai` v5, v6 and v7, and on zod v3 and v4. The examples use `@ai-sdk/openai`; any model provider works.

### Add the tools

```typescript theme={"system"}
import { openai } from "@ai-sdk/openai";
import { generateText } from "ai";
import { keenableTools } from "@keenable/ai-sdk";

const { text } = await generateText({
  model: openai("gpt-5.6-sol"),
  tools: keenableTools(),
  prompt: "What changed in the latest Bun release? Cite the pages you used.",
});
```

The model sees them as `keenable_search` and `keenable_fetch`. To add just one, import `keenableSearch` or `keenableFetch` instead of the pair. The tools are built on the official [`keenable`](https://www.npmjs.com/package/keenable) SDK.

<Note>
  Set `KEENABLE_API_KEY` to authenticate — this removes the hourly request cap. Without a key, calls run on the shared public tier at [lower rate limits](/rate-limits).
</Note>

Or pass the key directly: `keenableTools({ apiKey: "keen_<your_key>" })`. On Vercel, the next section keeps it out of your environment.

## Keep the key in Vercel Connect

You don't need Connect, or a key, to start. A key lifts the [request limits](/rate-limits), and Connect is where a Vercel project keeps it.

### Get a key

Create an API key in the [Keenable console](https://app.keenable.ai/console).

### Create the connector

In the Vercel dashboard, open **Connect** for your project, select **Create Connector** and choose Keenable. A connector created from the project page is linked to that project. Or, from a directory linked to the project:

```bash theme={"system"}
vercel connect create keenable --name keenable
vercel connect attach keenable/keenable
```

The CLI asks for the connection method and the key. Choose **API key**: it covers both the REST API and the MCP server, and it works with no signed-in user, so backends and cron jobs can use it.

### Fetch the key at runtime

```bash theme={"system"}
npm install @vercel/connect
```

```typescript theme={"system"}
import { getToken } from "@vercel/connect";
import { openai } from "@ai-sdk/openai";
import { generateText } from "ai";
import { keenableTools } from "@keenable/ai-sdk";

export async function answer(prompt: string) {
  const apiKey = await getToken("keenable/keenable", {
    subject: { type: "app" },
  });

  const { text } = await generateText({
    model: openai("gpt-5.6-sol"),
    tools: keenableTools({ apiKey }),
    prompt,
  });
  return text;
}
```

`keenable/keenable` is the connector's UID: the service, then the name you gave it. On Vercel, `getToken` authenticates with the deployment's OIDC token; locally, run `vercel env pull` first. Call it per request rather than once at startup. The SDK caches the key in process.

Without the AI SDK package, send the same value to the [REST API](/api-reference) as `X-API-Key` or `Authorization: Bearer`:

```typescript theme={"system"}
const res = await fetch("https://api.keenable.ai/v1/search", {
  method: "POST",
  headers: { "X-API-Key": apiKey, "Content-Type": "application/json" },
  body: JSON.stringify({ query: "latest Bun release" }),
});
```

### OAuth for MCP

The connector also offers OAuth on the [MCP server](/mcp-server). Without sign-in, the MCP server answers on the public tier, which is how a URL-only client such as a Claude custom connector uses it. With Connect's OAuth method, each user signs in to Keenable once and Connect stores their token, so their calls run on their own Keenable account, the same way the [ChatGPT](/integrations/chatgpt) install works, and there is no key to copy. It issues user tokens only (`subject: { type: "user", id }`), so use the API key method for anything that runs without a signed-in user.

## Billing

Connect stores the credential and nothing else. Calls are metered against the [credits](/credits) of the Keenable organization that owns the key, and Vercel does not charge for them.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.