> ## 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.

> ## Agent Instructions
> Every page is listed in https://docs.keenable.ai/llms.txt. To pick a product for a job, read https://docs.keenable.ai/choose.md
> Setup steps for agents, covering the SDKs, the MCP server and the CLI: https://docs.keenable.ai/skill.md
> Keenable search and fetch work without an API key. To add them to code, use the official SDK for the project's language: https://docs.keenable.ai/sdks.md
> Without a key, call POST https://api.keenable.ai/v1/search/public or GET https://api.keenable.ai/v1/fetch/public with an X-Keenable-Title header that names your app.
> With a key, send it in the X-API-Key header and read it from the KEENABLE_API_KEY environment variable. Never ask a user to paste a key into chat. Every access method: https://docs.keenable.ai/auth.md
> To get an API key without the console, use device login: https://docs.keenable.ai/authentication.md#device-login
> MCP server: https://api.keenable.ai/mcp (no key, or X-API-Key; keyless Codex uses https://api.keenable.ai/mcp-public), or https://api.keenable.ai/mcp-oauth for OAuth sign-in. These docs are an MCP server at https://docs.keenable.ai/mcp and the OpenAPI spec is at https://docs.keenable.ai/api-reference/openapi.json
> Keenable searches and fetches public web pages. If a question needs no web information, skip the call.
> On 402 with an API key (code insufficient_credits), stop and ask a human to add credits; don't retry. On 429, wait the number of seconds in Retry-After, then retry. Before you ship, follow https://docs.keenable.ai/production.md
> Every error, with its cause and fix, is in https://docs.keenable.ai/errors.md and moving from another search API is covered in https://docs.keenable.ai/migrate.md
> Before you compare Keenable with another search API, read https://docs.keenable.ai/guides/evaluate-search-apis.md

# Live web search for Tavus PALs

> Give a Tavus PAL live web search with one API tool that calls Keenable, so it can answer questions about current events mid-conversation.

*API tool*

A Tavus [API tool](https://docs.tavus.io/sections/conversational-video-interface/pal/llm-tool) lets a PAL call Keenable while it talks. The PAL says a short line such as "let me check", searches the web and answers from the results in the same turn. You don't need any code, and you don't need a key to try it.

## Create the tool

In the [PAL Maker](https://maker.tavus.io), open **Connectors & Tools**, choose **New Tool → API tool**, and paste this into the JSON editor:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
{
  "name": "search_web",
  "description": "Search the web for current information: news, prices, people, companies, documentation, anything recent or outside your training data. Use it whenever the user asks about something you are not sure is up to date.",
  "parameters": {
    "type": "object",
    "properties": {
      "query": {
        "type": "string",
        "description": "What to search for, in plain words"
      }
    },
    "required": ["query"]
  },
  "origin": "llm",
  "on_call": "generate_filler",
  "on_resolve": "generate_response",
  "delivery": {
    "api": {
      "url": "https://api.keenable.ai/v1/search/public",
      "method": "POST",
      "headers": {
        "X-Keenable-Title": "Tavus"
      },
      "body_template": {
        "query": "{query}",
        "max_results": 5
      },
      "timeout": 10
    }
  }
}
```

* `on_call: generate_filler` has the PAL say a short line while the search runs. `on_resolve: generate_response` has it answer in its own words from the results.
* Without a key, the `X-Keenable-Title` header is required. Set it to your app's name.
* `body_template` sends only `query` and `max_results`. Without it, Tavus also sends the filler line it adds to the arguments.
* Five results are enough for a spoken answer. More results give the model more text to read and make the reply slower.

The same tool can be created with [`POST /v2/tools`](https://docs.tavus.io/api-reference/tools/create-tool).

## Attach it to a PAL

Add the tool to your PAL in the PAL Maker, or with the API:

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
curl -X POST https://tavusapi.com/v2/pals/$PAL_ID/tools \
  -H "x-api-key: $TAVUS_API_KEY" -H "Content-Type: application/json" \
  -d '{"tool_ids": ["<tool_id>"]}'
```

If the PAL also has Tavus's built-in **Web Search** capability (`internet_search`), turn it off, so the PAL uses one search instead of two:

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
curl -X DELETE https://tavusapi.com/v2/pals/$PAL_ID/skills/internet_search \
  -H "x-api-key: $TAVUS_API_KEY"
```

Changes apply from the PAL's next conversation. To check, ask about something from this week.

## Use an API key

Tavus calls Keenable from its own servers, so without a key every Tavus customer shares the same per-IP limit on the public endpoint. Use a key for anything beyond a demo:

1. Create a key in the [Keenable console](https://app.keenable.ai/console).
2. In the tool, drop `/public` from the URL, remove the `X-Keenable-Title` header, and add `auth`:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
"delivery": {
  "api": {
    "url": "https://api.keenable.ai/v1/search",
    "method": "POST",
    "auth": {
      "type": "api_key",
      "location": "header",
      "name": "X-API-Key",
      "value": "<your Keenable key>"
    },
    "body_template": {
      "query": "{query}",
      "max_results": 5
    },
    "timeout": 10
  }
}
```

Tavus stores the key with the tool and shows it masked afterwards. Once you add the key, don't share or commit this JSON. If a key leaks, revoke it in the [console](https://app.keenable.ai/console) and create a new one.

Keyed calls are billed to your organization: 100,000 free requests a month, then \$4 per 1,000. See [Pricing](https://docs.keenable.ai/pricing.md). [Rate limits](https://docs.keenable.ai/rate-limits.md) lists the limits for both tiers.

## Or connect the MCP server

Tavus [MCP connectors](https://docs.tavus.io/sections/conversational-video-interface/pal/mcp-connectors) also accept the [Keenable MCP server](https://docs.keenable.ai/mcp-server.md), which adds page fetch to search. Register `https://api.keenable.ai/mcp-public` with auth `none`, or `https://api.keenable.ai/mcp` with auth `api_key` (header `X-API-Key`), and add the connector to `layers.mcp.connectors` on the PAL. A connector runs as a background task: the PAL acknowledges the request and reports the result when it lands. For an answer in the same turn, use the API tool above.

## Related pages

> [card] [Pipecat](https://docs.keenable.ai/integrations/pipecat.md)
>
> KeenableWebSearch gives Pipecat voice agents low-latency web search and page fetch.

> [card] [Search quickstart](https://docs.keenable.ai/products/search.md)
>
> Give your agent ranked web pages with excerpts ready to cite. Try it with no API key. Code, cost per mode, filters by site, date and domain, and gotchas.

> [card] [Search](https://docs.keenable.ai/api-reference/search.md)
>
> Search the web with POST /v1/search: ranked results with titles, URLs and snippets, filtered by site, excluded domains, publish date or index date.

> [card] [Qwen Audio Agent](https://docs.keenable.ai/integrations/qwen-audio-agent.md)
>
> Give Qwen Audio Agent's voice assistant Keenable web search with QWEN\_AUDIO\_WEB\_SEARCH\_PROVIDER=keenable. No key needed, in release 2.1.0 and later.


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