Databases, search and data

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

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.

Tavily key types

TypePrefixSecret?ScopeExpiry
Development key
Rate limited to 100 requests per minute.
tvly-YesEvery Tavily endpoint (search, extract, crawl and others), spending the account's API credits—
Production key
Rate limited to 1,000 requests per minute.
tvly-YesEvery 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.

Open Tavily's key settings

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.

Tavily recommends rotating keys periodically, for example every 90 days. There is no in-place regenerate, so rotation means create, deploy and then delete. Enterprise accounts can generate and deactivate keys through the API, including keys with a time-to-live in hours.

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 your Tavily 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 and CLI

Tavily's SDKs and docs read the key from TAVILY_API_KEY.

Things that catch people out

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

Common Tavily authentication errors

401 - Unauthorized - Your API key is wrong or missing.

The request sent no Tavily key, a mistyped key or a deleted one.

432 - Key limit or Plan Limit exceeded

The key reached its monthly usage limit, or the account reached its plan's credit allowance.

433 - PayGo limit exceeded

Pay-as-you-go usage reached its configured limit.

Using your Tavily key with AI agents

A coding agent that can read your .env file or your shell history can read the key, and anything in its context can end up in logs, transcripts or a prompt-injected request. The safer pattern is to keep the key in a credential broker that performs the authenticated step for the agent and hands back only the result.

BotPassword works this way. For a Tavily key, these intents fit:

IntentWhat BotPassword does
run_withRuns 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_requestMakes 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.

Tavily also publishes its own MCP server. Whatever server the agent uses, keep the credential it authenticates with out of the agent's context.

Set it up in your agent: Aider · Amp · Claude Code · Claude Desktop · Cline · OpenAI Codex CLI · all agents

Frequently asked questions

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.

Stop pasting Tavily keys into agents

BotPassword is in early access. Request an invite and we'll email you when your spot opens.