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. 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. A provider that cannot apply search_domain_filter or country, 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: when a provider rejects the request with a 4xx status (such as 400, 404, 422 or 429), that status and the provider’s message are forwarded. The exceptions are 401 and 403, which concern Eden AI’s own provider credentials rather than your request: those, provider 5xx errors and outages all return HTTP 502.
  • 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, call POST /v3/universal-ai with web/search/<provider> and "depth": "deep" in input, which is billed at that tier’s price.

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