> SpecStream is the live web data engine for teams and agents. This is the Markdown copy of https://specstream.ai/docs/integrations/searchat. Every page, with what SpecStream does and costs: https://specstream.ai/llms.txt

# SearChat

Point SearChat's SearXNG address at SpecStream with one line in `docker-compose.yaml`. SearChat's own SearXNG code stays as it is, **SearXNG** stays its default engine, and every search runs on SpecStream's Search API instead of a SearXNG container that asks Bing and Google from your server.

[SpecStream for SearChatAI assistants](https://specstream.ai/integrations/searchat.md)

## What you need

-   SearChat deployed with Docker Compose from its `deploy/docker-compose.yaml`, with `model.json` set up.
-   A SpecStream key. [Get your key](https://specstream.ai/workspace/search?route=searxng&utm_source=searchat&utm_medium=howto) on the Search API screen of your SpecStream workspace. New accounts start with $10 of credit, no card.

1.  1

    ## 1. Set SEARXNG\_HOSTNAME in docker-compose.yaml

    In the `search_chat` service, replace the SearXNG address with SpecStream's, with your key in place of `YOUR_SPECSTREAM_KEY`. Leave `/search` off the end: SearChat adds `/search` itself.

    SearChat sends no header with a SearXNG search, so the key goes in the address. Keep the file out of anything you share, or keep the key in `.env` as shown further down. Leave the other lines of the service as they are.

    docker-compose.yaml

    ```yaml
    services:
      search_chat:
        environment:
          # SearXNG Configuration
          - SEARXNG_HOSTNAME=https://api.specstream.ai/searxng/YOUR_SPECSTREAM_KEY
          - SEARXNG_SAFE=0
    ```

2.  2

    ## 2. Recreate the container

    Run this in the folder that holds `docker-compose.yaml`. Compose sees the changed environment and recreates `search_chat`.

    Terminal

    ```bash
    docker compose up -d
    ```

3.  3

    ## 3. Ask with the SearXNG engine

    Open SearChat at `http://localhost:3000`. The engine menu lists **SearXNG** whenever `SEARXNG_HOSTNAME` is set, and it is selected by default. Ask about something recent:

    In SearChat

    ```text
    What changed in the latest PostgreSQL release?
    ```

## What changes and what stays

SearChat's SearXNG provider, `apps/server/src/core/search/provider/searxng.ts`, posts each search to `SEARXNG_HOSTNAME` plus `/search` with `format=json`. SpecStream answers in SearXNG's own JSON: `results[]` with `title`, `url` and `content`, the fields SearChat reads into its sources and citations. Chat and Deep Research both search through this provider.

`SEARXNG_SAFE` still reaches the search as `safesearch`. `SEARXNG_ENGINES` picks engines inside a SearXNG instance, and SpecStream does not use it. The JSON format lines in `searxng/settings.yml` are needed only by the local container.

## Why move off the local SearXNG

SearChat's README asks for network access because SearXNG needs Google access: the container sends each query on to Bing and Google from your server's address, which those engines can slow or block. With SpecStream the search runs on SpecStream's servers, and your server sends one request.

The Search API scores 97.9 F-score on all 1,000 SimpleQA Verified questions; scores and method are on the [benchmarks page](https://specstream.ai/benchmarks.md).

## Keep the key in .env

Docker Compose fills `${...}` in `docker-compose.yaml` from a `.env` file in the same folder. Put `SPECSTREAM_API_KEY=YOUR_SPECSTREAM_KEY` in `.env`, write the address as `https://api.specstream.ai/searxng/${SPECSTREAM_API_KEY}`, and run `docker compose up -d`.

## Remove the local SearXNG container

SearChat no longer calls the `searxng` service. You can delete that service and the `./searxng` folder from the deployment, or keep them to go back later.

## What each search costs

The SearXNG address runs the Search API's fast search: $1 per 1,000 searches of up to 10 results, from your balance, with no quote and no approval. A search that returns no results costs nothing.

A chat question asks SearChat's search graph for two queries, so it is up to two searches. Deep Research starts with `DEEP_NUMBER_OF_INITIAL_QUERIES` searches and runs up to `DEEP_MAX_RESEARCH_LOOPS` rounds, 3 each by default; lower them in `docker-compose.yaml` to search less. Every call, charged or not, is in your account's request log, and prices are on the [pricing page](https://specstream.ai/pricing.md).

## If answers come back without sources

-   SearChat's SearXNG code turns any failed search into an empty list, so a wrong key shows as an answer with no sources, not as an error.
-   Check that `SEARXNG_HOSTNAME` starts with `https://api.specstream.ai/searxng/` and holds your whole key, with no `/search` at the end.
-   Run `docker compose up -d` again after any change, so `search_chat` gets the new address.
-   When the account has used its calls for the minute, SpecStream answers `429` with `Retry-After` and charges nothing. Ask again a moment later.

## Go back to the local SearXNG

Set `SEARXNG_HOSTNAME` back to `http://searxng:8080`, keep or restore the `searxng` service, and run `docker compose up -d`. Questions: [support@specstream.ai](mailto:support@specstream.ai).

## More

[SpecStream for SearChat](https://specstream.ai/integrations/searchat.md) covers what it does in SearChat on one page. Every other tool has its guide in [Connect your tools](https://specstream.ai/docs/integrations.md). You see the most a request can cost before it starts, and the matches are paid from your balance. [Billing](https://specstream.ai/docs/billing.md) has the details. For help, email [support@specstream.ai](mailto:support@specstream.ai).
