Skip to the page

Khoj web search

The variables that point it at SpecStream.

Khoj searches the web through 5 providers in a fixed order, and its docker-compose.yml runs a SearXNG container for the default. SpecStream answers three of them, SearXNG, Exa and Firecrawl, so Khoj searches with no container and no Serper plan.

Set KHOJ_SEARXNG_URL=https://api.specstream.ai/searxng/YOUR_KEY on the Khoj server and restart. For search and page reading on one key, set EXA_API_URL=https://api.specstream.ai/exa with the key in EXA_API_KEY.

SpecStream scores 97.9 F-score on all 1,000 SimpleQA Verified questions. A search of up to 10 results costs $0.005, with no daily limit. A new account gets $10 of credit, no card, which covers 2,000 searches.

New accounts get $10 of credit, no card. It covers 2,000 searches.

The web search providers Khoj offers, from each company's own pages on Nov 10, 2026

SpecStreamSerperExaFirecrawlSearXNG, self-hosted
Role in KhojSearch through KHOJ_SEARXNG_URL, EXA_API_URL or FIRECRAWL_API_URL, and page reading through the Exa or Firecrawl web scraper, on one keySearch only. Tried first when SERPER_DEV_API_KEY is setSearch and web scraperSearch and web scraperSearch only. Tried last, and the default in Khoj's docker-compose.yml
Price of a search$5 per 1,000 searches, with up to 10 results a search$1.00 per 1,000 in the pack of 50,000 credits$7 per 1,000 requests on auto, $4 per 1,000 on lite2 credits per 10 resultsNo fee. You run the server, and the engines it queries may enforce CAPTCHAs or ban its IP address
Price of reading pages$0.80 per 1,000 pages through /exa/contents or /firecrawl/v2/scrape, and a page with no text is not chargedNot a web scraper in Khoj$1 per 1,000 pages per content typeThe free plan reads 1,000 pages a month. The Hobby plan is $19 a monthNot a web scraper in Khoj
How you start$10 of credit, no card. It covers 2,000 searches2,500 free queries, no credit card$10 in credits on sign up, no payment method requiredA free plan of 500 searches or 1,000 pagesA working Docker or Podman installation
How long credit lastsCredit you buy never expiresCredits are valid for 6 monthsThe free balance resets to $10 on the first of every monthMonthly plans, from $19 a month for HobbyNo credit to buy
Address setting in KhojKHOJ_SEARXNG_URL, EXA_API_URL, FIRECRAWL_API_URL, and the WebScraper api_url in Django adminNone. Khoj's code fixes SERPER_DEV_URL at https://google.serper.dev/searchEXA_API_URL, default https://api.exa.aiFIRECRAWL_API_URL, default https://api.firecrawl.devKHOJ_SEARXNG_URL, http://search:8080 in docker-compose.yml

Why Khoj admins point its search variables at SpecStream

The other providers in Khoj, and what each costs

How SpecStream scores

The same numbers as the benchmarks page, from the official tasks and scorers.

How to set SpecStream as Khoj's web search

1. Create a key under Agents & API in the SpecStream workspace. A new account gets $10 of credit, no card, which covers 2,000 searches.

2. In the Khoj server's environment, remove SERPER_DEV_API_KEY and the Google keys if they are set, and set the Exa variables.

EXA_API_KEY=YOUR_SPECSTREAM_KEY
EXA_API_URL=https://api.specstream.ai/exa

3. Or, to keep the SearXNG path, set the SearXNG variable alone.

KHOJ_SEARXNG_URL=https://api.specstream.ai/searxng/YOUR_SPECSTREAM_KEY

4. If Django admin has WebScraper rows, set the Exa row's api_url to https://api.specstream.ai/exa with your SpecStream key.

5. Restart Khoj and send a chat with the /online prefix. Each search and each page shows up in your SpecStream request log with its price.

Frequently asked questions

Something we didn't answer? Talk to a human

How do I set up web search in self-hosted Khoj?
Set one variable on the server: KHOJ_SEARXNG_URL=https://api.specstream.ai/searxng/YOUR_KEY, or EXA_API_URL=https://api.specstream.ai/exa with the key in EXA_API_KEY. A search costs $0.005, with no container to run.
How do I point Khoj at a different SearXNG?
Change KHOJ_SEARXNG_URL, which is http://search:8080 in Khoj's docker-compose.yml. Set it to https://api.specstream.ai/searxng/ followed by your key, and SpecStream answers the HTML results page Khoj reads.
Why is Khoj online search not working?
Most often the SearXNG container is down or its engines are suspended, for 3,600 seconds after too many requests and 86,400 after a CAPTCHA. Point KHOJ_SEARXNG_URL at SpecStream and restart; a wrong key gets a 401.
Which search API does Khoj use first?
Serper, then Exa, Firecrawl, Google and SearXNG, in that order of 5. Khoj uses the first one whose key or address is set and that returns results, so leave the others unset when SpecStream answers.
Can Khoj read web pages through SpecStream?
Yes, at $0.80 per 1,000 pages. Khoj's Exa and Firecrawl web scrapers read pages through the same two addresses, https://api.specstream.ai/exa and https://api.specstream.ai/firecrawl, on the same key as search.
Is there a free search API for Khoj?
A new SpecStream account gets $10 of credit with no card, which covers 2,000 searches. After that a search costs $0.005, and credit you buy never expires.
Which web search API is best for Khoj?
SpecStream, with 97.9 F-score on all 1,000 SimpleQA Verified questions at $5 per 1,000 searches, and about one second a search under load.

Sources

SpecStream wrote this page. Khoj's settings come from its source on GitHub and its docs, and each provider's figure from that company's own page.

  1. Khoj online_search.pygithub.com/khoj-ai/khoj/blob/master/src/khoj/processor/tools/online_search.py, read Nov 10, 2026
  2. Khoj database adaptersgithub.com/khoj-ai/khoj/blob/master/src/khoj/database/adapters/__init__.py, read Nov 10, 2026
  3. Khoj docker-compose.ymlgithub.com/khoj-ai/khoj/blob/master/docker-compose.yml, read Nov 10, 2026
  4. Khoj online search docsdocs.khoj.dev/features/online_search/, read Nov 10, 2026
  5. Serperserper.dev/, read Nov 10, 2026
  6. Exa pricingexa.ai/docs/admin/pricing.md, read Nov 10, 2026
  7. Firecrawl pricingfirecrawl.dev/pricing, read Nov 10, 2026
  8. SearXNG own instancedocs.searxng.org/own-instance.html, read Nov 10, 2026
  9. SearXNG search settingsdocs.searxng.org/admin/settings/settings_search.html, read Nov 10, 2026
  10. SearXNG Docker installationdocs.searxng.org/admin/installation-docker.html, read Nov 10, 2026
  11. Google Custom Search JSON APIdevelopers.google.com/custom-search/v1/overview, read Nov 10, 2026
  12. SpecStream benchmarksspecstream.ai/benchmarks, read Nov 10, 2026
  13. SpecStream pricingspecstream.ai/pricing, read Nov 10, 2026
  14. SpecStream for agentsspecstream.ai/agents.md, read Nov 10, 2026