LLM Gateway
Features

Search API

Get ranked web results with extracted page content from the search API

LLMGateway exposes a /v1/search endpoint compatible with the Perplexity Search API. It returns ranked web results with extracted page snippets, not a model-written answer. Use it for your own retrieval, grounding, or agent tools. If you want a model to search and answer in one call, use native web search instead.

Existing Perplexity Search code works after you swap the base URL and API key.

For the full request and response schema, see the API reference.

Endpoint

POST https://api.llmgateway.io/v1/search

cURL

curl -X POST "https://api.llmgateway.io/v1/search" \
  -H "Authorization: Bearer $LLM_GATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "latest developments in open-source LLMs",
    "max_results": 3,
    "search_recency_filter": "week"
  }'
{
	"id": "9ed15dce-a498-40b2-8bc9-7f13f35901cd",
	"model": "perplexity/perplexity-search",
	"results": [
		{
			"title": "…",
			"url": "https://…",
			"snippet": "…",
			"date": "2026-09-25",
			"last_updated": "2026-09-27"
		}
	],
	"server_time": null
}

Models

model is optional. When it is omitted, search_type picks the model:

search_typeModelUse for
web (or omitted)perplexity/perplexity-searchDefault quality and extraction
fastperplexity/perplexity-search-fastLower latency at a lower price

Sending both a model and a search_type that disagree returns a 400. search_type: "people" is not supported yet. Current pricing is on each model's page on the models page.

Request fields

Every field except model is forwarded to Perplexity unchanged.

FieldTypeDescription
modelstringSearch model. Optional, see Models.
querystring | string[]A query, or up to 5 related queries searched independently.
search_typestringweb or fast.
max_resultsnumberMaximum results to return. Defaults to 10.
max_tokensnumberToken budget for extracted content across all results.
max_tokens_per_pagenumberToken budget for extracted content per result.
search_context_sizestringlow, medium or high extraction depth.
countrystringISO 3166-1 alpha-2 country code for regional results.
search_language_filterstring[]ISO 639-1 language codes.
search_domain_filterstring[]Domains to include, or to exclude with a - prefix.
search_recency_filterstringhour, day, week, month or year.
search_after_date_filter / search_before_date_filterstringPublication date bounds, MM/DD/YYYY.
last_updated_after_filter / last_updated_before_filterstringLast-updated date bounds, MM/DD/YYYY.

Search is billed per successful request. There are no token charges, and a request with several queries counts as one request. Failed requests are not billed.

Search models only work on /v1/search. Requesting one on /v1/chat/completions returns a 400 pointing you at the right endpoint.

How is this guide?

Last updated on

On this page

Ready for production?

Ship to production with SSO, audit logs, spend controls, and guardrails your security team will approve.

Explore Enterprise