Skip to main content
Search the web through Eden AI using any client built for the Perplexity Search API. Point your client at https://api.edenai.run/v3 to run web searches on any of the search providers Eden AI offers (tavily, linkup, firecrawl, deepseek, perplexityai, zai). GET /v3/search/models lists them, and the samples below use tavily.

Overview

The surface is a facade over POST /v3/universal-ai for Web Search (web/search): it shares the same providers, pricing, provider parameters allowlist, and request history. Unlike universal-ai’s 200 {"status": "fail"}, search failures return standard HTTP error codes in the OpenAI error envelope. Both POST endpoints accept the same request body and return the same response structure. When a request specifies a provider in both the URL path and the body model, both values must match (returning HTTP 400 otherwise). When neither specifies a provider, the endpoint returns HTTP 400 asking for one; call GET /v3/search/models to see which you can use.
Search providers are not listed in GET /v3/models (which covers chat completions only). Use GET /v3/search/models to discover callable search providers.

Install

The Python sample uses Perplexity’s official SDK, published on PyPI as perplexityai. The package named perplexity is an unrelated, unofficial one.

Usage

Open WebUI

Open WebUI’s built-in Perplexity Search engine works with this API. It posts a fixed {query, max_results} body with no model, so put the provider in the URL path, such as https://api.edenai.run/v3/search/tavily. See Web Search in the Open WebUI guide for the setup.

Request Fields

Filter support varies by provider: search_domain_filter is supported on tavily, linkup, and perplexityai, while country is supported on tavily and perplexityai. A provider that cannot apply search_domain_filter or country (deepseek, firecrawl, zai), or does not cover the country you sent, returns HTTP 400 with a message naming the field and the provider, so the search never runs without the filter you asked for. Unknown fields are rejected with HTTP 422 rather than silently dropped, so unsupported Perplexity parameters (such as search_recency_filter, search_language_filter, or max_tokens_per_page) fail immediately. Eden-specific universal-ai parameters (such as fallbacks, provider_params, or @edenai routing) are not accepted on this surface: use POST /v3/universal-ai with web/search/<provider> for advanced configuration. Caller tags remain supported via the X-EdenAI-Tags request header.

Response Structure

  • results[].snippet: The text snippet returned by the search provider.
  • results[].title: The title of the page (empty string when not provided).
  • results[].date and results[].last_updated: Always null because search providers do not return standardized timestamp metadata.
  • provider and cost: Eden AI extensions indicating the executed provider and the cost in USD. These are also returned via x-edenai-provider and x-edenai-cost HTTP response headers.
  • id: The Eden AI request identifier.
  • With the x-edenai-metadata: enabled header, the response body also includes edenai_metadata.

Errors

Errors follow the OpenAI envelope {"error": {"message", "type", "code"}}:
  • HTTP 400 for conflicting providers, missing providers, or a filter the provider does not support.
  • HTTP 404 for unknown providers.
  • HTTP 422 for schema validation errors or unrecognized fields.
  • Provider errors: provider errors follow the V3 error policy. Request errors (such as 400 or 422) forward the provider status and message. On Eden AI provider accounts, account failures (401, 402, 403, 404, or 410) return HTTP 502 with a generic message, rate limits return HTTP 429 with a generic message, provider 5xx errors preserve their status with a generic message, and timeouts return HTTP 504.
  • Authentication errors (401 or 403) and rate limits (429) return the platform {"detail": ...} format because they trigger before the route handler executes.

Limitations

  • Recency filter: Date filters are not mapped yet, so Perplexity’s search_recency_filter and the providers’ own date parameters cannot be used here.
  • Search depth: Searches run at the standard depth. For the deep tier on supported providers (firecrawl, linkup, tavily), call POST /v3/universal-ai with web/search/<provider> and "depth": "deep" in input, which is billed at that tier’s price. Providers with a single tier (deepseek, perplexityai, zai) reject deep with HTTP 400.

Pricing

A search costs the same as a universal-ai web/search call on the same provider, with nothing added for this endpoint. GET /v3/search/models returns each provider’s pricing, and every response reports what the call cost in cost and the x-edenai-cost header.

Next Steps

Expert Web Search

The same providers through universal-ai, with fallbacks and provider parameters

LLM Web Search

Enable web search during LLM chat completions

Open WebUI

Connect Open WebUI to Eden AI for chat and search