> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tavily.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Eden AI

> Run Tavily Search through Eden AI's unified API by selecting Tavily as the web search provider.

## Introduction

[Eden AI](https://www.edenai.co/docs/v3/overview/ai-gateway) is an AI gateway. It exposes models and expert AI features from many vendors behind one API, so you can switch providers by changing a single model string.

Eden's [web search](https://www.edenai.co/docs/v3/expert-models/features/web/search) feature returns ranked web results from the provider you choose. Set the model to `web/search/tavily` and Eden runs the search with Tavily.

You don't need a Tavily account for this. Requests authenticate with your Eden AI API key, and searches are billed through your Eden AI account.

## Prerequisites

* An Eden AI API key from the [Eden AI dashboard](https://app.edenai.run/admin/iam/api-keys).

<Note>
  [Sandbox keys](https://www.edenai.co/docs/v3/general/sandbox) return mock responses without calling Tavily. Use a production key to get real Tavily results.
</Note>

## Set up Tavily in Eden AI

<Steps>
  <Step title="Send a search with the Tavily model">
    Send a `POST` request to `/v3/universal-ai` with `model` set to `web/search/tavily`. Put the query in `input`, and put any Tavily-specific options, such as `include_domains`, in `provider_params`.

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://api.edenai.run/v3/universal-ai \
        -H "Authorization: Bearer $EDENAI_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "model": "web/search/tavily",
          "input": {
            "query": "Flask security advisories",
            "max_results": 3
          },
          "provider_params": {
            "include_domains": ["github.com"]
          }
        }'
      ```

      ```python Python theme={null}
      import os
      import requests

      response = requests.post(
          "https://api.edenai.run/v3/universal-ai",
          headers={
              "Authorization": f"Bearer {os.environ['EDENAI_API_KEY']}",
              "Content-Type": "application/json",
          },
          json={
              "model": "web/search/tavily",
              "input": {
                  "query": "Flask security advisories",
                  "max_results": 3,
              },
              "provider_params": {
                  "include_domains": ["github.com"],
              },
          },
      )

      for result in response.json()["output"]["results"]:
          print(result["url"])
      ```
    </CodeGroup>
  </Step>

  <Step title="Read the results">
    The response confirms which provider ran the search and returns one entry per page in `output.results`, each with a `title`, `url`, `content` snippet, and relevance `score`. Because `include_domains` is set to `github.com`, every result comes from that domain.

    ```json theme={null}
    {
      "status": "success",
      "provider": "tavily",
      "feature": "web",
      "subfeature": "search",
      "output": {
        "query": "Flask security advisories",
        "results": [
          {
            "title": "Security Policy · kdpisda/flask-rls · GitHub",
            "url": "https://github.com/kdpisda/flask-rls/security/policy",
            "content": "flask-rls enforces data isolation at the database level.",
            "score": 0.7730283
          },
          {
            "title": "Flask-Security-Too OAuth reauthentication freshness bypass · CVE-2026-46715 · GitHub Advisory Database",
            "url": "https://github.com/advisories/GHSA-97r5-pg8x-p63p",
            "content": "Published to the GitHub Advisory Database May 22, 2026.",
            "score": 0.72884524
          },
          {
            "title": "Security: multiple flask-cors advisories appear reachable in RD-Agent · Issue #1425 · microsoft/RD-Agent",
            "url": "https://github.com/microsoft/RD-Agent/issues/1425",
            "content": "CVE-2024-6221, flask-cors 4.0.1: the response included Access-Control-Allow-Origin.",
            "score": 0.7216064
          }
        ]
      }
    }
    ```
  </Step>
</Steps>

## Configure Tavily searches

Eden splits search options into two objects:

* **`input`** holds Eden's common search fields, which work the same for every provider.
* **`provider_params`** holds Tavily-specific options, which Eden passes through to Tavily Search.

Set these in `input`:

| Field | Required | Description |
| - | - | - |
| `query` | Yes | The search query. |
| `max_results` | No | Maximum number of results to return. |
| `depth` | No | Eden's search tier, priced per tier: `standard` (default) or `deep`. |

Set Tavily options in `provider_params`, using the same field names as the [Tavily Search API](/documentation/api-reference/endpoint/search). For example:

```json theme={null}
"provider_params": {
  "search_depth": "advanced",
  "topic": "news",
  "time_range": "week",
  "include_domains": ["github.com"]
}
```

Eden accepts only an allowlisted set of Tavily options, including `search_depth`, `topic`, `time_range`, `start_date`, `end_date`, `country`, `include_domains`, `exclude_domains`, `chunks_per_source`, `include_raw_content`, and `include_images`. It rejects any other field with `400 Bad Request`. See [Eden AI: Web search](https://www.edenai.co/docs/v3/expert-models/features/web/search#provider-parameters) for the full list.

<Note>
  `depth` in `input` is Eden's provider-agnostic search tier, and Eden prices each tier separately. To control how Tavily runs the search, set `search_depth` (`basic`, `advanced`, `fast`, or `ultra-fast`) in `provider_params`.
</Note>

## Best practices

* **Set Tavily's search depth explicitly.** Use `search_depth: "advanced"` in `provider_params` when you need more relevant content from each result, and `basic` or `fast` for quick lookups.
* **Scope searches with domain filters.** Use `include_domains` to keep results within sources you trust, such as official documentation or advisory databases, and `exclude_domains` to drop sources you don't want.
* **Check provider parameters when you add fallbacks.** If the request uses Eden's [`fallbacks`](https://www.edenai.co/docs/v3/general/fallback), every `provider_params` field must be allowed for Tavily and for each fallback provider, or Eden rejects the whole request.
* **Test with a production key.** Sandbox keys return mock data, so they can't confirm that your query or provider parameters return the results you expect.

## Resources

* [Eden AI: Web search](https://www.edenai.co/docs/v3/expert-models/features/web/search)
* [Eden AI: Provider parameters](https://www.edenai.co/docs/v3/expert-models/provider-parameters)
* [Eden AI dashboard](https://app.edenai.run/admin/iam/api-keys)
* [Tavily Search API reference](/documentation/api-reference/endpoint/search)
