# Tavily API keys: find, store, rotate, and use them safely with AI agents

Source: https://botpassword.com/keys/tavily
Last checked: 2026-11-08

Tavily API keys start with `tvly-` and are created in the Tavily dashboard at `app.tavily.com`, each with a name, a development or production type and an optional monthly credit limit. Requests send the key as `Authorization: Bearer <key>`, and the official Tavily MCP server reads it from `TAVILY_API_KEY`. Tavily recommends rotating keys about every 90 days.

## Key types

| Type | Prefix | Secret | Scope | Expiry |
|---|---|---|---|---|
| Development key | `tvly-` | Yes | Every Tavily endpoint (search, extract, crawl and others), spending the account's API credits | — |
| Production key | `tvly-` | Yes | Every Tavily endpoint, spending the account's API credits | — |

## How to create a Tavily key

1. Sign in to the Tavily Platform at `app.tavily.com`, or create an account; new accounts get 1,000 free API credits a month without a card.
2. In the dashboard, click the **+** button next to the API keys section.
3. Name the key, choose **Development** or **Production**, and set a monthly usage limit.
4. Copy the `tvly-` key and store it in `TAVILY_API_KEY` or a secrets manager.

## Limiting what the key can do

Tavily keys have no per-endpoint permissions, so the controls are the key type and the monthly limit. A development key is held to 100 requests per minute and a production key to 1,000. The monthly limit caps how many API credits one key can spend, which bounds the damage from a leaked key or an agent stuck in a loop. Requests over a key or plan limit fail with HTTP 432, and PayGo overages with 433. A `X-Project-ID` header tags requests with a project for usage reporting; it does not restrict the key.

## How to rotate a Tavily key

1. Create a new Tavily key in the dashboard while the old key stays active.
2. Deploy the new key to `TAVILY_API_KEY` and every secrets manager that holds the old one.
3. Confirm requests succeed with the new key.
4. Delete the old key from the dashboard.

## How to revoke a Tavily key

1. Sign in to the Tavily dashboard.
2. Revoke or delete the key in the API keys section, which stops any further use of it.

## If the key leaked

1. Sign in to the Tavily dashboard and revoke or delete the exposed key immediately.
2. Create a replacement key with a monthly limit.
3. Update environment variables, secrets managers and code that used the old key.
4. Contact support@tavily.com if usage spiked before the key was revoked.

## Environment variables

- `TAVILY_API_KEY`

## Gotchas

- HTTP 432 is a credit limit, not a bad key, and retrying does not help until the limit changes.
- Development keys are capped at 100 requests per minute, so a key that works in testing can throttle in production.
- The remote MCP server accepts the key as a `tavilyApiKey` URL parameter, which can end up in logs and client config files; OAuth or the `Authorization` header keeps it out of the URL.

## Using this key with AI agents (BotPassword)

- `run_with`: Runs a command with the key injected as an environment variable or a 0600 temporary file, never on the command line, and redacts the key from the output.
- `http_request`: Makes an authenticated API call after checking the destination against the hosts this key may be sent to. The response comes back with credential-shaped values redacted, and one that holds the key itself is refused.

## FAQ

### Where do I get a Tavily API key?

Sign in at `app.tavily.com`; the dashboard lists your keys, and the **+** button next to the API keys section creates another. The free plan includes 1,000 API credits a month.

### What does a Tavily API key look like?

Tavily keys begin with `tvly-`, and Tavily's examples send them as `Authorization: Bearer tvly-YOUR_API_KEY`.

### How do I add Tavily search to Claude, Cursor or another MCP client?

Use Tavily's official MCP server. The remote server at `https://mcp.tavily.com/mcp/` can sign in with OAuth, so no key is pasted into the client; the local server (`npx -y tavily-mcp@latest`) reads the key from `TAVILY_API_KEY`.

### What is the difference between Tavily development and production keys?

A development key allows up to 100 requests per minute and a production key up to 1,000. Both spend the same account credits.

### How often should I rotate my Tavily API key?

Tavily suggests about every 90 days. Create the new key first, deploy it, check it works, then delete the old one.

### Can an AI agent use my Tavily key without seeing it?

Yes, if the key never enters the agent's context. Instead of pasting the key into a chat or leaving it in a `.env` file the agent can read, keep it in a credential broker that injects it into the command or request on the agent's behalf. BotPassword does this with `run_with`, `http_request`, so the agent gets the result and never the value.

## Sources

- https://docs.tavily.com/documentation/quickstart
- https://docs.tavily.com/documentation/mcp
- https://docs.tavily.com/documentation/api-reference/endpoint/search
- https://docs.tavily.com/documentation/best-practices/api-key-management
- https://docs.tavily.com/documentation/enterprise/generate-keys
- https://help.tavily.com/articles/9170796666-how-can-i-create-an-api-key
