Skip to content

Tavily Search API

Tavily is a search engine built specifically for AI agents and LLMs. it delivers real-time, accurate, and factual information in a format that's easy for models to process.

Endpoint

POST https://llm.siraya.pro/v1/tavily

Request Parameters

Parameter Type Required Description
model string Yes Use tavily-search.
query string Yes The search query to execute.
search_depth string No basic or advanced (default: basic).
topic string No general, news, or finance.
max_results integer No Maximum number of results to return (default: 5).
include_answer boolean No Whether to include a generated answer based on results.
include_raw_content boolean No Return the full cleaned content of the pages.

Example Request

curl https://llm.siraya.pro/v1/tavily \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <API_KEY>" \
  -d '{
    "model": "tavily-search",
    "query": "Who is the current CEO of Nvidia?",
    "search_depth": "advanced",
    "include_answer": true
  }'
import requests

url = "https://llm.siraya.pro/v1/tavily"
headers = {"Authorization": "Bearer <API_KEY>"}
data = {
    "model": "tavily-search",
    "query": "Who is the current CEO of Nvidia?",
    "search_depth": "advanced"
}

response = requests.post(url, headers=headers, json=data)
results = response.json().get("results", [])

Response Body

Returns a JSON object containing the query, an optional answer, and a set of results:

{
  "query": "Who is the current CEO of Nvidia?",
  "answer": "Jensen Huang is the co-founder, president, and CEO of Nvidia.",
  "results": [
    {
      "title": "Jensen Huang - Wikipedia",
      "url": "https://en.wikipedia.org/wiki/Jensen_Huang",
      "content": "Jensen Huang is an American electrical engineer and business executive...",
      "score": 0.98
    }
  ]
}