> ## 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
> 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
> Read an API key from the KEENABLE_API_KEY environment variable. Never ask a user to paste a key into chat; send them to https://docs.keenable.ai/api-keys.md
> On 402 with an API key (code insufficient_credits), stop and ask a human to add credits; don't retry. On the pay-per-request paths a 402 is the payment offer: pay it and retry, see https://docs.keenable.ai/pay-per-request.md. On 429, wait the number of seconds in Retry-After, then retry.
> Every error, with its cause and fix: https://docs.keenable.ai/errors.md

# Tavus

> 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={"system"}
{
  "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={"system"}
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={"system"}
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={"system"}
"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 count against your [credits](https://docs.keenable.ai/credits.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.


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