Portkey plugin docs
Tavily Online Search
Get API Key
Sign up at tavily.com
Introduction
Portkey is an AI gateway and agent platform for routing, guardrails, observability, and agent integrations. There are two ways to use Tavily in Portkey:- Tavily MCP server — connect Tavily through Portkey’s MCP support to expose Tavily-native tools like
tavily_search,tavily_extract,tavily_crawl,tavily_map, andtavily_research. - Tavily Online Search plugin — use Tavily as a Portkey plugin/guardrail to inject fresh web search context into model requests.
Option 1: Tavily MCP server
Portkey supports the Tavily MCP server, which is the best fit when your agent should call Tavily as a tool. With this setup, you can expose Tavily’s remote tools inside Portkey, including:tavily_searchtavily_extracttavily_crawltavily_maptavily_research
- Native tool calling
- Access to multiple Tavily capabilities beyond search
- Agent workflows that decide when to call Tavily directly
Option 2: Tavily Online Search plugin
Portkey also offers a Tavily Online Search plugin that works through Portkey’s plugin and guardrail system. This option is ideal when you want Portkey to fetch live web information and attach it to a model request automatically, without building a separate tool-calling flow.Setup overview
- Enable the Tavily plugin in Portkey and connect your Tavily API key.
- Create a Tavily guardrail and configure search behavior such as:
- search depth
- number of results
- recency and geography filters
- domain allow/block lists
- content enrichment options
- Add the guardrail to a Portkey config.
- Use that config in your requests so Portkey injects Tavily results automatically.
How the plugin works
When the Tavily Online Search plugin runs, Portkey enriches the request with Tavily search output before the model answers. This gives your model access to fresh web context while still using Portkey configs and guardrails as the control layer. Use this option when you want:- Search augmentation without explicit tool calls
- Centralized control through Portkey guardrails and configs
- A simpler way to add live web context to standard model requests
Which one should you use?
| If you need | Recommended Portkey integration |
|---|---|
| Full Tavily tool access for agents | Tavily MCP server |
| Search context injected into normal model requests | Tavily Online Search plugin |
| Search, extract, crawl, map, and research tools | Tavily MCP server |
| Guardrail-driven online search inside a Portkey config | Tavily Online Search plugin |