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

# WebRouter

WebRouter is Nimbleway's open-source Python library that gives an agent one call shape for web search and page reading across many providers. Its Tavily provider takes an `api_base_url`, so setting it to SpecStream's Tavily address sends WebRouter's `search` and `extract` calls to SpecStream. Your agent code stays as it is; only the router's config changes.

[SpecStream for WebRouterAgent frameworks & builders](https://specstream.ai/integrations/webrouter.md)

## What you need

-   Python 3.11, 3.12 or 3.13, and WebRouter with its search and extract extras, which install Tavily's Python client: `pip install "webrouter[search,extract]"`.
-   A SpecStream account. New accounts get $10 of credit, no card. [Create one](https://specstream.ai/signup?utm_source=webrouter).

1.  1

    ## 1. Create an API key

    In your SpecStream workspace, open [Agents & API](https://specstream.ai/workspace/agents?tab=keys&utm_source=webrouter), choose **API keys**, then **Create API key**, and set a total limit. Copy the key from the next screen. SpecStream shows it once.

    Keep it in an environment variable where your agent runs:

    Terminal

    ```bash
    export SPECSTREAM_API_KEY="YOUR_SPECSTREAM_API_KEY"
    ```

2.  2

    ## 2. Point the Tavily provider at SpecStream

    `provider_config` is where WebRouter takes credentials and client settings, keyed by provider name. The Tavily provider hands `api_base_url` to Tavily's own Python clients, for search and for extract alike. Set it to SpecStream's Tavily address and make `tavily` the router's default provider:

    router.py

    ```python
    import os
    
    from web_router import WebRouter
    
    router = WebRouter(
        "tavily",
        provider_config={
            "tavily": {
                "api_key": os.environ["SPECSTREAM_API_KEY"],
                "api_base_url": "https://api.specstream.ai/tavily",
            }
        },
    )
    
    response = router.search("what is retrieval augmented generation", max_results=5)
    for result in response.results:
        print(result.title, result.url)
    
    pages = router.extract(response.urls[:3], format="markdown")
    for document in pages.documents:
        print(document.url, len(document.content))
    ```

3.  3

    ## 3. Run it

    Run `python router.py`. It prints the title and address of each result, then the address and length of each page it read. `response.provider` reports `tavily`, the provider class WebRouter used, while the calls went to `api.specstream.ai`.

    To see the calls, open the Search API screen of your workspace. Each search is listed with its query and price.

## What WebRouter sends and gets back

WebRouter calls Tavily's Python client, and the client posts to the base address you set:

| WebRouter | SpecStream |
| --- | --- |
| `router.search(query, max_results=5)` | `POST /tavily/search` with `query` and `max_results` |
| `response.results[]` | `results[].title`, `url` and `content`, in Tavily's shape |
| `router.extract(urls, format="markdown")` | `POST /tavily/extract`, up to 20 pages a call |
| `pages.documents[].content` | `results[].raw_content` |

## With auto and other providers

Under `auto`, WebRouter's default, a backend given an `api_key` in `provider_config` joins the chain beside the backends whose keys are in your environment, then the keyless ones. With `tavily` named as the default, as above, every search and extract goes to SpecStream. To send one call elsewhere, pass `provider=` on that call.

`AsyncWebRouter` takes the same arguments: open it with `async with AsyncWebRouter("tavily", provider_config=config) as router:` and await `router.search(...)` and `router.extract(...)`.

## Cost

Each `search` is one fast search through the Tavily address: a fifth of the default search's $5 per 1,000 searches of up to 10 results. A `max_results` above 10 costs more in the same proportion, and a search that returns no results costs nothing. WebRouter's Tavily search sends no `include_answer`, so it stays on the fast tier.

Each page `extract` reads is $0.80 per 1,000 pages, and a page with no text is not charged. Both come out of your balance, with no quote and no approval.

For scale, WebRouter's own price list, `PRICING.md`, checked October 7, 2026, puts a default Tavily search at one credit of $0.008 and a default Nimble search at $5.00 per 1,000.

New accounts start with $10 of credit, no card. [Balance and billing](https://specstream.ai/docs/billing.md) has the details.

## Remove

Delete the `tavily` entry from `provider_config`, or drop its `api_base_url`. To stop the key working everywhere, revoke it in **Agents & API**. The same Tavily address serves other tools: see [Moving off Tavily](https://specstream.ai/migrate/tavily.md). Other ways to build with SpecStream are in [agent frameworks](https://specstream.ai/docs/frameworks.md). Questions go to [support@specstream.ai](mailto:support@specstream.ai).

## More

[SpecStream for WebRouter](https://specstream.ai/integrations/webrouter.md) covers what it does in WebRouter 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).
