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

# FrontierAgent

Run FrontierAgent's web\_search on SpecStream's Search API by changing two lines in .env. FrontierAgent's Serper client stays as it is, and each search costs $1 per 1,000.

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

## What you need

-   FrontierAgent, from a clone (`uv sync --python 3.12 --extra dev`) or installed with `uv tool install`, with an OpenAI-compatible model endpoint set in `.env` as its README describes.
-   A SpecStream key. [Get your key](https://specstream.ai/workspace/search?route=serper&utm_source=frontieragent&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 the two Serper lines in .env

    FrontierAgent's `web_search` posts every query to `SERPER_BASE_URL` plus `/search`, with the key in the `X-API-KEY` header. SpecStream answers Serper's calls at its own address and reads the key from the same header.

    Keep `WEB_SEARCH_PROVIDER=serper`, the default, and set the address and your key. Give the address without `/search`: FrontierAgent adds it.

    .env

    ```bash
    WEB_SEARCH_PROVIDER=serper
    SERPER_BASE_URL=https://api.specstream.ai/serper
    SERPER_API_KEY=YOUR_SPECSTREAM_KEY
    ```

2.  2

    ## 2. Start a new session

    FrontierAgent loads `.env` when it starts, so start the TUI again after the edit, in either mode:

    Terminal

    ```bash
    uv run frontier-agent --mode react --cwd /path/to/project
    ```

3.  3

    ## 3. Check a search

    Ask about something from this week. The tool lists the results with their titles, links and snippets. Each call is in the request log of your SpecStream workspace, with the Serper route as its endpoint and the price it cost.

## Where the lines can live

Exported variables and a project `.env` come first. An install made with `uv tool install` also reads `${XDG_CONFIG_HOME:-$HOME/.config}/apodex/env`: put the lines there to use SpecStream from every project, and `chmod 600` the file. Keep the key out of anything you commit.

## Read pages with the Extract API

`web_fetch` reads pages through Jina Reader at `JINA_BASE_URL`, with `JINA_API_KEY` as a Bearer token. SpecStream answers Jina Reader's calls too, so the same key reads the pages FrontierAgent sends there. Set the two lines below. FrontierAgent sends the page both ways Jina takes it, in a JSON body to the address and after the address, and SpecStream answers both, in Jina's reply shape.

Each page is one Extract API page at $0.80 per 1,000 pages, and a page with no text is not charged. Pages FrontierAgent routes elsewhere, such as papers it looks up through Unpaywall, keep their own route.

## What changes and what stays

Only the address and the key change. FrontierAgent's Serper client, its result text, its URL filters and its retries stay as they are, and SpecStream answers in Serper's shape: `organic[]` with `title`, `link`, `snippet` and `position`. With `WEB_SEARCH_PROVIDER=serper`, every `web_search` goes to SpecStream. The `parallel` and `keenable` providers are not touched.

FrontierAgent's README names a Serper-compatible address as the way to change the search provider, so the switch needs no fork and no pull request.

## Why SpecStream for web\_search

SpecStream's Search API reads each answer from the live web at the moment of the call. It scores 97.9 F-score on all 1,000 SimpleQA Verified questions and 64.0 item F1 on all 200 WideSearch tasks. Scores and method are on the [benchmarks page](https://specstream.ai/benchmarks.md).

The same key also reads pages through the Extract API, and, over [MCP](https://specstream.ai/docs/mcp.md), asks for structured records with a source URL and read time on every value.

## What each search costs

Each query is one Search API call on the fast tier: $1 per 1,000 searches of up to 10 results, a fifth of the default search's $5. A `web_search` call with several queries sends one search for each.

FrontierAgent asks for 10 results unless the agent sets `num`, which it caps at 100. Each started block of 10 more results costs in the same proportion, so a call for 50 results is $0.0058. A search that returns no results costs nothing. Calls come out of your balance with no quote and no approval.

## Limits and errors

-   With `SERPER_API_KEY` empty, the tool answers `[ERROR]: SERPER_API_KEY environment variable not set.` and sends nothing.
-   A missing or wrong key is refused with `401`, and nothing is charged.
-   When the account has used its calls for the minute, SpecStream answers `429` with `Retry-After`. FrontierAgent's client retries an HTTP error up to three times, with a wait between tries.

## Undo

Set `SERPER_BASE_URL` back to `https://google.serper.dev` with a Serper key, and `JINA_BASE_URL` back to `https://r.jina.ai` with a Jina key. Revoke the SpecStream key on the Search API screen of your workspace. Questions go to [support@specstream.ai](mailto:support@specstream.ai).

## More

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